Flows
catchment_runoff_inflows(met_pd, date_time_col, precip_col, catchment_area, runoff_coef=None, runoff_threshold=None)
¶
Calculate catchment runoff inflows from rainfall.
Returns a DataFrame of inflow by calculating catchment runoff from precipitation data. Inflows are calculated at the same timestep as the precipitation data but in units of m^3/s.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
met_pd |
DataFrame
|
A pandas DataFrame of meteorological data. |
required |
date_time_col |
str
|
Name of the column in the DataFrame containing datetime values. |
required |
precip_col |
str
|
Name of the column in the DataFrame containing precipitation data in m/day or m/hour. |
required |
catchment_area |
Union[float, int]
|
Area of the catchment in square meters. |
required |
runoff_coef |
Union[float, None]
|
Runoff coefficient for the catchment. The fraction of rainfall
that will result in runoff. Either |
None
|
runoff_threshold |
Union[float, None]
|
Runoff threshold for the catchment. The amount of rainfall in
mm to generate runoff. Either |
None
|
Examples:
Generates a daily timeseries of rainfall then calculates inflows with a 50% runoff coefficient and a 1000 m^2 catchment area:
>>> import pandas as pd
>>> from glmpy import flows
>>> daily_met_pd = pd.DataFrame({
... 'date': pd.date_range(
... start='1997-01-01',
... end='2004-12-31',
... freq='24h'),
... 'rain': 0.024 #m per day
... })
>>> inflows_pd = flows.catchment_runoff_inflows(
... met_pd=daily_met_pd,
... date_time_col='date',
... precip_col='rain',
... catchment_area=1000,
... runoff_coef=0.5,
... )