What’s New in Revision 1.1.2#
These are the changes in SpectroChemPy-1.1.2. See Release notes for a full changelog, including other versions of SpectroChemPy.
New Features#
The TopSpin reader accepts a
proc_axiskeyword to select the processing parameters (OFFSET,SW_p,SFinprocs/proc2s) as the source for processed spectral axes, following the TopSpin convention (first point atOFFSET, bin widthSW_p / (SF * SI)). The default preserves the historical acquisition-based axis; the two references can disagree when a spectrum was re-referenced during processing. This selects the axis parameter source and does not replay or apply vendor processing. Only full spectra are supported (STSR/STSIextraction triggers a warning and falls back to the acquisition-based axis) (#1742).The NMR reader now accepts a
remove_dc_offsetkeyword argument (defaultFalse). WhenTrue, the receiver DC offset is removed from the FID before digital filter correction, which eliminates the spike at the centre of the spectrum caused by the receiver electronics (PR #1745).
Bug Fixes#
Selection by coordinate value on a dimension with multiple coordinates now uses the selected default coordinate and handles quantities as for a single coordinate, instead of raising a
TypeError(#1751).The NMR digital filter removal algorithm in the TopSpin reader has been rewritten. The previous implementation introduced a constant phase rotation (
exp(i*pi*phase)) with no physical justification, added a flat pedestal to the spectrum via an incorrect DC subtraction, derived the output length fromTD//2instead of the actual data size, and mutated the input dictionary. All four defects are fixed (PR #1745).The TopSpin reader now resolves non-numeric experiment directories (e.g.
my_experiment/1/fid) without returningNone. Previously, a non-numeric parent directory name causedint(expno)to fail, and the generic exception handler silently returnedNone. The resolver now discovers experiment directories with Bruker data files regardless of the parent directory name.Component processed data files (
1i,2ri,2ir,2ii) are now accepted as entry points to the full assembled spectrum. Previously, these files were excluded from the valid filename set, causing a futile remote download attempt followed by a bareFileNotFoundError. Reading2rireturns the same quaternion spectrum as2rr(all four components assembled); reading1ireturns the same complex spectrum as1r. Individual channel isolation is not supported.The TopSpin test suite no longer skips
test_read_topspindue to a 404 download error. Local fixture assertions are now independent of remote download behaviour.TopSpin spectra read from processed data are now consistently treated as frequency-domain data by FFT processing. Calling
ffton an already frequency-domain dimension now raises an explicit diagnostic naming the incompatible dimension, while raw FID/SER data and remaining time-domain dimensions in partially transformed 2D data remain transformable.Savitzky-Golay derivatives in
savgolanddifferentiatenow use the original uniform coordinate spacing when removing a masked block makes the retained coordinate irregular, restoring derivative scaling and units. Uniformly spaced retained samples take priority, so regular subsampling uses its actual step. Filter windows spanning a masked gap can still give unreliable values near that gap; this limitation is now documented (#1748).