Metadata
NMRData objects carry metadata on acquisition and processing, filled in automatically when data are loaded and updated by processing functions.
Two levels of metadata
Metadata are attached at two levels:
- Spectrum metadata describe the experiment as a whole: number of scans, receiver gain, pulse programme, title, temperature, the noise level (estimated when the spectrum is loaded), acquisition parameters from the
acqusfiles, and the contents of auxiliary files such as vclists and vdlists. - Axis metadata describe one dimension: number of points, the original time-domain size (before zero-filling, linear prediction or extraction of a region), carrier and base frequencies, spectral width, nucleus, window function, phase correction and the dimension's imaginary unit (
:mcindex).
Both are dictionaries keyed by symbols such as :ns or :window. The standard keys are listed in Metadata keys.
Looking up metadata
Spectrum metadata are looked up with a key; axis metadata with a dimension and a key. The dimension can be given by type, number or (for frequency dimensions) nucleus:
metadata(spec, :ns) # spectrum metadata
spec[:ns] # the same
metadata(spec, F1Dim, :bf) # axis metadata
spec[F1Dim, :bf] # the same
spec[1, :bf] # by dimension number
metadata(spec) # the whole spectrum dictionary
metadata(spec, F1Dim) # the whole dictionary for one axisusing NMRTools
spec = exampledata("2D_HN")
spec[:pulseprogram], spec[F2Dim, :nucleus], spec[F1Dim, :window]("sfhmqcf3gpph.cw", N15, Cos2Window(0.09461759999999972))Acquisition parameters are kept as parsed from the acqus files and read with acqus, which accepts Bruker parameter names in either case; see Find acquisition parameters.
Metadata types
Where a parameter has structure beyond a single number, NMRTools stores it as a typed object instead of a raw value:
| Parameter | Type | Reference |
|---|---|---|
| apodization applied in processing | WindowFunction | Window functions |
power levels (PLW, PL) | Power | Power levels |
frequency lists (fq1list, …) | FQList | Frequency lists |
| sample description | NMRSample | Sample metadata schema |
| spectrometer channels | Dict per channel | Find acquisition parameters |
| pulse programme annotations | Dict | Pulse programme annotations |
Times are stored in seconds and frequencies in Hz throughout; see Time and frequency units.
How processing updates metadata
Processing functions record what they did on the dimension they acted on: