wrfhydropy.Evaluation

class wrfhydropy.Evaluation(observed: DataFrame | DataArray, modeled: DataFrame | DataArray, join_on: list | str | None = None, join_how: str = 'inner')[source]

A dataset consisting of a modeled and observed dataframe. This class provides methods for calculating staistics.

Methods

brier(threshold[, mod_col, obs_col, ...])

Calculate Brier score using the properscoring package. See :py:fun:`threshold_brier_score() <threshold_brier_score>` in properscoring. Grouping is not necessary because BRIER returns a value per forecast. Grouping would happen when computing BRIERS. The Eval object generally wants one observation per modeled data point, that is overkill for this function but we handle it in a consistent manner with the rest of Evaluation. :Parameters: * mod_col -- Column name of modelled data * obs_col -- Column name of observed data.

contingency(threshold[, time_window, ...])

Calculate contingency statistics

crps([mod_col, obs_col, member_col, ...])

Calculate CRPS (continuous ranked probability score) using the properscoring package. See :py:fun:`crps_ensemble() <crps_ensemble>` in properscoring.

event(threshold[, mod_col, obs_col, ...])

TODO: HUH? this is the same description as gof but returns a contingency table? Calculate goodness of fit statistics using the spotpy package. See :py:fun:`calculate_all_functions() <calculate_all_functions>` in spotpy. :Parameters: * mod_col -- Column name of modelled data * obs_col -- Column name of observed data * group_by -- Column names to group by prior to calculating statistics * decimals -- round stats to specified decimal places * threshold -- Threshold value for high flow event or * column name containing threshold value..

gof([mod_col, obs_col, group_by, inf_as_na, ...])

Calculate goodness of fit statistics using the spotpy package. See :py:fun:`calculate_all_functions() <calculate_all_functions>` in spotpy. :Parameters: * mod_col -- Column name of modelled data * obs_col -- Column name of observed data * group_by -- Column names to group by prior to calculating statistics * inf_as_na -- convert inf values to na? * decimals -- round stats to specified decimal places.

__init__(observed: DataFrame | DataArray, modeled: DataFrame | DataArray, join_on: list | str | None = None, join_how: str = 'inner')[source]

Instantiate analysis class by joining modeled and observed datasets. :Parameters: * observed – Dataframe containing observed data

  • modeled – Dataframe containing modelled data

  • join_on – Optional, string or list of columns names to join datasets.

  • Default is [‘feature_id’,’time’]

  • join_how – Optional, how to perform teh dataframe join. Default is

  • ‘inner’. Options

  • are ‘inner’,’left’,’right’.

Methods

__init__(observed, modeled[, join_on, join_how])

Instantiate analysis class by joining modeled and observed datasets. :Parameters: * observed -- Dataframe containing observed data * modeled -- Dataframe containing modelled data * join_on -- Optional, string or list of columns names to join datasets. * Default is ['feature_id','time'] * join_how -- Optional, how to perform teh dataframe join. Default is * 'inner'. Options * are 'inner','left','right'..

brier(threshold[, mod_col, obs_col, ...])

Calculate Brier score using the properscoring package. See :py:fun:`threshold_brier_score() <threshold_brier_score>` in properscoring. Grouping is not necessary because BRIER returns a value per forecast. Grouping would happen when computing BRIERS. The Eval object generally wants one observation per modeled data point, that is overkill for this function but we handle it in a consistent manner with the rest of Evaluation. :Parameters: * mod_col -- Column name of modelled data * obs_col -- Column name of observed data.

contingency(threshold[, time_window, ...])

Calculate contingency statistics

crps([mod_col, obs_col, member_col, ...])

Calculate CRPS (continuous ranked probability score) using the properscoring package. See :py:fun:`crps_ensemble() <crps_ensemble>` in properscoring.

event(threshold[, mod_col, obs_col, ...])

TODO: HUH? this is the same description as gof but returns a contingency table? Calculate goodness of fit statistics using the spotpy package. See :py:fun:`calculate_all_functions() <calculate_all_functions>` in spotpy. :Parameters: * mod_col -- Column name of modelled data * obs_col -- Column name of observed data * group_by -- Column names to group by prior to calculating statistics * decimals -- round stats to specified decimal places * threshold -- Threshold value for high flow event or * column name containing threshold value..

gof([mod_col, obs_col, group_by, inf_as_na, ...])

Calculate goodness of fit statistics using the spotpy package. See :py:fun:`calculate_all_functions() <calculate_all_functions>` in spotpy. :Parameters: * mod_col -- Column name of modelled data * obs_col -- Column name of observed data * group_by -- Column names to group by prior to calculating statistics * inf_as_na -- convert inf values to na? * decimals -- round stats to specified decimal places.

Attributes

data

The dataframe to analyze