scipp.compat.from_xarray¶
- scipp.compat.from_xarray(obj)¶
Convenience method to convert an xarray object into the corresponding scipp object.
If you know in advance what type of object you need to convert, you can also call from_xarray_dataarray or from_xarray_dataset directly.
- Parameters
obj (Union[xr.DataArray, xr.Dataset]) – The xarray object to convert; must be either an xarray DataArray or Dataset object.
- Returns
The converted scipp object.
- Return type
VariableLike