ClimoDatasetAccessor¶
- class ClimoDatasetAccessor(data, registry=<climopy.cfvariable.CFVariableRegistry object>)[source]¶
Bases:
climopy.accessor.ClimoAccessorAccessor for
xarray.Datasets. Includes methods for working withpintquantities andCFVariablevariables 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 displayscfvariableinformation 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.Quantitysupport for the operationsloc,sel,interp, andgroupby. Otherwise,weightedandcoarsenalready work, butresampleandrollingare broken and may be quite tricky to fix.Attributes Summary
Analogue to
ClimoAccessor.coordsfor retreiving always-quantified data variables based on their actual names, standard name attributes, orCFVariableRegistryidentifiers.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_transformationorregister_derivation, or return a selection along dimensions with translated dictionary indexing.add_variable(*args, **kwargs)Call
getand add the result to a copy of the dataset.Return a copy of the
xarray.Datasetwith underlyingxarray.DataArraydata 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.Datasetwith underlyingxarray.DataArraydata converted topint.Quantityusing the'units'attributes.