weatherbench2.derived_variables.PrecipitationAccumulation
- class weatherbench2.derived_variables.PrecipitationAccumulation(total_precipitation_name, accumulation_hours, lead_time_name='prediction_timedelta', set_negative_to_zero=True)
Compute precipitation accumulation from hourly accumulations.
Accumulation is computed for the time period leading up to and including the lead_time. E.g. 24h accumulation at lead_time=24h indicates accumulation from lead_time=0 to lead_time=24. This is equal to the values of total_precipitation_name at 24, minus the value at 0.
Caution: Small negative values sometimes appear in model output. Here, we set them to zero.
- Parameters:
total_precipitation_name (str) –
accumulation_hours (int) –
lead_time_name (str) –
set_negative_to_zero (bool) –
- total_precipitation_name
Name of hourly total_precipitation input.
- Type:
str
- accumulation_hours
Hours to accumulate precipitation over
- Type:
int
- lead_time_name
Name of lead_time dimension.
- Type:
str
- set_negative_to_zero
Specify whether to set negative temporal differences to zero.
- Type:
bool
- __init__(total_precipitation_name, accumulation_hours, lead_time_name='prediction_timedelta', set_negative_to_zero=True)
- Parameters:
total_precipitation_name (str) –
accumulation_hours (int) –
lead_time_name (str) –
set_negative_to_zero (bool) –
- Return type:
None
Methods
__init__(total_precipitation_name, ...[, ...])compute(dataset)Compute derived variable, returning it in a new DataArray.
Attributes
all_input_core_dimsThe set of all input core dimensions.
base_variablesReturn a list of base variables.
core_dimsReturn core dimensions needed for computing this variable.