spectrocube¶
SpectroCube is a lightweight Python standard for calibrated spectroscopic datasets.
It defines a single class, SpectroCube, that wraps an xarray Dataset
with required metadata, a validated data structure, and NetCDF serialization.
The goal is a portable, self-describing file format: instrument packages produce SpectroCube files; analysis packages consume them — without sharing any instrument-specific code.
Package scope¶
This package contains:
- The
SpectroCubeclass and its constructors - The
ValidationReportclass - Save / load via NetCDF
This package intentionally does not contain:
- Fitting or line identification
- Plotting or visualization
- Instrument-specific extraction or calibration logic
- Analysis workflows
Data model at a glance¶
A SpectroCube always has:
- An
intensitydata variable (any shape, must includewavelengthas a dimension) - A
wavelengthcoordinate (1D, nm, monotonically increasing) - Five required global attributes:
spectrocube_version,instrument_id,calibration_type,intensity_units,wavelength_medium
The underlying xr.Dataset is always accessible via .ds for direct xarray operations.
Navigation¶
- Specification — full data model definition
- Usage — code examples
- API Reference — class and method documentation