spectrochempy.read_dir
- read_dir(directory=None, **kwargs)[source][source]
Read an entire directory.
Open a list of readable files in a and store data/metadata in a dataset or a list of datasets according to the following rules :
2D spectroscopic data (e.g. valid .spg files or matlab arrays, etc…) from distinct files are stored in distinct
NDdatasets.1D spectroscopic data (e.g.,
.spafiles) in a given directory are merged into singleNDDataset, providing their unique dimension are compatible. If not, an error is generated.non-readable files are ignored
- Parameters:
directory (str or pathlib) – Folder where are located the files to read.
- Returns:
object (
NDDatasetor list ofNDDataset) – The returned dataset(s). Depending on the python version, the order of the datasets in the list may change.
See also
readGeneric reader inferring protocol from the filename extension.
read_zipRead Zip archives (containing spectrochempy readable files)
read_opusRead OPUS spectra.
read_labspecRead Raman LABSPEC spectra (
.txt).read_omnicRead Omnic spectra (
.spa,.spg,.srs).read_socRead Surface Optics Corps. files (
.ddr,.hdror.sdr).read_galacticRead Galactic files (
.spc).read_quaderaRead a Pfeiffer Vacuum’s QUADERA mass spectrometer software file.
read_topspinRead TopSpin Bruker NMR spectra.
read_csvRead CSV files (
.csv).read_jcampRead Infrared JCAMP-DX files (
.jdx,.dx).read_matlabRead Matlab files (
.mat,.dso).read_carroucellRead files in a directory after a carroucell experiment.
read_wireRead REnishaw Wire files (
.wdf).
Examples
>>> scp.preferences.csv_delimiter = ',' >>> A = scp.read_dir('irdata') >>> len(A) 4
>>> B = scp.read_dir()