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#
classmethod from_path(path: str) BlissPath[source]#

Create a BlissPath object from a path.

class daxs.sources.Selection(items: int | str | list[int] | npt.NDArray[np.int64 | np.float64])[source]#

Bases: object

__init__(items: int | str | list[int] | npt.NDArray[np.int64 | np.float64]) None[source]#

Class to handle selections of items.

Parameters:

items – The items to select.

property items#
class daxs.sources.Source[source]#

Bases: ABC

Base class for sources of scans.

abstract property filename: str | None#

The filename of the source.

abstract property scans: Scans#

Return all source scans.

abstract property data_mappings: dict[str, Any]#

The mappings between scan attributes and paths in the source.

abstract read_scans(indices: list[int] | npt.NDArray[np.int64] | None = None) Scans[source]#

Return all source scans.

class daxs.sources.Hdf5Source(filename: str, included_scan_ids: Any = None, excluded_scan_ids: Any = None, data_mappings: dict[str, Any] | None = None)[source]#

Bases: Source

__init__(filename: str, included_scan_ids: Any = None, excluded_scan_ids: Any = None, data_mappings: dict[str, Any] | None = None) None[source]#

Class for a HDF5 source of scans

Parameters:
  • filename – Name of the HDF5 file.

  • included_scans_ids – Selection of included scans.

  • excluded_scans_ids – Selection of excluded scans.

  • 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 data_mappings: dict[str, Any]#

The mappings between scan attributes and paths in the source.

property selected_scan_ids: list[int]#

Get the selected scans considering the included and excluded scan ids.

property scans: Scans#

Return all source scans.

read_scans(indices: list[int] | npt.NDArray[np.int64] | None = None) Scans[source]#

Read the scans from the source.

read_scan(index: int) Scan[source]#

Return a scan object at the index.