spectrochempy.NDDataset.from_xarray

classmethod NDDataset.from_xarray(dataset)[source]

Build a minimal NDDataset instance from an xarray.Dataset.

This prototype covers numerical data, default coordinates, auxiliary same-dimension coordinates, units, masks, JSON-compatible metadata, title, name, description, author, origin, created, modified, acquisition_date, and portable string labels.

Auxiliary coordinates are detected by scpy_coord_role and scpy_owner_dim attributes and reassembled into a same-dimension CoordSet with the dimension coordinate as the default.

Portable string labels are restored from non-dimension coordinates with scpy_coord_role="label" and associated with the owning dimension’s coordinate via scpy_owner_dim.

Rich CoordSet semantics and backend-specific persistence are intentionally out of scope here.