xarray.Dataset.pr.gas_basket_contents_sum

xarray.Dataset.pr.gas_basket_contents_sum#

Dataset.pr.gas_basket_contents_sum(*, basket: str, basket_contents: Sequence[str], basket_units: str | Unit | None = None, skipna: bool | None = None, skipna_evaluation_dims: DimOrDimsT | None = None, min_count: int | None = None) DataArray#

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

Parameters:
basket: str

The name of the gas basket. Either an existing variable, i.e. a value from ds.keys(), or a new variable name, in the usual format entity (gwp_context).

basket_contents: list of str

The name of the gases in the gas basket. The sum of all basket_contents equals the basket. Values from ds.keys().

basket_unit: str or pint.Unit, optional

The unit to use for the result. If not given, we use the unit of the existing basket, or if the basket does not exist Gg CO2 / year.

skipna: bool, optional

If True (default), skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

skipna_evaluation_dims: str or list of str, optional

Dimension(s) to evaluate along to determine if values should be skipped. Only one of skipna and skipna_evaluation_dims can be supplied. If all values along the specified dimensions are NA, the values are skipped, other NA values are not skipped and will lead to NA in the corresponding result.

min_count: int (default None, but set to 1 if skipna=True)

The minimal number of non-NA values in a sum that is necessary for a non-NA result. This only has an effect if skipna=True. As an example: you sum data for a region for a certain sector, gas and year. If skipna=False, all countries in the region need to have non-NA data for that sector, gas, year combination. If skipna=True and min_count=1 then one country with non-NA data is enough for a non-NA result. All NA values will be treated as zero. If min_count=0 all NA values will be treated as zero also if there is no single non-NA value in the data that is to be summed.

Returns:
summedxr.DataArray