Closed gul916 closed 2 years ago
Hi, based on the error stack, it seems that the array data
is empty.
When you are reading in the data, can you try with ng.bruker.read_pdata
instead of ng.bruker.read
. Your directory seems to be a processed data directory, but you seem to also have raw data in it, since the ng.bruker.read
line does not raise any error. If this does not work, you should look at whether data
is still empty, and if not, please post the output of data.shape
for further debugging.
Hey everyone, while we are discussing bruker 2D data...
Is anyone able to use NUS 2D data? Is there a way to port over the reconstruction that topspin uses (or even invoke it from a command line through subprocess)?
I can run it through topspin, then render, but if I could remove topspin from my processing scheme, that would be awesome.
Any ideas?
On Sep 25, 2019, at 5:55 PM, Kaustubh R Mote notifications@github.com<mailto:notifications@github.com> wrote:
Hi, based on the error stack, it seems that the array data is empty. When you are reading in the data, can you try with ng.bruker.read_pdata instead of ng.bruker.read. Your directory seems to be a processed data directory, but you seem to also have raw data in it, since the ng.bruker.read line does not raise any error. If this does not work, you should look at whether data is still empty, and if not, please post the output of data.shape for further debugging.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/jjhelmus/nmrglue/issues/109?email_source=notifications&email_token=AET7CPSF2AVU63HD3MY7CHDQLQCATA5CNFSM4I2PPUAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7T4FDY#issuecomment-535282319, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AET7CPU4L3N3ICNWGIHWYWDQLQCATANCNFSM4I2PPUAA.
@kaustubhmote Importation works perfectly. I can process, plot the data or whatever. The data set is not empty and has the expected shape. The advantage to use the processed directory when importing with ng.bruker.read is that you can directly use the same directory with ng.bruker.write_pdata. The problem is the same if I use read with the expno directory and write_pdata with the procno directory. However, if I use read_pdata and write_pdata, it works, but I want to use raw data.
@Jmegan042 For Non-Uniform Sampling (NUS), you can use MddNMR that is working under Linux or MAC with NMRpipe. You can then import data to python with nmrglue, which I tested. I suppose a full automated workflow can be implemented by importing Topspin data, converting it to nmrpipe, processing it with mddnmr, importing back nmrpipe results and converting it to bruker, but I have not yet tested.
@gul916, I see, the problem seems to be in the reorder_submatrix
routine which does not handle raw data correctly. I am guessing that if correct values are given for the submatrix_shape
parameter in the write_pdata
function, and the appropriate parameters are changed in procs
and proc2s
file (so that they match the raw data), this will work. What those values should may take a bit of time to figure out, but the following hack works:
In Topspin, process the data without using and additional zero-filling (keep SI in both the dimensions equal to TD for that dimension). Read the raw data so that the procs
files that are read belong to the zero-fill-less data (this currently requires that pdata folder is 1). Writing back to another processed data using this new dictionary works fine. I am able to get Topspin to read raw data as processed data using this. In general, getting topspin to write out the procs file with appropriate dimensions works with either raw or processed data. But, this is just a hack, and I am sure editing the files in appropriate places so that they are consistent with the data being written out should work via nmrglue.
@kaustubhmote
With your indications, I was able to make write_pdata
work with the following code, whatever the zero-filling in procno.
Thanks a lot.
data_dir = '2D/1/pdata/1'
dic, data = ng.bruker.read(data_dir)
data = ng.proc_base.zf_size(data, dic['procs']['SI'])
data = ng.proc_base.tp_hyper(data)
data = ng.proc_base.zf_size(data, dic['proc2s']['SI'])
data = ng.proc_base.tp_hyper(data)
ng.bruker.write_pdata(data_dir, dic, data, overwrite=True)
Hello and thank you for all your work. I have a problem to save a 2D Bruker processed data file. Here is my code, used under Linux CentOS 7.7 with Python Anaconda 3.7, Spyder 3.3.6 and nmrglue 0.7. Could you please help me to solve this ? Thank you by advance.