Metadata
NMRData objects can store various metadata associated with the spectrum and each of the dimensions.
Metadata are stored as dictionaries using symbols as keys (e.g. :ns). They can be accessed using the metadata function, or directly from an NMRData object using a dictionary-style lookup. Metadata associated with axes are accessed by providing an additional reference, either as a dimension number or type (e.g. F1Dim, F2Dim etc.).
metadata(nmrdata, key) # spectrum metadata
nmrdata[key]
metadata(nmrdata, dimension, key) # axis metadata
nmrdata[dimension, key]DimensionalData.Dimensions.Lookups.metadata — Functionmetadata(nmrdata, key)
metadata(nmrdata, dim, key)
metadata(nmrdimension, key)Return the metadata for specified key, or nothing if not found. Keys are passed as symbols.
Examples (spectrum metadata)
:ns: number of scans:ds: number of dummy scans:rg: receiver gain:ndim: number of dimensions:title: spectrum title (contents of title pdata file):filename: spectrum filename:pulseprogram: title of pulse program used for acquisition:experimentfolder: path to experiment:noise: RMS noise level
Examples (dimension metadata)
:pseudodim: flag indicating non-frequency domain data:npoints: final number of (real) data points in dimension (after extraction):td: number of complex points acquired:tdzf: number of complex points when FT executed, including LP and ZF:bf: base frequency, in MHz:sf: carrier frequency, in MHz:offsethz: carrier offset from bf, in Hz:offsetppm: carrier offset from bf, in ppm:swhz: spectrum width, in Hz:swppm: spectrum width, in ppm:region: extracted region, expressed as a range in points, otherwise missing:window:WindowFunctionindicating applied apodization:referenceoffset: referencing (in ppm) applied to the dimension
See also estimatenoise!.
Labels
DimensionalData.Dimensions.label — Functionlabel(nmrdata)
label(nmrdata, dim)
label(nmrdimension)Return a short label associated with an NMRData structure or an NMRDimension. By default, for a spectrum this is obtained from the first line of the title file. For a frequency dimension, this is normally something of the form 1H chemical shift (ppm).
See also label!.
NMRTools.NMRBase.label! — Functionlabel!(nmrdata, labeltext)
label!(nmrdata, dim, labeltext)
label!(nmrdimension, labeltext)Set the label associated with an NMRData structure or an NMRDimension.
See also label.
DimensionalData.Dimensions.Lookups.units — Functionunits(nmrdata)
units(nmrdata, dim)
units(nmrdimension)Return the physical units associated with an NMRData structure or an NMRDimension.
Acquisition data
When spectra are loaded, the contents of the acqus file are parsed (as are the acqu2s files etc. too, if present). These can be accessed with :acqus and :acqu2s keys, etc. For convenience though, the additional function acqus is provided to access acquisiton data directly.
NMRTools.NMRBase.acqus — Functionacqus(nmrdata)
acqus(nmrdata, key)
acqus(nmrdata, key, index)Return data from a Bruker acqus file, or nothing if it does not exist. Keys can be passed as symbols or strings. If no key is specified, a dictionary is returned representing the entire acqus file.
If present, the contents of auxilliary files such as vclist and vdlist can be accessed using this function.
Examples
julia> acqus(expt, :pulprog)
"zgesgp"
julia> acqus(expt, "TE")
276.9988
julia> acqus(expt, :p, 1)
9.2
julia> acqus(expt, "D", 1)
0.1
julia> acqus(expt, :vclist)
11-element Vector{Int64}:
[...]See also metadata.
Auxilliary files
acqus can also be used to access the contents of auxilliary files (and if not present, nothing will be returned). Note that NMRTools will perform automatic unit conversion as follows:
:vclist: variable loopcounter:vdlist: variable delays, in seconds:valist: variable amplitude, in dB (converted from Watts if necessary):vplist: variable pulse lengths, in seconds:fq1listup to:fq8list: frequency lists – see Frequency lists for more information.
Frequency lists
Frequency lists can be specified on the spectrometer in a number of ways - in Hz, in ppm, and relative to the spectrometer frequency or the base frequency (0 ppm). Frequency lists are therefore stored in NMRTools as FQList structures which encode this additional information.
NMRTools.NMRIO.FQList — TypeFQList(values, unit::Symbol, relative::Bool)Represents a frequency list. unit can be :Hz or :ppm, and relative indicates whether the frequency is given relative to SFO (true) or BF (false).
Raw values can be extracted using the data function, or (better) as absolute chemical shifts (in ppm) or relative offsets (in Hz) using getppm and getoffset functions.
Raw numerical data can be accessed using the data() function, but it is recommended to use getppm and getoffset functions to access frequency data safely.
NMRTools.NMRIO.FQList — TypeFQList(values, unit::Symbol, relative::Bool)Represents a frequency list. unit can be :Hz or :ppm, and relative indicates whether the frequency is given relative to SFO (true) or BF (false).
Raw values can be extracted using the data function, or (better) as absolute chemical shifts (in ppm) or relative offsets (in Hz) using getppm and getoffset functions.
NMRTools.NMRIO.getppm — Functiongetppm(f::FQList, ax::FrequencyDimension)Return frequency list values in ppm (in absolute terms, i.e. relative to 0 ppm).
See also: getoffset
NMRTools.NMRIO.getoffset — Functiongetoffset(f::FQList, ax::FrequencyDimension)Return frequency list values as offsets relative to the spectrometer frequency, in Hz.
See also: getppm
Standard metadata: spectra
| Key | Description |
|---|---|
:acqusfilename | path to acqus file |
:acqus | contents of acqus file, as a dictionary |
:acqu2s, :acqu3s | contents of acqu2s/acqu3s files (if present) |
:experimentfolder | path to experiment |
:filename | spectrum filename |
:format | input file format (:nmrpipe or :pdata) |
:label | short label (first line of title pdata file) |
:ndim | number of dimensions |
:noise | RMS noise level (see estimatenoise!) |
:ns | number of scans |
:pulseprogram | pulse program title |
:rg | receiver gain |
:title | spectrum title (contents of title pdata file) |
:topspin | Topspin version used for acquisition |
Standard metadata: frequency dimensions
| Key | Description |
|---|---|
:aq | acquisition time, in seconds |
:bf | base frequency, in MHz |
:label | short label |
:npoints | final number of real data points in dimension (after extraction) |
:offsethz | carrier offset from bf, in Hz |
:offsetppm | carrier offset from bf, in ppm |
:pseudodim | flag indicating non-frequency domain data (false for frequency domain) |
:region | extracted region, expressed as a range in points, otherwise missing |
:sf | carrier frequency, in MHz |
:swhz | spectrum width, in Hz |
:swppm | spectrum width, in ppm |
:td | number of complex points acquired, including LP |
:tdzf | number of complex points when FT executed, including LP and ZF |
:window | WindowFunction encoding applied apodization |
:referenceoffset | applied referencing, in ppm |