Reference: Reading

This page documents the API for reading spectra from Bruker directories. There are two functions to be used, although you should only really be using read().

penguins.read(path, expno, procno=1)

Create one or more Dataset objects from a spectrum folder, expno, and procno.

The subclass of Dataset returned is determined by what files are available in the spectrum folder. It can be either Dataset1D, Dataset1DProj, or Dataset2D.

To read in a list of datasets from the same directory, a list can be passed as one or both of the expno and procno arguments.

Parameters:
pathstr or pathlib.Path

Path to the spectrum name folder.

expnoint or iterable thereof

Expno of experiment of interest (or multiple expnos for multiple experiments).

procnoint or iterable thereof (optional)

Procno of processed data (or multiple procnos for multiple processed data). Defaults to 1.

Returns:
Dataset or list thereof

A Dataset1D, Dataset1DProj, or Dataset2D object depending on the detected spectrum dimensionality.

If more than one expno or procno is provided, then returns a list of the corresponding datasets. If more than one expno and more than one procno are provided, then returns all possible combinations of (expno, procno). In terms of the ordering, the procno is incremented on every iteration (more rapidly).