metobs_toolkit.modeltimeseries.ModelTimeSeries.to_xr#
- ModelTimeSeries.to_xr() xrDataset[source]#
Convert a Modelimeseries object to an xarray.Dataset.
The returned Dataset contains a single variable named after the observation type (e.g. ‘temperature’). Its DataArray has three dimensions:
kind: distinguishes the nature of the stacked data. For model time series this contains a single value: ‘model’.
models: the model name (length 1 here, prepared for concatenation).
datetime: timestamps of the model output.
Attributes on the variable describe the observation type and model metadata.
- Parameters:
modeltimeseries (Modeltimeseries) – Modeltimeseries object with time-indexed data.
fmt_datetime_coordinate (bool, optional) – If True, format datetime for CF compliance. Default is True.
- Returns:
Dataset with dimensions (‘kind’, ‘models’, ‘datetime’).
- Return type:
xarray.Dataset