The algorithm applied is desribed in [1]. This uses an implementation
provided by pybaselines.
Parameters:
spectrum – Spectrum to apply baseline correction to.
mask –
Should be either:
None: the points which comprise noise are predicted automatically
A boolean array with the same size as spectrum.
True indicates that a particular point comprises baseline.
False indicates that a point comprises a peak.
min_length – from pybaselines: Any region of consecutive baseline points less than
min_length is considered to be a false positive and all points in
the region are converted to peak points. A higher min_length ensures
less points are falsely assigned as baseline points.
Returns:
fixed_spectrum – The baseline-corrected spectrum.
params – A dictionary with the items:
"mask" A boolean array designating baseline points as True and
peak points as False.
"baseline" The computed baseline. Note that fixed_spectrum is
computed via spectrum-baseline.
Fourier transformation with optional spectrum flipping.
It is conventional in NMR to plot spectra from high to low going
left to right/down to up. This function utilises the
numpy.fft
module.
Parameters:
fid – Time-domain data.
axes – The axes to apply Fourier Transformation to. By default (None), FT is
applied to all axes. If an int, FT will only be applied to the relevant axis.
If a list of ints, FT will be applied to this subset of axes.
flip – Whether or not to flip the Fourier Transform of fid in each
dimension.
axes – The axes to apply IFT to. By default (None), IFT is
applied to all axes. If an int, IFT will only be applied to the relevant axis.
If a list of ints, IFT will be applied to this subset of axes.
flip (bool, default: True) – Whether or not to flip spectrum in each dimension prior to Inverse
Fourier Transform.
Generate a virtual echo [2] from a time-domain signal.
A vitrual echo is a signal with a purely real Fourier-Tranform.
Parameters:
data – The data to construct the virtual echo from. If the data comprises a pair
of amplitude/phase modulated signals, these should be stored in a single
3D array with shape[0]==2, such that data[0] is the cos/p
signal, and data[1] is the sin/n signal.
twodim_dtype –
If the data is 2D, this parameter specifies the way to process the data.
Allowed options are:
"hyper": The data is hypercomplex. Virtual echo is constructed
along the second axis.
"amp": The data comprises an amplitude-modulated pair.
"phase": The data comprises a phase-modulated pair.
Generate a frequency-discrimiated signal from amplitude-modulated 2D FIDs.
Parameters:
data – cos-modulated signal and sin-modulated signal, stored in a 3D numpy array,
such that data[0] is the the cos signal and data[1] is the sin
signal.