jjhelmus / nmrglue

A module for working with NMR data in Python
BSD 3-Clause "New" or "Revised" License
209 stars 86 forks source link

Reading simpson files: fixes cases where multiple FIDs are concatenated #82

Closed kaustubhmote closed 6 years ago

kaustubhmote commented 6 years ago

Simpson can generate multiple datasets when multiple detect operators are specified. These are written as concatenated datasets and the number of such datasets is indicated by the keyword 'NELEM' in the simpson text and binary data formats. This PR fixes the functions read_text and read_binary to read in such a dataset. In cases where there is only a single FID, the keyword 'NELEM' is set to 1 and the data will be read in as usual, but an extra key 'NELEM' will be added to the dictionary. With this functionality, it is not possible to write data in xreim, xyreim and raw_binary formats, so those functions are not modified. An example file in the text format is attached.

out.fid.zip

jjhelmus commented 6 years ago

@kaustubhmote Thanks for the fix.