pastas.stressmodels.RechargeModel#
- class pastas.stressmodels.RechargeModel(prec: pandas.Series, evap: pandas.Series, rfunc: pastas.typing.RFunc | None = None, name: str = 'recharge', recharge: pastas.typing.Recharge | None = None, temp: pandas.Series | None = None, settings: tuple[str | pastas.typing.StressSettingsDict, str | pastas.typing.StressSettingsDict, str | pastas.typing.StressSettingsDict] = ('prec', 'evap', 'evap'), metadata: tuple[dict | None, dict | None, dict | None] = (None, None, None), max_cache_size: int | None = None)#
Stressmodel simulating the effect of groundwater recharge on the head.
- Parameters:
prec (pandas.Series) – pandas.Series with pandas.DatetimeIndex containing the precipitation series. The precipitation series should be provided in mm/day when a nonlinear model is used.
evap (pandas.Series) – pandas.Series with pandas.DatetimeIndex containing the potential evaporation series. The evaporation series should be provided in mm/day when a nonlinear model is used.
rfunc (pastas.rfunc instance, optional) – Instance of the response function used in the convolution with the stress. Default is ps.Exponential().
name (str, optional) – Name of the stressmodel. Default is “recharge”.
recharge (pastas.recharge instance, optional) – Instance of a recharge model. Options are: Linear, FlexModel and Berendrecht. These can be accessed through ps.rch. Default is ps.rch.Linear().
temp (pandas.Series, optional) – pandas.Series with pandas.DatetimeIndex containing the temperature series. It depends on the recharge model if this argument is required or not. The temperature series should be provided in degrees Celsius.
settings (tuple of str or dict, optional) – The settings of the precipitation, evaporation and optionally temperature time series, in this order. By default (“prec”, “evap”, “evap”). This can be a string referring to a predefined settings dict (defined in ps.rcParams[“timeseries”]), or a dict with the settings to apply. For more information refer to Time Series Settings section below for more information.
metadata (tuple of dict or None, optional) – dictionary containing metadata about the stress. This is passed onto the TimeSeries object.
max_cache_size (int, optional) – Maximum size of the cache (in number of entries). Only used when cachetools is installed and caching is enabled (see ps.set_use_cache()).
Examples
>>> sm = ps.RechargeModel(rain, evap, rfunc=ps.Exponential(), >>> recharge=ps.rch.FlexModel(), name="rch") >>> ml.add_stressmodel(sm)
- Parameters:
settings (Time series)
fill_nan ({"drop", "mean", "interpolate"} or float) –
- Method for filling NaNs.
drop: drop NaNs from time series
mean: fill NaNs with mean value of time series
interpolate: fill NaNs by interpolating between finite values
float: fill NaN with provided value, e.g. 0.0
fill_before ({"mean", "bfill"} or float) –
- Method for extending time series into past.
mean: extend time series into past with mean value of time series
bfill: extend time series into past by back-filling first value
float: extend time series into past with provided value, e.g. 0.0
fill_after ({"mean", "ffill"} or float) –
- Method for extending time series into future.
mean: extend time series into future with mean value of time series
ffill: extend time series into future by forward-filling last value
float: extend time series into future with provided value, e.g. 0.0
sample_up ({"mean", "interpolate", "divide"} or float) –
Method for up-sampling time series (increasing frequency, e.g. going from weekly to daily values).
bfill or backfill: fill up-sampled time steps by back-filling current values
ffill or pad: fill up-sampled time steps by forward-filling current values
mean: fill up-sampled time steps with mean of timeseries
interpolate: fill up-sampled time steps by interpolating between current values
divide: fill up-sampled steps with current value divided by length of current time steps (i.e. spread value over new time steps).
sample_down ({"mean", "drop", "sum", "min", "max"}) –
Method for down-sampling time series (decreasing frequency, e.g. going from daily to weekly values).
mean: resample time series by taking the mean
drop: resample the time series by taking the mean, dropping any NaN-values
sum: resample time series by summing values
max: resample time series with maximum value
min: resample time series with minimum value
Notes
This stress model computes the contribution of precipitation and potential evaporation in two steps. In the first step a recharge flux is computed by a model determined by the input argument recharge. In the second step this recharge flux is convolved with a response function to obtain the contribution of recharge to the groundwater levels. If a nonlinear recharge model is used, the precipitation should be in mm/d.
Warning
We recommend not to store a RechargeModel in a variable named rm. This name is already reserved in IPython to remove files and will cause problems later.
A warning is raised if the maximum annual precipitation is smaller than 12 and a nonlinear recharge model is applied. This is likely an indication that the units of the precipitation series are in m/d instead of mm/d. Please check the units of the precipitation series.
- property stress: None#
Return the stress time series.
Deprecated since version 2.0.0: The stress property is deprecated and will be removed in a future version. Use the stresses property instead if you want to obtain all stresses. For individual stresses call the prec, evap and temp attributes. Changing the stress can be done using the set_stress method.
- property prec: pastas.timeseries.TimeSeries#
Return the stress time series.
- property evap: pastas.timeseries.TimeSeries#
Return the stress time series.
- property temp: pastas.timeseries.TimeSeries | None#
Return the stress time series.
- property stresses: tuple[pastas.timeseries.TimeSeries]#
Return the stress time series as a tuple.
Methods#
|
Set the stress time series for the RechargeModel. |
|
Set the initial parameters (back) to their default values. |
|
Simulate the stress model contribution. |
|
Obtain the recharge stress calculated by the model. |
|
Obtain the water balance components. |
|
Get parameters and return as array. |
|
Export the stress model to a dictionary. |