transforms.ensemble

Ensemble transformations for earthkit data objects.

Typically this is done with an xarray representation of data.

Attributes

standard_deviation

Functions

max(*args, **kwargs)

Calculate the ensemble maximum.

mean(*args, **kwargs)

Calculate the ensemble mean.

min(*args, **kwargs)

Calculate the ensemble minimum.

reduce(dataarray[, how, dim])

Reduce data over the ensemble dimension.

std(*args, **kwargs)

Calculate the ensemble standard deviation.

sum(*args, **kwargs)

Calculate the ensemble sum.

Package Contents

transforms.ensemble.max(*args, **kwargs)

Calculate the ensemble maximum.

Parameters:
  • dataarray (xr.DataArray | xr.Dataset) – The DataArray over which to calculate the climatological mean. Must contain a time dimension.

  • dim (str (optional)) – Name of the ensemble dimension in the data object, default behaviour is to detect the ensemble dimension from the input object.

  • *args – Additional arguments and keyword arguments to pass to the underlying reduce function.

  • **kwargs – Additional arguments and keyword arguments to pass to the underlying reduce function.

transforms.ensemble.mean(*args, **kwargs)

Calculate the ensemble mean.

Parameters:
  • dataarray (xr.DataArray | xr.Dataset) – The DataArray over which to calculate the climatological mean. Must contain a time dimension.

  • dim (str (optional)) – Name of the ensemble dimension in the data object, default behaviour is to detect the ensemble dimension from the input object.

  • *args – Additional arguments and keyword arguments to pass to the underlying reduce function.

  • **kwargs – Additional arguments and keyword arguments to pass to the underlying reduce function.

transforms.ensemble.min(*args, **kwargs)

Calculate the ensemble minimum.

Parameters:
  • dataarray (xr.DataArray | xr.Dataset) – The DataArray over which to calculate the climatological mean. Must contain a time dimension.

  • dim (str (optional)) – Name of the ensemble dimension in the data object, default behaviour is to detect the ensemble dimension from the input object.

  • *args – Additional arguments and keyword arguments to pass to the underlying reduce function.

  • **kwargs – Additional arguments and keyword arguments to pass to the underlying reduce function.

transforms.ensemble.reduce(dataarray, how='mean', dim=None)

Reduce data over the ensemble dimension.

Parameters:
  • dataarray (xr.DataArray | xr.Dataset) – The DataArray over which to calculate the climatological mean. Must contain a time dimension.

  • how (str or callable) – Method used to reduce data. Default=’mean’, which will implement the xarray in-built mean. If string, it must be an in-built xarray reduce method, an earthkit how method or any numpy method. In the case of duplicate names, method selection is first in the order: xarray, earthkit, numpy. Otherwise it can be any function which can be called in the form f(x, axis=axis, **kwargs) to return the result of reducing an np.ndarray over an integer valued axis.

  • dim (str (optional)) – Name of the ensemble dimension in the data object, default behaviour is to detect the ensemble dimension from the input object.

transforms.ensemble.std(*args, **kwargs)

Calculate the ensemble standard deviation.

Parameters:
  • dataarray (xr.DataArray | xr.Dataset) – The DataArray over which to calculate the climatological mean. Must contain a time dimension.

  • dim (str (optional)) – Name of the ensemble dimension in the data object, default behaviour is to detect the ensemble dimension from the input object.

  • *args – Additional arguments and keyword arguments to pass to the underlying reduce function.

  • **kwargs – Additional arguments and keyword arguments to pass to the underlying reduce function.

transforms.ensemble.sum(*args, **kwargs)

Calculate the ensemble sum.

Parameters:
  • dataarray (xr.DataArray | xr.Dataset) – The DataArray over which to calculate the climatological sum. Must contain a time dimension.

  • dim (str (optional)) – Name of the ensemble dimension in the data object, default behaviour is to detect the ensemble dimension from the input object.

  • *args – Additional arguments and keyword arguments to pass to the underlying reduce function.

  • **kwargs – Additional arguments and keyword arguments to pass to the underlying reduce function.

transforms.ensemble.standard_deviation