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.

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.

  • requested contains only the arguments explicitly provided to Experiment.process().

  • applied contains 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 current meta.phc0 / meta.phc1 state through the existing pk() path. It does not consult vendor_profile and does not replay TopSpin PHC0 / PHC1 from procs. On the validated raw TopSpin 1D oracle path it is currently numerically identical to phase=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.