API

Top-level API

open_dataset(filename_or_obj[, group, ...])

Open and decode a dataset from a file or file-like object.

ureg

Unit registry class.

DataArray

Attributes

DataArray.pr.loc

Attribute for location-based indexing like xr.DataArray.loc, but also supports short aliases like area and translates them into the long names including the corresponding category-set.

DataArray.pr.gwp_context

The pint conversion context for this DataArray, directly usable for conversions.

Methods

DataArray.pr.quantify(**kwargs)

Attaches units to the DataArray.

DataArray.pr.dequantify()

Removes units from the DataArray and its coordinates.

DataArray.pr.convert_to_gwp(gwp_context, units)

Convert to a global warming potential

DataArray.pr.convert_to_gwp_like(like)

Convert to a global warming potential in the units of a reference array using the gwp_context of the reference array.

DataArray.pr.convert_to_mass([gwp_context, ...])

Convert a global warming potential of a greenhouse gas to a mass.

DataArray.pr.fill_all_na(dim[, value])

Fill NA values only where all values along the specified dimension(s) are NA.

DataArray.pr.sum([dim, reduce_to_dim, ...])

Reduce this DataArray's data by applying sum along some dimension(s).

DataArray.pr.count([dim, reduce_to_dim, ...])

Reduce this array by counting along some dimension(s).

DataArray.pr.downscale_timeseries(*, dim, ...)

Downscale timeseries along a dimension using a basket defined on a broader timeseries.

DataArray.pr.__getitem__(item)

Like da[], but translates short aliases like "area" into the long names including the corresponding category-set.

DataArray.pr.set(dim, key, value, *[, ...])

Set values, optionally expanding the given dimension as necessary.

DataArray.pr.coverage(*dims)

Summarize how many data points exist for a dimension combination.

DataArray.pr.to_df([name])

Convert this array into an unstacked (i.e. non-tidy) pandas.DataFrame.

Dataset

Attributes

Dataset.pr.loc

Attribute for location-based indexing like xr.Dataset.loc, but also supports short aliases like area and translates them into the long names including the corresponding category-set.

Dataset.pr.references

citable reference(s) describing the data

Dataset.pr.rights

license or other usage restrictions of the data

Dataset.pr.contact

who can answer questions about the data

Dataset.pr.title

a succinct description

Dataset.pr.comment

longer form description

Dataset.pr.institution

where the data originates

Dataset.pr.history

processing steps done on the data

Methods

Dataset.pr.ensure_valid()

Ensure this is a valid primap2 data set.

Dataset.pr.to_netcdf(path[, mode, group, ...])

Write dataset contents to a netCDF file.

Dataset.pr.to_df([name])

Convert this dataset into a pandas.DataFrame.

Dataset.pr.to_interchange_format([time_format])

Convert dataset to the interchange format.

Dataset.pr.quantify([units])

Attaches units to each variable in the Dataset.

Dataset.pr.dequantify()

Removes units from the Dataset and its coordinates.

Dataset.pr.fill_all_na(dim[, value])

Fill NA values only where all values along the specified dimension(s) are NA.

Dataset.pr.sum([dim, reduce_to_dim, skipna, ...])

Reduce this Dataset's data by applying sum along some dimension(s).

Dataset.pr.count([dim, reduce_to_dim, ...])

Reduce this Dataset by counting along some dimension(s).

Dataset.pr.gas_basket_contents_sum(*, ...[, ...])

The sum of gas basket contents converted using the global warming potential of the gas basket.

Dataset.pr.fill_na_gas_basket_from_contents(*, ...)

Fill NA values in a gas basket using the sum of its contents.

Dataset.pr.downscale_timeseries(*, dim, ...)

Downscale timeseries along a dimension using a basket defined on a broader timeseries.

Dataset.pr.downscale_gas_timeseries(*, ...)

Downscale a gas basket defined on a broader timeseries to its contents known on fewer time points.

Dataset.pr.__getitem__(item)

Like ds[], but translates short aliases like "area" into the long names including the corresponding category-set.

Dataset.pr.set(dim, key, value, *[, ...])

Set values, optionally expanding the given dimension as necessary.

Dataset.pr.coverage(*dims)

Summarize how many data points exist for a dimension combination.