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 the lead_time. E.g. 24h accumulation at lead_time=24h indicates 0-24h accumulation. 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_dims

The set of all input core dimensions.

base_variables

Return a list of base variables.

core_dims

Return core dimensions needed for computing this variable.

lead_time_name

set_negative_to_zero

total_precipitation_name

accumulation_hours