Metrics Calculations

postprocessinglib.evaluation.metrics Module

The metrics module contains all of the metrics required during the prost processing process. Each metric has a function and there are hepler functions that help with error checking and reading and preparation of data to be evaluated. This module contains functions evaluate single sample data such as the

  • The Slope of Flow duration curve slope_fdc,

  • Time to peak ttp,

  • Time to centre of mass ttcom, and,

  • Spring Pulse Onset Delay spod.

as well as comparison samples between the measured and predicted data such as

  • Mean Square Error mse,

  • Percentage Bias bias, and ,

  • Kling Gupta Efficiency kge, amongst others.

Finally we are also able to calculate a number of metrices at the same time or all of them at the same time using one of the two function below:

  • calculate_metrics([list of metrics])

  • calculate_all_metrics()

All these functions along side their expected inputs and outputs are shown below:

Functions

QPEAK(df[, stations, use_jday])

Peak discharge value corresponding to the same peak timing logic used by time_to_peak (TTP).

SpringPulseOnset(df[, stations, use_jday])

Calculates the average day of year when the spring pulse (snowmelt) begins for each station.

available_metrics()

Get a list of currently available metrics

bias(observed, simulated[, stations])

Calculates the Percentage Bias of the data

calculate_all_metrics(observed, simulated[, ...])

Calculate all metrics.

calculate_metrics(observed, simulated, metrices)

Calculate the requested metrics.

kge(observed, simulated[, stations, scale, ...])

Calculates the Kling-Gupta Efficiency of the data

kge_2012(observed, simulated[, stations, ...])

Calculates the Kling-Gupta Efficiency of the data

lognse(observed, simulated[, stations])

Calculates the Logarithmic Nash-Sutcliffe Efficiency of the data

mae(observed, simulated[, stations])

Calculates the Mean Average value of the data

mse(observed, simulated[, stations])

Calculates the Mean Square value of the data

nse(observed, simulated[, stations])

Calculates the Nash-Sutcliffe Efficiency of the data

rmse(observed, simulated[, stations])

Calculates the Root Mean Square value of the data

slope_fdc(df[, percentiles, stations])

Calculates the slope of the Flow Duration Curve (FDC).

time_to_centre_of_mass(df[, stations, use_jday])

Calculates the time it takes to obtain 50% of the stream flow in a given year

time_to_peak(df[, stations, use_jday])

Calculates the time to peak of a given series of data whether observed