Loading of experimental 1D NMR data

In this example, we load a NMR dataset (in the Bruker format) and plot it.

import spectrochempy as scp

datadir.path contains the path to a default data directory.

datadir = scp.preferences.datadir

path = datadir / "nmrdata" / "bruker" / "tests" / "nmr" / "topspin_1d"

load the data in a new dataset

ndd = scp.read_topspin(path, expno=1, remove_digital_filter=True)

view it…

_ = ndd.plot()
plot read nmr from bruker

Now load a 2D dataset

path = datadir / "nmrdata" / "bruker" / "tests" / "nmr" / "topspin_2d"
ndd = scp.read_topspin(path, expno=1, remove_digital_filter=True)
_ = ndd.plot()
plot read nmr from bruker
/home/runner/work/spectrochempy/spectrochempy/src/spectrochempy/extern/nmrglue.py:1021: UserWarning: (196608,)cannot be shaped into(147, 1024)
  _, data = read_binary(f, shape=shape, cplex=cplex, big=big, isfloat=isfloat)

This ends the example ! The following line can be uncommented if no plot shows when running the .py script with python

# scp.show()

Total running time of the script: (0 minutes 0.403 seconds)