nmrglue.fileio.varian.read¶
-
nmrglue.fileio.varian.
read
(dir='.', fid_file='fid', procpar_file='procpar', read_blockhead=False, shape=None, torder=None, as_2d=False)[source]¶ Read Agilent/Varian files in a directory.
- Parameters
- dirstr, optional
Directory holding Agilent/Varian data. Default is the current working directory.
- fid_filestr, optional
Filename of binary (fid) file in directory.
- procpar_filestr, optional
Filename of procpar file in directory.
- read_blockheadbool, optional
True to read blockheader(s) and return then in the Agilent/Varian parameter dictionary. False (default) does not perform this reading.
- shapetuple of ints, optional
Shape of data in binary file. None (default) will attempt to finds this automatically.
- torder{None, ‘r’, ‘o’, ‘f’ or a Python function} , optional
Description of the mapping of traces in the file to the NMR data matrix. None (the default) will attempt to find this automatically which is typically fine for most NMR experiments. See below for additional details.
- as_2dbool, optional
True to return data as a 2D array ignorning the shape and torder parameters.
- Returns
- dicdict
Dictionary of Agilent/Varian parameters.
- datandarray
Array of NMR data
See also
read_lowmem
Read Agilent/Varian files using mimimal amounts of memory.
write
Write Agilent/Varian files.
Notes
The torder parameter describes how the traces on disk should be re-organized to form the NMR data matrix. In most cases this can be determined automatically by examining the order of phase parameters in the procpar file. This is done if torder is set to None. In some cases it must be explicitly provided. Three common cases are:
Name
Ordering of arrays
torder
Notes
regular
d3, d2, phase2, phase
‘regular’ or ‘r’
opposite
d3, d2, phase, phase2
‘opposite’ or ‘o’
flat
As data exists in file
‘flat’ or ‘f’
Valid for 1D or 2D data
In addition a function which maps indirect dimension index tuples to/from trace numbers as stored on disk can be provided. For reading this function should take 2 arguments: shape, index_tuple and return an integer trace number. For writing this function should again take 2 arguments: shape,trace_number and return the indirect dimension index tuple for the given trace.