NMR plugin#
Introduction#
The spectrochempy-nmr plugin provides NMR-specific readers and processing
workflows, including the Bruker TopSpin reader.
Installation#
Install it with:
python -m pip install "spectrochempy[nmr]"
Follow the Bruker 1D quickstart in the NMR plugin documentation
to read a FID, process it with scp.nmr.Experiment, and plot the
resulting spectrum.
Recommended API#
Use the NMR plugin’s format-detecting reader:
import spectrochempy as scp
dataset = scp.nmr.read("path/to/fid")
See the plugin’s guide to reading NMR data for supported formats and how to select one explicitly. The reader catalog covers readers available across SpectroChemPy.
The NMR plugin owns Bruker/TopSpin conventions such as experiment directory resolution, processed-data defaults, acquisition metadata, and NMR unit contexts. Core SpectroChemPy remains responsible for generic datasets, units, plotting, and ordinary FFT operations.
TopSpin Processing Profile#
TopSpin datasets may expose a descriptive vendor processing profile in
dataset.meta.nmr_processing:
dataset = scp.nmr.read("path/to/fid")
profile = dataset.meta.nmr_processing["vendor_profile"]
This profile records values read from the vendor procs file. It is
descriptive only:
it is not applied automatically when reading a raw FID;
it is not replayed automatically by
scp.nmr.Experiment(...).process();it does not establish the exact historical processing sequence of an already processed vendor spectrum such as TopSpin
1r;SpectroChemPy-owned processing traces are handled separately from the vendor profile.
SpectroChemPy Processing Trace#
The result of scp.nmr.Experiment(...).process() records the
SpectroChemPy-owned processing call in
result.meta.nmr_processing["scp_processing"]:
experiment = scp.nmr.Experiment(fid)
result = experiment.process(apodization="em", lb=5.0)
trace = result.meta.nmr_processing["scp_processing"]
requested = trace["requested"]
applied = trace["applied"]
This trace is attached to the result only. The source dataset is not mutated.
requestedcontains only the arguments explicitly provided toExperiment.process().appliedcontains only the operations that SpectroChemPy actually executed and the values those operations really consumed.dataset.meta.nmr_processing["vendor_profile"]remains descriptive vendor metadata and is never applied automatically.the trace records the SpectroChemPy processing associated with the current result, not a complete historical processing history for the dataset.
vendor replay is not implemented.
phase="metadata"applies the dataset’s currentmeta.phc0/meta.phc1state through the existingpk()path. It does not consultvendor_profileand does not replay TopSpinPHC0/PHC1fromprocs. On the validated raw TopSpin 1D oracle path it is currently numerically identical tophase=None; on already frequency-domain spectra carrying phase metadata, it can still apply a real phase correction.
Compatibility aliases#
Compatibility aliases:
scp.read_topspin(...)remains available as the root-level compatibility alias when the plugin is installed.
API Reference#
The generated public API page for the NMR plugin is listed in
Plugin public API reference. See spectrochempy.nmr.read.
Examples#
The published public examples for this plugin currently focus on validated 1D workflows.
Limitations#
Currently, the user-facing documentation for this plugin focuses on TopSpin datasets and related NMR workflows.
The plugin reads 1D FIDs and spectra, raw 2D time-domain data (ser), and
vendor-processed 2D spectra. Storage layouts and processing conventions are
documented by the standalone NMR project.
The public processing workflow, spectrochempy.nmr.Experiment,
remains limited to validated 1D experiments: Experiment(...).process()
raises NotImplementedError for multi-dimensional datasets. A pseudo-2D
series — a list of ordinary 1D spectra sharing a secondary coordinate, such as
a relaxation or kinetics series — must be distinguished from a genuine 2D
experiment in which both dimensions are Fourier-transformed: pseudo-2D series
follow the validated 1D processing path, one spectrum at a time.