Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phasing #8

Open
ReinerD opened this issue Jan 12, 2024 · 5 comments
Open

phasing #8

ReinerD opened this issue Jan 12, 2024 · 5 comments

Comments

@ReinerD
Copy link

ReinerD commented Jan 12, 2024

Hello, I'm trying to use nmrpy to handle an array of solid state T1rho data. While the original data has been phased using topspin, I'm struggling to get the spectra phased using the module. Is there a way to set the phc0 and phc1 parameters (known from the topspin procs) directly?

@jmrohwer
Copy link
Collaborator

@ReinerD
Copy link
Author

ReinerD commented Jan 23, 2024 via email

@jmrohwer
Copy link
Collaborator

This has to do with the way add_fids works, and with the uniqueness of the Fid IDs (fid.id). This ID starts at zero and is incremented automatically when the FidArray is instantiated. This means your FIDs inside fid_array1 and fid_array2 have the same IDs, both starting from zero (try it1!). So the call fid_array1.add_fids(fid_array2.get_fids()) will just replace the FIDs in array1 with those from array2 because it works on the IDs and the ID has to be unique.

The way to solve this is to first create a new list containing all the fids from both arrays, then create a new empty FidArray, and add the combined list to that array. When the new FidArray is populated, the IDs are recreated starting from zero.

combined = fid_array1.get_fids() + fid_array2.get_fids()
new_fa = nmrpy.data_objects.FidArray()
new_fa.add_fids(combined)

@ReinerD
Copy link
Author

ReinerD commented Jan 23, 2024 via email

@ReinerD
Copy link
Author

ReinerD commented Jan 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants