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.LookupArrays.metadataFunction
metadata(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: WindowFunction indicating applied apodization
  • :referenceoffset: referencing (in ppm) applied to the dimension

See also estimatenoise!.

source

Labels

DimensionalData.Dimensions.labelFunction
label(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!.

source
NMRTools.NMRBase.label!Function
label!(nmrdata, labeltext)
label!(nmrdata, dim, labeltext)
label!(nmrdimension, labeltext)

Set the label associated with an NMRData structure or an NMRDimension.

See also label.

source

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.acqusFunction
acqus(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.

source

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
  • :fq1list up 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.FQListType
FQList(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.

See also: getppm, getoffset.

source

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.FQListType
FQList(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.

See also: getppm, getoffset.

source
NMRTools.NMRIO.getppmFunction
getppm(f::FQList, ax::FrequencyDimension)

Return frequency list values in ppm (in absolute terms, i.e. relative to 0 ppm).

See also: getoffset

source
NMRTools.NMRIO.getoffsetFunction
getoffset(f::FQList, ax::FrequencyDimension)

Return frequency list values as offsets relative to the spectrometer frequency, in Hz.

See also: getppm

source

Standard metadata: spectra

KeyDescription
:acqusfilenamepath to acqus file
:acquscontents of acqus file, as a dictionary
:acqu2s, :acqu3scontents of acqu2s/acqu3s files (if present)
:experimentfolderpath to experiment
:filenamespectrum filename
:formatinput file format (:nmrpipe or :pdata)
:labelshort label (first line of title pdata file)
:ndimnumber of dimensions
:noiseRMS noise level (see estimatenoise!)
:nsnumber of scans
:pulseprogrampulse program title
:rgreceiver gain
:titlespectrum title (contents of title pdata file)
:topspinTopspin version used for acquisition

Standard metadata: frequency dimensions

KeyDescription
:aqacquisition time, in seconds
:bfbase frequency, in MHz
:labelshort label
:npointsfinal number of real data points in dimension (after extraction)
:offsethzcarrier offset from bf, in Hz
:offsetppmcarrier offset from bf, in ppm
:pseudodimflag indicating non-frequency domain data (false for frequency domain)
:regionextracted region, expressed as a range in points, otherwise missing
:sfcarrier frequency, in MHz
:swhzspectrum width, in Hz
:swppmspectrum width, in ppm
:tdnumber of complex points acquired, including LP
:tdzfnumber of complex points when FT executed, including LP and ZF
:windowWindowFunction encoding applied apodization
:referenceoffsetapplied referencing, in ppm