daxs.sources: Sources#
The module provides classes to deal with different types of data sources.
- class daxs.sources.BlissPath(root: str, proposal: str, beamline: str, session: str, sample: str, dataset: str, data_type: str = 'RAW_DATA')[source]#
Bases:
object- __init__(root: str, proposal: str, beamline: str, session: str, sample: str, dataset: str, data_type: str = 'RAW_DATA') None[source]#
- property collection: str#
- property filename: str#
- property path: str#
- class daxs.sources.Source[source]#
Bases:
ABCBase class for sources of scans.
- abstract property filename: str | None#
The filename of the source.
- abstract property data_mappings: dict[str, Any]#
The mappings between scan attributes and paths in the source.
- class daxs.sources.Hdf5Source(filename: str, selection: int | list[int] | ndarray[tuple[int, ...], dtype[int64]] | str, data_mappings: dict[str, Any])[source]#
Bases:
Source- __init__(filename: str, selection: int | list[int] | ndarray[tuple[int, ...], dtype[int64]] | str, data_mappings: dict[str, Any]) None[source]#
Class for a HDF5 source of scans.
- Parameters:
filename – Name of the HDF5 file.
selection – Scan selection expression or scan indices to read.
data_mappings – Mappings between scan attributes (x, signal, monitor, etc.) and paths in the HDF5 file.
- property filename: str#
The filename of the source.
- property selection: list[int]#
- property data_mappings: dict[str, Any]#
The mappings between scan attributes and paths in the source.
- class daxs.sources.TxtSource(filename: str, data_mappings: dict[str, int], **kwargs: Any)[source]#
Bases:
Source- __init__(filename: str, data_mappings: dict[str, int], **kwargs: Any) None[source]#
Class for a text file source of scans.
- Parameters:
filename – Name of the text file.
data_mappings – Dictionary mapping scan attributes to column indices. Must contain entries for “x” and “signal”. Column indices are 0-based.
**kwargs – Additional keyword arguments passed to np.loadtxt, e.g., delimiter, skiprows, etc.
- property filename: str#
The filename of the source.
- property data_mappings: dict[str, Any]#
The mappings between scan attributes and paths in the source.