spectrochempy.read_topspin#
- read_topspin(dataset) = <spectrochempy.nmr.read_topspin unresolved>#
Open TopSpin Bruker NMR spectra.
- Parameters:
*paths (
str,Pathobject objects or valid urls, optional) – The data source(s) can be specified by the name or a list of name for the file(s) to be loaded:e.g., ( filename1, filename2, …, kwargs )
If the list of filenames are enclosed into brackets:
e.g., ( [filename1, filename2, …], kwargs )
The returned datasets are merged to form a single dataset, except if
mergeis set toFalse.**kwargs (keyword parameters, optional) – See Other Parameters.
- Returns:
object (
NDDatasetorScpObjectListofNDDataset) – The returned dataset(s). When several datasets are returned, the result is a list-likeScpObjectList.- Other Parameters:
content (
bytesobject, optional) – Instead of passing a filename for further reading, a bytes content can be directly provided as bytes objects. The most convenient way is to use a dictionary. This feature is particularly useful for a web application to handle drag and drop of files into a Browser.csv_delimiter (
str, optional, default:csv_delimiter) – Set the column delimiter in CSV file.description (
str, optional) – A Custom description.directory (
Pathobject objects or valid urls, optional) – From where to read the files.download_only (
bool, optional, default:False) – Used only when url are specified. If True, only downloading and saving of the files is performed, with no attempt to read their content.merge (
bool, optional, default:False) – IfTrueand several filenames or adirectoryhave been provided as arguments, then a singleNDDatasetwith merged dataset (stacked along the first dimension) is returned. In the case not all datasets have compatible dimensions or types/origins, then several NDDatasets can be returned for different groups of compatible datasets.origin (str, optional) – Override the origin label (default
'topspin').pattern (
str, optional) – A pattern to filter the files to read.Added in version 0.7.2.
proc_axis (
bool, optional, default:False) – Select the processing parameters (OFFSET,SW_p,SFinprocs/proc2s) as the source for processed spectral axes, following the TopSpin convention: the first point is atOFFSET, the bin width isSW_p / (SF * SI), and the last sample is atOFFSET - (SI - 1) * SW_p / (SF * SI). Only full spectra are supported (STSR/STSIextraction triggers a warning and falls back to the acquisition-based axis).The default (
False) preserves the historical behaviour of deriving axes from acquisition parameters (SFO1,SW). The two references can disagree when a spectrum was re-referenced during processing. This option selects the axis parameter source; it does not replay or apply vendor processing. Has no effect on raw FID/SER time-domain axes.protocol (
str, optional) –Protocolused for reading. It can be one of {'scp','omnic','opus','topspin','matlab','jcamp','csv','excel'}. If not provided, the correct protocol is inferred (whenever it is possible) from the filename extension.read_only (
bool, optional, default:True) – Used only when url are specified. If True, saving of the files is performed in the current directory, or in the directory specified by the directory parameter.recursive (
bool, optional, default:False) – Read also in subfolders.remove_digital_filter (
bool, optional, default:True) – Remove the Bruker digital filter (group delay correction) from raw FID/SER data. Set toFalseto keep the uncorrected data.remove_dc_offset (
bool, optional, default:False) – Remove the receiver DC offset from the FID before digital filter removal. This subtracts the mean of each row along the last axis, which removes the spike at the centre of the spectrum caused by the receiver DC offset.replace_existing (
bool, optional, default:False) – Used only when url are specified. By default, existing files are not replaced so not downloaded.sortbydate (
bool, optional, default:True) – Sort multiple filename by acquisition date.
See also
readGeneric reader inferring protocol from the filename extension.
spectrochempy.read_zipRead Zip archives (containing spectrochempy readable files)
spectrochempy.read_dirRead an entire directory.
spectrochempy.read_opusRead OPUS spectra.
spectrochempy.read_labspecRead Raman LABSPEC spectra (
.txt).spectrochempy.read_omnicRead Omnic spectra (
.spa,.spg,.srs).spectrochempy.read_socRead Surface Optics Corps. files (
.ddr,.hdror.sdr).spectrochempy.read_spcRead Galactic files (
.spc).spectrochempy.read_quaderaRead a Pfeiffer Vacuum’s QUADERA mass spectrometer software file.
spectrochempy.read_csvRead CSV files (
.csv).spectrochempy.read_matlabRead Matlab files (
.mat,.dso).spectrochempy.read_jcampRead Infrared JCAMP-DX files (
.jdx,.dx).spectrochempy.carroucell.readRead files in a directory after a carroucell experiment.
spectrochempy.read_wireRead Renishaw Wire files (
.wdf).
Examples
Reading a single TopSpin file
>>> scp.nmr.read('irdata/topspin/1/pdata/1/1r') NDDataset: [float64] a.u. (shape: (y:1, x:16384))
Selecting processing-parameter axes for a processed spectrum
>>> nd = scp.nmr.read('irdata/topspin/1/pdata/1/1r', proc_axis=True) >>> nd.x[0] 253.0909 ppm