Metadata Overview

NMRData objects contain comprehensive metadata on processing and acquisition parameters that are populated automatically upon loading a spectrum. This metadata system provides access to all the information needed to understand, process, and analyze NMR data.

Types of metadata

Metadata is organized into two categories:

  1. Spectrum metadata: Information about the experiment as a whole (number of scans, receiver gain, pulse program, temperature, etc.)
  2. Axis metadata: Information specific to each dimension (carrier frequency, spectral width, window functions, etc.)

Quick start

Accessing spectrum metadata

using NMRTools

# Load example spectrum
spec = exampledata("2D_HN")

# Access using the metadata function
metadata(spec, :ns)
2
# Or use dictionary-style lookup
spec[:pulseprogram]
"sfhmqcf3gpph.cw"

Accessing axis metadata

# By dimension type
spec[F2Dim, :label]
"15N"
# Or by dimension number
spec[2, :swhz]
1337.97163500134

Accessing acquisition parameters

# Get acquisition parameter
acqus(spec, :te)
276.9988
# Access arrayed parameters
acqus(spec, :p, 1)  # First pulse length
9.199999999999998e-6

Special metadata types

NMRTools provides specialized types for handling complex metadata:

Window functions

Window functions (apodization) applied during processing are stored as structured objects that preserve all parameters:

# Get window function for a dimension
win = spec[F2Dim, :window]
CosWindow(0.04783359999999993)

See the Window functions page for detailed documentation.

Power levels

Power levels are represented as Power objects that handle conversion between Watts and dB:

# Power levels from acqus file
p = acqus(spec, :pl, 1)
db(p)      # Get as dB
watts(p)   # Get as Watts

See the Power levels page for detailed documentation.

Frequency lists

Frequency lists (from fq1list, etc.) are stored as FQList objects that preserve unit and reference information:

# Get frequency list
fqlist = acqus(spec, :fq1list)

# Extract as ppm or Hz
ppm(fqlist, dims(spec, F2Dim))
hz(fqlist, dims(spec, F2Dim))

See the Frequency lists page for detailed documentation.

Sample metadata

Sample metadata describing the physical sample, buffer composition, and experimental details can be automatically loaded when present:

# Check if sample metadata is available
hassample(spec)

# Access sample metadata
sample(spec)

# Navigate nested metadata
sample(spec, :sample, :label)

See the Sample metadata page for detailed documentation.

Standard metadata keys

Spectrum metadata symbols

SymbolDescription
:filenameOriginal filename or template
:format:NMRPipe or :bruker
:titleContents of pdata/1/title
:labelFirst line of title, used for captions
:dateExperiment timestamp (completion time)
:pulseprogramPulse program (PULPROG) from acqus file
:ndimNumber of dimensions
:acqusfilenamePath to associated acqus file
:acqusDictionary of acqus data
:nsNumber of scans
:rgReceiver gain
:noiseRMS noise level
:solventSolvent string, e.g. "H2O+D2O"
:temperatureTemperature in K
:nucleiSet of Nucleus values

Axis metadata symbols

SymbolDescription
:pseudodimFlag indicating non-frequency domain data
:npointsFinal number of (real) data points in dimension (after extraction)
:tdNumber of complex points acquired
:tdzfNumber of complex points when FT executed, including LP and ZF
:bfBase frequency, in Hz
:sfCarrier frequency, in Hz
:offsethzCarrier offset from bf, in Hz
:offsetppmCarrier offset from bf, in ppm
:swhzSpectrum width, in Hz
:swppmSpectrum width, in ppm
:regionExtracted region, expressed as a range in points, otherwise missing
:windowWindowFunction object indicating applied apodization
:nucleusNucleus enum value for this dimension

Auxiliary files

Files such as vclist, vdlist, and frequency lists are automatically imported when present:

# Access variable delay list
relaxation_spec = exampledata("pseudo3D_HN_R2")
acqus(relaxation_spec, :vclist)
11-element Vector{Int64}:
  0
  1
  2
  3
  4
  6
  8
 10
 12
 14
 16

NMRTools performs automatic unit conversion:

  • :vclist: Variable loop counter (dimensionless)
  • :vdlist: Variable delays, in seconds
  • :valist: Variable amplitude, in dB (converted from Watts if necessary)
  • :vplist: Variable pulse lengths, in seconds
  • :fq1list through :fq8list: Frequency lists (see Frequency lists)

Next steps