Functions to convert between NMR file formats
This modules is imported as nmrglue.convert and can be called as such.
This class is targetted for users of nmrglue.
Object which allows conversion between NMR file formats, including low memory data objects.
Conversion between NMR file formats with this class involves three steps. First a new converter object must be created. Then the converter must be loaded with data using a from_ method. Finally, the dictionary and data representation of a NMR data in the desired format is extracted using a to_ method. This can then be written to disk.
Example conversion:
vdic, vdata = ng.varian.read("varian_dir")
C = ng.convert.converter()
C.from_varian(vdic, vdata)
pdic, pdata = C.to_pipe()
ng.pipe.write("test.fid", pdic, pdata)
Spectral parameters can be provided directly by passing a Universal dictionary to any of the from_ methods. If not provided the spectral parameters are guessed from the file format’s dictionary of parameters.
Load converter with Bruker data.
Parameters : | dic : dict
data : array_like
udic : dict, optional
|
---|
Load converter with NMRPipe data.
Parameters : | dic : dict
data : array_like
udic : dict, optional
|
---|
Load converter with RNMRTK data.
Parameters : | dic : dict
data : array_like
udic : dict, optional
agilent_compatible : bool, optional
|
---|
Load converter with Sparky data.
Parameters : | dic : dict
data : array_like
udic : dict, optional
|
---|
Load converter with Universal data.
Parameters : | dic : dict
data : array_like
|
---|
Load converter with Agilent/Varian data.
Parameters : | dic : dict
data : array_like
udic : dict, optional
|
---|
Return Bruker format data.
Returns : | dic : dict
data : array_like
|
---|
Return NMRPipe format data.
Parameters : | datetime : datetime object, optional
|
---|---|
Returns : | dic : dict
data : array_like
|
Return RNMRTK format data.
Parameters : | agilent_compatible : bool, optional
dim_order : list, optional
|
---|---|
Returns : | dic : dict
data : array_like
|
Return Sparky format data.
Parameters : | datetime : datetime object, optional
user : str, optional
|
---|---|
Returns : | dic : dict
data : array_like
|
These classes are typically not used directly by users. Developers who want fine control over file conversion will be interested in these classes
Wrap other fileiobase.data_nd derived objects with input/output conversion when slices are requested.
Parameters : | edata : fileiobase.data_nd derived object
iproc : dict
oproc : :
odtype : dtype
order : tuple
|
---|
Notes
The iproc and oproc dictionary can contains the following keys and values.
key | value | Description |
---|---|---|
alt_id_sign | True/False | True alternates signs along indirect dims. |
realfactor | float | Real channel scaling factor. |
imagfactor | float | Imaginary channel scaling factor. |