vipr_reflectometry.shared.load_data package

Submodules

vipr_reflectometry.shared.load_data.csv_spectrareader_data_loader module

class vipr_reflectometry.shared.load_data.csv_spectrareader_data_loader.CSVSpectraReaderDataLoader(**kw)

Bases: DataLoaderHandler

CSV/DAT/TXT data loader using SpectraReader for reflectometry data.

This loader integrates the SpectraReader API with the VIPR data loading pipeline for single CSV/DAT/TXT files (MARIA format or standard reflectometry format). It uses SpectraReader to load individual files and converts the data to VIPR’s DataSet format.

Supported formats: - CSV files (.csv) - DAT files (.dat) - TXT files (.txt) - MARIA format and standard reflectometry datasets - Error bar extraction (dx, dy) when available - Built on unified SpectraReader API

Each file contains exactly ONE spectrum and results in batch_size=1 DataSet.

class Meta

Bases: object

label = 'csv_spectrareader'
class vipr_reflectometry.shared.load_data.csv_spectrareader_data_loader.CSVSpectraReaderParams(*, data_path: str, column_mapping: dict[str, int | None] | None = None)

Bases: BaseModel

Parameters for the csv_spectrareader data loader.

column_mapping: dict[str, int | None] | None
data_path: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

vipr_reflectometry.shared.load_data.hdf5_spectrareader_data_loader module

class vipr_reflectometry.shared.load_data.hdf5_spectrareader_data_loader.HDF5SpectraReaderDataLoader(**kw)

Bases: DataLoaderHandler

HDF5 data loader using SpectraReader for reflectometry data.

This loader integrates the SpectraReader API with the VIPR data loading pipeline for HDF5 files. It uses SpectraReader to access HDF5 files and converts the data to VIPR’s DataSet format.

Supports: - Single and multi-spectrum HDF5 files - Dataset/group selection - Error bar extraction (dx, dy) - Metadata preservation - Built on colleague’s ExperimentalDataManager

class Meta

Bases: object

label = 'hdf5_spectrareader'
class vipr_reflectometry.shared.load_data.hdf5_spectrareader_data_loader.HDF5SpectraReaderParams(*, data_path: str, dataset_name: str | None = None, spectrum_index: int = 0, batch_processing: bool = False, batch_size: int | None = None)

Bases: BaseModel

Parameters for the hdf5_spectrareader data loader.

batch_processing: bool
batch_size: int | None
data_path: str
dataset_name: str | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

spectrum_index: int

Module contents

Data loaders for reflectometry analysis.

class vipr_reflectometry.shared.load_data.CSVSpectraReaderDataLoader(**kw)

Bases: DataLoaderHandler

CSV/DAT/TXT data loader using SpectraReader for reflectometry data.

This loader integrates the SpectraReader API with the VIPR data loading pipeline for single CSV/DAT/TXT files (MARIA format or standard reflectometry format). It uses SpectraReader to load individual files and converts the data to VIPR’s DataSet format.

Supported formats: - CSV files (.csv) - DAT files (.dat) - TXT files (.txt) - MARIA format and standard reflectometry datasets - Error bar extraction (dx, dy) when available - Built on unified SpectraReader API

Each file contains exactly ONE spectrum and results in batch_size=1 DataSet.

class Meta

Bases: object

label = 'csv_spectrareader'
class vipr_reflectometry.shared.load_data.HDF5SpectraReaderDataLoader(**kw)

Bases: DataLoaderHandler

HDF5 data loader using SpectraReader for reflectometry data.

This loader integrates the SpectraReader API with the VIPR data loading pipeline for HDF5 files. It uses SpectraReader to access HDF5 files and converts the data to VIPR’s DataSet format.

Supports: - Single and multi-spectrum HDF5 files - Dataset/group selection - Error bar extraction (dx, dy) - Metadata preservation - Built on colleague’s ExperimentalDataManager

class Meta

Bases: object

label = 'hdf5_spectrareader'