reclaim.dynamic_features package

Subpackages

reclaim.dynamic_features.catchment_dynamic module

reclaim.dynamic_features.catchment_dynamic.catchment_based_dynamic_features(variable_info: Dict[str, Dict[str, str]], observation_intervals: List[Sequence[int]]) DataFrame[source]

Compute dynamic catchment-based features for a single reservoir’s catchment, using precipitation, temperature, and wind speed time series.

Required time series keys (case-sensitive)
  • “precip”: Daily precipitation in mm

  • “tmin”: Daily minimum temperature in °C

  • “tmax”: Daily maximum temperature in °C

  • “wind”: Daily wind speed in m/s

Parameters:
  • variable_info (dict) –

    Dictionary of input series metadata. Each key corresponds to a variable (precip, tmin, tmax, wind). Each value is a dict with:

    {

    “path”: str, “time_column”: str, “data_column”: str

    }

  • observation_intervals (list of list of int) – List of [start_year, end_year] intervals to compute features over.

Returns:

A DataFrame containing as many rows as there are observation intervals and columns corresponding to the computed catchment-based features. Missing variables in variable_info will result in NaN values for their features.

Return type:

pd.DataFrame

Notes

  • Precipitation features are reported as mm/year (for MAR) and counts (rainy days).

  • Wind statistics include mean, std, CV, skewness, kurtosis.

  • Temperature features are simple annual means (°C).

reclaim.dynamic_features.reservoir_dynamic module

reclaim.dynamic_features.reservoir_dynamic.reservoir_based_dynamic_features(variable_info: Dict[str, Dict[str, str]], observation_intervals: List[Sequence[int]]) DataFrame[source]

Compute dynamic reservoir features for a single reservoir using inflow, outflow, surface area, evaporation, and sediment-related time series.

Required time series keys (case-sensitive):

  • inflow: Daily inflow in m³/day

  • outflow: Daily outflow in m³/day

  • evaporation: Daily evaporation in mm/day

  • surface_area: Reservoir surface area in km²

  • nssc: Normalized suspended sediment concentration variant 1 (red/green) (dimensionless)

  • nssc2: Normalized suspended sediment concentration variant 2 (near-infrared/red) (dimensionless)

Parameters:
  • variable_info (dict) –

    Dictionary of input series metadata. Each key corresponds to a variable (inflow, outflow, evaporation, surface_area, nssc, nssc2). Each value is a dict with the following structure:

    {
        "path": str,          # Path to the CSV file
        "time_column": str,   # Name of the datetime column
        "data_column": str    # Name of the variable column
    }
    

    Example:

    {
        "inflow": {"path": "data/inflow.csv", "time_column": "date", "data_column": "inflow (m3/d)"},
        "outflow": {"path": "data/outflow.csv", "time_column": "date", "data_column": "outflow (m3/d)"}
    }
    

  • observation_intervals (list of list of int) – List of [start_year, end_year] intervals to compute features over.

Returns:

A DataFrame containing as many rows as observation_intervals and columns corresponding to the computed reservoir dynamic features. Missing variables in variable_info will result in NaN values for their features.

Return type:

pd.DataFrame

Notes

  • All inflow/outflow metrics are converted to m³/s internally.

  • Surface area statistics are reported both for full record and clipped period.

  • NSSC statistics are dimensionless.

  • If a variable is missing in variable_info, its corresponding features are NaN.