hydrosignatures.hydrosignatures#
Function for computing hydrologic signature.
Module Contents#
- class hydrosignatures.hydrosignatures.HydroSignatures#
Hydrological signatures.
- Parameters:
q_mmpt (
pandas.Series) – Discharge in mm per unit time (the same timescale as precipitation).p_mmpt (
pandas.Series) – Precipitation in mm per unit time (the same timescale as discharge).si_method (
str, optional) – Seasonality index method. Eitherwalshormarkham. Default iswalsh.fdc_slope_bins (
tupleofint, optional) – The percentage bins between 1-100 to compute the slope of FDC within it, defaults to(33, 67).bfi_alpha (
float, optional) – Alpha parameter for baseflow separation filter using Lyne and Hollick method. Default is0.925.
- bfi()#
Compute Baseflow Index.
- diff(other)#
Compute absolute difference between two hydrological signatures.
- fdc()#
Compute exceedance probability (for flow duration curve).
- fdc_slope()#
Compute FDC slopes between a list of lower and upper percentiles.
- isclose(other)#
Check if the signatures are close between with a tolerance of 1e-3.
- mean_annual_flood()#
Compute mean annual flood.
- mean_monthly()#
Compute mean monthly flow (for regime curve).
- runoff_ratio()#
Compute total runoff ratio.
- seasonality_index()#
Compute seasonality index.
- streamflow_elasticity()#
Compute streamflow elasticity.
- to_dict()#
Return a dictionary with the hydrological signatures.
- to_json()#
Return a JSON string with the hydrological signatures.
- property values: SignaturesFloat#
Return a dictionary with the hydrological signatures.
- hydrosignatures.hydrosignatures.aridity_index(pet: pandas.Series, prcp: pandas.Series) numpy.float64#
- hydrosignatures.hydrosignatures.aridity_index(pet: pandas.DataFrame, prcp: pandas.DataFrame) pandas.Series
- hydrosignatures.hydrosignatures.aridity_index(pet: xarray.DataArray, prcp: xarray.DataArray) xarray.DataArray
Compute (Budyko) aridity index (PET/Prcp).
- Parameters:
pet (
pandas.DataFrameorpandas.Seriesorxarray.DataArray) – Potential evapotranspiration time series. Each column can correspond to PET a different location. Note thatpetandprcpmust have the same shape.prcp (
pandas.DataFrameorpandas.Seriesorxarray.DataArray) – Precipitation time series. Each column can correspond to PET a different location. Note thatpetandprcpmust have the same shape.
- Returns:
floatorpandas.Seriesorxarray.DataArray– The aridity index.
- hydrosignatures.hydrosignatures.exceedance(daily, threshold=0.001)#
Compute exceedance probability from daily data.
- Parameters:
daily (
pandas.Seriesorpandas.DataFrame) – The data to be processedthreshold (
float, optional) – The threshold to compute exceedance probability, defaults to 1e-3.
- Returns:
pandas.Seriesorpandas.DataFrame– Exceedance probability.- Return type:
- hydrosignatures.hydrosignatures.extract_extrema(ts, var_name, n_pts)#
Get local extrema in a time series.
- Parameters:
ts (
pandas.Series) – Variable time series.var_name (
str) – Variable name.n_pts (
int) – Number of points to consider for detecting local extrema on both sides of each point.
- Returns:
pandas.DataFrame– A dataframe with three columns:var_name,peak(bool) andtrough(bool).- Return type:
- hydrosignatures.hydrosignatures.flashiness_index(daily)#
Compute flashiness index from daily data following Baker et al. (2004).
- Parameters:
daily (
pandas.Seriesorpandas.DataFrameornumpy.ndarrayorxarray.DataArray) – The data to be processed- Returns:
numpy.ndarray– Flashiness index.- Return type:
FloatArray
References
Baker, D.B., Richards, R.P., Loftus, T.T. and Kramer, J.W., 2004. A new flashiness index: Characteristics and applications to midwestern rivers and streams 1. JAWRA Journal of the American Water Resources Association, 40(2), pp.503-522.
- hydrosignatures.hydrosignatures.flood_moments(streamflow)#
Compute flood moments (MAF, CV, CS) from streamflow.
- Parameters:
streamflow (
pandas.DataFrame) – The streamflow data to be processed- Returns:
pandas.DataFrame– Flood moments; mean annual flood (MAF), coefficient of variation (CV), and coefficient of skewness (CS).- Return type:
- hydrosignatures.hydrosignatures.flow_duration_curve_slope(discharge, bins, log)#
Compute FDC slopes between the given lower and upper percentiles.
- Parameters:
discharge (
pandas.Seriesorpandas.DataFrameornumpy.ndarrayorxarray.DataArray) – The discharge data to be processed.bins (
tupleofint) – Percentile bins for computing FDC slopes between., e.g., (33, 67) returns the slope between the 33rd and 67th percentiles.log (
bool) – Whether to use log-transformed data.
- Returns:
numpy.ndarray– The slopes between the given percentiles.- Return type:
FloatArray
- hydrosignatures.hydrosignatures.mean_monthly(daily, index_abbr=False, cms=False)#
Compute mean monthly summary from daily data.
- Parameters:
daily (
pandas.Seriesorpandas.DataFrame) – The data to be processedindex_abbr (
bool, optional) – Whether to use abbreviated month names as index instead of numbers, defaults to False.cms (
bool, optional) – Whether the input data is in cubic meters per second (cms), defaults to False. If True, the mean monthly summary will be computed by taking the mean of the daily data, otherwise the sum of the daily data will be used.
- Returns:
pandas.Seriesorpandas.DataFrame– Mean monthly summary.- Return type:
DF
- hydrosignatures.hydrosignatures.rolling_mean_monthly(daily)#
Compute rolling mean monthly.
- hydrosignatures.hydrosignatures.seasonality_index_markham(data)#
Compute seasonality index based on Markham, 1970.
- hydrosignatures.hydrosignatures.seasonality_index_walsh(data)#
Compute seasonality index based on Walsh and Lawler, 1981 method.