hydrosignatures.baseflow#

Function for computing hydrologic signature.

Module Contents#

hydrosignatures.baseflow.baseflow(discharge, alpha=0.925, n_passes=1, pad_width=10)#

Extract baseflow using the Lyne and Hollick filter (Ladson et al., 2013).

Parameters:
  • discharge (numpy.ndarray or pandas.DataFrame or pandas.Series or xarray.DataArray) – Discharge time series that must not have any missing values. It can also be a 2D array where each row is a time series.

  • n_passes (int, optional) – Number of filter passes, defaults to 1.

  • alpha (float, optional) – Filter parameter that must be between 0 and 1, defaults to 0.925.

  • pad_width (int, optional) – Padding width for extending the data from both ends to address the warm up issue.

Returns:

numpy.ndarray or pandas.DataFrame or pandas.Series or xarray.DataArray – Same discharge input array-like but values replaced with computed baseflow values.

Return type:

ArrayVar

hydrosignatures.baseflow.baseflow_index(discharge, alpha=0.925, n_passes=3, pad_width=10)#

Compute the baseflow index using the Lyne and Hollick filter (Ladson et al., 2013).

Parameters:
  • discharge (numpy.ndarray or pandas.DataFrame or pandas.Series or xarray.DataArray) – Discharge time series that must not have any missing values. It can also be a 2D array where each row is a time series.

  • n_passes (int, optional) – Number of filter passes, defaults to 3. It must be an odd number greater than 3.

  • alpha (float, optional) – Filter parameter that must be between 0 and 1, defaults to 0.925.

  • pad_width (int, optional) – Padding width for extending the data from both ends to address the warm up issue.

Returns:

numpy.float64 – The baseflow index.

Return type:

numpy.float64

hydrosignatures.baseflow.baseflow_recession(streamflow, freq=1.0, recession_length=15, n_start=0, eps=0, start_of_recession='baseflow', fit_method='nonparametric_analytic', lyne_hollick_smoothing=0.925)#

Calculate baseflow recession constant and master recession curve.

Notes

This function is ported from the TOSSH Matlab toolbox, which is based on the following publication:

Gnann, S.J., Coxon, G., Woods, R.A., Howden, N.J.K., McMillan H.K., 2021. TOSSH: A Toolbox for Streamflow Signatures in Hydrology. Environmental Modelling & Software. https://doi.org/10.1016/j.envsoft.2021.104983

This function calculates baseflow recession constant assuming exponential recession behaviour (Safeeq et al., 2013). Master recession curve (MRC) is constructed using the adapted matching strip method (Posavec et al., 2006).

According to Safeeq et al. (2013), \(K < 0.065\) represent groundwater dominated slow-draining systems, \(K >= 0.065\) represent shallow subsurface flow dominated fast draining systems.

Parameters:
  • streamflow (numpy.ndarray) – Streamflow as a 1D array.

  • freq (float, optional) – Frequency of steamflow in number of days. Default is 1, i.e., daily streamflow.

  • recession_length (int, optional) – Minimum length of recessions [days]. Default is 15.

  • n_start (int, optional) – Days to be removed after start of recession. Default is 0.

  • eps (float, optional) – Allowed increase in flow during recession period. Default is 0.

  • start_of_recession ({'baseflow', 'peak'}, optional) – Define start of recession. Default is ‘baseflow’.

  • fit_method ({'nonparametric_analytic', 'exponential'}, optional) – Method to fit mrc. Default is ‘nonparametric_analytic’.

  • lyne_hollick_smoothing (float, optional) – Smoothing parameter of Lyne-Hollick filter. Default is 0.925.

Returns:

  • mrc (numpy.ndarray) – Master Recession Curve as 2D array of [time, flow].

  • bf_recession_k (float) – Baseflow Recession Constant [1/day].

Raises:

ValueError – If no recession segments are found or if a complex BaseflowRecessionK is calculated.

Return type:

tuple[FloatArray, float]