xarray.Dataset.xsimlab.update_clocks¶
-
Dataset.xsimlab.
update_clocks
(model=None, clocks=None, main_clock=None, master_clock=None)¶ Set or update clock coordinates.
Also copy from the replaced coordinates any attribute that is specific to model output variables.
- Parameters
model (
xsimlab.Model
object, optional) – Reference model. If None, tries to get model from context.clocks (dict, optional) – Used to create one or several clock coordinates. Dictionary values are anything that can be easily converted to
xarray.IndexVariable
objects (e.g., a 1-dnumpy.ndarray
or apandas.Index
).main_clock (str or dict, optional) –
Name of the clock coordinate (dimension) to use as main clock. If not set, the name is inferred from
clocks
(only if one coordinate is given and if Dataset has no main clock defined yet). A dictionary can also be given with one of several of these keys:dim
: name of the main clock dimension/coordinateunits
: units of all clock coordinate labelscalendar
: a unique calendar for all (time) clock coordinates
master_clock (str or dict, optional) – Same as main_clock, to be deprecated
- Returns
updated – Another Dataset with new or replaced coordinates.
- Return type
Dataset
See also