slope_fdc
- postprocessinglib.evaluation.metrics.slope_fdc(df: DataFrame, percentiles: tuple[float, float] = [33, 66], stations: list[int] = []) list[float]
Calculates the slope of the Flow Duration Curve (FDC).
- Parameters:
df (pd.DataFrame) – Streamflow values for calculating the FDC slope. Each column corresponds to a station.
percentiles (tuple[float, float]) – Percentiles used for slope calculation (e.g., (33, 66) for 33rd and 66th percentiles).
stations (list[int]) – List of station indices (1-indexed) for which to calculate the slope. If empty, all stations are processed.
- Returns:
DataFrame with the slope of the FDC for each station.
- Return type:
pd.DataFrame
Example
>>> import pandas as pd >>> from postprocessinglib.evaluation import metrics >>> from metrics import slope_fdc >>> data = pd.DataFrame({ >>> "Station1": [1.2, 0.8, 0.6, 0.4, 0.2], >>> "Station2": [2.0, 1.5, 1.0, 0.5, 0.2] >>> }) >>> slope_fdc(df=data, percentiles=(33, 66)) fdc_Slope Station 1 3.1566 Station 2 2.3474