deaccumulate¶
- earthkit.transforms.temporal.deaccumulate(dataarray: Dataset | DataArray, *_args, **_kwargs) Dataset | DataArray[source]¶
Alias for accumulation_to_rate function with rate_units set to ‘step_length’.
The returned object will preserve the units and long_name attributes of the input dataarray.
- Parameters:
dataarray (xarray.DataArray | xarray.Dataset) – Data accumulated along time to be converted into rate (per time step).
step (timedelta | str, optional) – Interval between consecutive time steps. If a string, it should be a valid pandas time frequency string (e.g., ‘15min’, ‘3h’, ‘1 day’). If not provided, it will be inferred from the data.
rate_label (str, optional) – Suffix to append to the name and long_name of the output dataarray.
xp (T.Any) – The array namespace to use for the reduction. If None, it will be inferred from the dataarray.
time_dim (str, optional) – Name of the time dimension, or coordinate, in the xarray object to use for the calculation, default behaviour is to deduce time dimension from attributes of coordinates, then fall back to “time”.
accumulation_type (str, optional) –
Type of accumulation used in the input data. Default is “start_of_forecast”.
Options are:
”start_of_step”: accumulation restarts at the beginning of each time step.
”start_of_forecast”: accumulation starts at the beginning of the forecast and continues throughout the forecast period.
”start_of_day”: accumulation restarts at the beginning of each day (00:00 UTC).
from_first_step (bool, optional) – Only used if accumulation_type is “start_of_forecast”. If True, the first time step’s rate is calculated by dividing the first accumulation value by the step duration. Default is False.
provenance (bool, optional) – If True, appends a history entry to the output dataarray’s attributes indicating that the transformation was applied. Default is True.
- Returns:
Data object with deaccumulated data.
- Return type: