Closed kaustubhmote closed 5 years ago
Thanks for putting this together. Merging.
Thanks,
A slightly tangential question: Do you prefer opening a Issue and then making a PR? Or something like this one is acceptable?
However you feel like contributing is fine by me, either with or without an accompanying issue.
Currently, the functionality to write files in Bruker's formats is pretty good, but the files are not written out in a way that will make them accessible from Topspin. 2 things need to be done to make this happen: (i) Write acquN files in addition to acquNs files and (ii) write out the procN and procNs files in the correct subfolders. These commits give options to the user to do these things via
write
andread
functions inbruker.py
. The following changes are made:bruker.write
will now write acquN files in addition to acquNs files to the given directory. These will be identical files. Another option was to read and write out theacquN
, but that adds unnecessary keys to the dictionary. This is a change in default behaviour, but it seems harmless to me even if the purpose of writing out the file was is not to read back the data in Topspin (one additional file is written out).read_procs
is set to True in thebruker.read
function, any pdata folders inside the given directory will also be searched and by default the procNs files in folder number 1 will be read. If folder number 1 in not present, one of the other folders is read in.write
has 3 new arguments (procs_files
,write_procs
, andpdata_folder
). The first two arguments are similar to theiracqus
counterparts.pdata_folder
will allow the user to define a (integer) subfolder where these are stored. By default, all the options are disabled, so the behaviour of the function should not be altered otherwise.At some point in the (hopefully) near future, I plan to put in functionality to write out processed data that can be read in Topspin. The additions in this PR will be required to be able to read these data back in Topspin. In any case, these additions already help out in pre-processing the data (for example, splitting and sorting interleaved datasets) that can be then processed in Topspin.