pastas.stressmodels.StressModel =============================== .. toctree:: :hidden: /api/pastas/stressmodels/StressModel.set_stress /api/pastas/stressmodels/StressModel.set_init_parameters /api/pastas/stressmodels/StressModel.simulate /api/pastas/stressmodels/StressModel.to_dict .. py:class:: pastas.stressmodels.StressModel(stress: pandas.Series, rfunc: pastas.typing.RFunc, name: str, up: bool = True, settings: str | pastas.typing.StressSettingsDict | None = None, metadata: dict | None = None, gain_scale_factor: float | None = None, max_cache_size: int | None = None) Stress model convoluting a stress with a response function. :param stress: pandas.Series with pandas.DatetimeIndex containing the stress. :type stress: pandas.Series :param rfunc: An instance of the response function used in the convolution with the stress. :type rfunc: pastas.rfunc instance :param name: Name of the stressmodel. :type name: str :param up: True if response function is positive (default), False if negative. None if you don't want to define if response is positive or negative. :type up: bool or None, optional :param settings: The settings of the stress. This can be a string referring to a predefined settings dictionary (defined in ps.rcParams["timeseries"]), or a dictionary with the settings to apply. For more information refer to time series settings section below. :type settings: dict or str, optional :param metadata: dictionary containing metadata about the stress. This is passed onto the TimeSeries object. :type metadata: dict, optional :param gain_scale_factor: the scale factor is used to set the initial value and the bounds of the gain parameter, computed as 1 / gain_scale_factor. :type gain_scale_factor: float, optional :param max_cache_size: Maximum size of the cache (in number of entries). Only used when cachetools is installed and caching is enabled (see ps.set_use_cache()). :type max_cache_size: int, optional :param Time series settings: :param fill_nan: 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 :type fill_nan: {"drop", "mean", "interpolate"} or float :param fill_before: 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 :type fill_before: {"mean", "bfill"} or float :param fill_after: 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 :type fill_after: {"mean", "ffill"} or float :param sample_up: 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). :type sample_up: {"mean", "interpolate", "divide"} or float :param sample_down: 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 :type sample_down: {"mean", "drop", "sum", "min", "max"} .. rubric:: Examples >>> import pastas as ps >>> import pandas as pd >>> sm = ps.StressModel(stress=pd.Series(), rfunc=ps.Gamma(), name="Prec", >>> settings="prec") .. seealso:: :py:obj:`pastas.rfunc`, :py:obj:`pastas.timeseries.TimeSeries` .. !! processed by numpydoc !! .. py:property:: stress :type: pastas.timeseries.TimeSeries Return the stress time series. .. !! processed by numpydoc !! .. py:property:: stresses :type: tuple[pastas.timeseries.TimeSeries] Return the stress time series as a tuple. .. !! processed by numpydoc !! .. py:property:: nsplit :type: int Determine in how many time series the contribution can be split. .. !! processed by numpydoc !! Methods ------- .. autoapisummary:: pastas.stressmodels.StressModel.set_stress pastas.stressmodels.StressModel.set_init_parameters pastas.stressmodels.StressModel.simulate pastas.stressmodels.StressModel.to_dict