ClimoDatasetAccessor¶
- class ClimoDatasetAccessor(data, registry=<climopy.cfvariable.CFVariableRegistry object>)[source]¶
Bases:
climopy.accessor.ClimoAccessor
Accessor for
xarray.Dataset
s. Includes methods for working withpint
quantities andCFVariable
variables and an interface for deriving one physical variable from other variables in the dataset. Registered under the nameclimo
(i.e, usage isdata_array.climo
). The string representation of this accessor displayscfvariable
information for every variable whose name is found in thevariable_registry
.- Parameters
data (xarray.DataArray or xarray.Dataset) – The data.
registry (cfvariable.CFVariableRegistry) – The variable registry.
Notes
This adds
pint.Quantity
support for the operationsloc
,sel
,interp
, andgroupby
. Otherwise,weighted
andcoarsen
already work, butresample
androlling
are broken and may be quite tricky to fix.Attributes Summary
Analogue to
ClimoAccessor.coords
for retreiving always-quantified data variables based on their actual names, standard name attributes, orCFVariableRegistry
identifiers.Methods Summary
__getattr__
(attr)Try to return a variable with
__getitem__
.__getitem__
(key)Return a quantified coordinate or variable, including transformations and derivations registered with
register_transformation
orregister_derivation
, or return a selection along dimensions with translated dictionary indexing.add_variable
(*args, **kwargs)Call
get
and add the result to a copy of the dataset.Return a copy of the
xarray.Dataset
with underlyingxarray.DataArray
data stripped of its units and the units written to the'units'
attributes.get
(*keys[, quantify, standardize, units, …])Call
__getitem__
, with optional post-processing steps and special behavior when variables are prefixed or suffixed with certain values.quantify
()Return a copy of the
xarray.Dataset
with underlyingxarray.DataArray
data converted topint.Quantity
using the'units'
attributes.