pastas.stressmodels.RechargeModel.get_water_balance#

pastas.stressmodels.RechargeModel.get_water_balance(p: pastas.typing.ArrayLike | None = None, tmin: pandas.Timestamp | str | None = None, tmax: pandas.Timestamp | str | None = None, freq: str | None = None) pandas.DataFrame#

Method to obtain the water balance components.

Parameters:
  • p (array_like, optional) – array_like object with the values as floats representing the model parameters.

  • tmin (pandas.Timestamp or str, optional) – A string or pandas.Timestamp with the start date for the period (E.g. ‘1980-01-01 00:00:00’). Strings are converted to pandas.Timestamp internally.

  • tmax (pandas.Timestamp or str, optional) – A string or pandas.Timestamp with the end date for the period (E.g. ‘2020-01-01 00:00:00’). Strings are converted to pandas.Timestamp internally.

  • freq (string, optional)

Returns:

wb – Dataframe with the water balance components, both fluxes and states.

Return type:

pandas.DataFrame

Notes

This method return a data frame with all water balance components, fluxes and states. All ingoing fluxes have a positive sign (e.g., precipitation) and all outgoing fluxes have negative sign (e.g., recharge).

Warning

This is an experimental method and may change in the future.

Examples

>>> sm = ps.RechargeModel(prec, evap, ps.Gamma(), ps.rch.FlexModel(),
>>>                       name="rch")
>>> ml.add_stressmodel(sm)
>>> ml.solve()
>>> wb = sm.get_water_balance(ml.get_parameters("rch"))
>>> wb.plot(subplots=True)