How to use the pastas.RechargeModel function in pastas

To help you get started, we’ve selected a few pastas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pastas / pastas / tests / test_recharge.py View on Github external
def test_create_rechargemodel():
    rain = read_csv("tests/data/rain.csv", index_col=0, parse_dates=True,
                    squeeze=True)
    evap = read_csv("tests/data/evap.csv", index_col=0, parse_dates=True,
                    squeeze=True)
    rm = ps.RechargeModel(prec=rain, evap=evap, name='recharge',
                          recharge="Linear")
    return rm
github pastas / pastas / examples / example_docs.py View on Github external
(the csv-files with the data can be found in the examples directory on GitHub)
"""

import pandas as pd

import pastas as ps

oseries = pd.read_csv('data/head_nb1.csv', parse_dates=['date'],
                      index_col='date', squeeze=True)
rain = pd.read_csv('data/rain_nb1.csv', parse_dates=['date'], index_col='date',
                   squeeze=True)
evap = pd.read_csv('data/evap_nb1.csv', parse_dates=['date'], index_col='date',
                   squeeze=True)

ml = ps.Model(oseries)
sm = ps.RechargeModel(prec=rain, evap=evap, rfunc=ps.Exponential,
                      recharge="Linear", name='recharge')
ml.add_stressmodel(sm)
ml.solve()
ml.plots.decomposition()
github pastas / pastas / examples / example.py View on Github external
# read observations and create the time series model
obs = pd.read_csv("data/head_nb1.csv", index_col=0, parse_dates=True,
                  squeeze=True)

# Create the time series model
ml = ps.Model(obs, name="head")

# read weather data
rain = pd.read_csv("data/rain_nb1.csv", index_col=0, parse_dates=True,
                   squeeze=True)
evap = pd.read_csv("data/evap_nb1.csv", index_col=0, parse_dates=True,
                   squeeze=True)

# Create stress
sm = ps.RechargeModel(prec=rain, evap=evap, rfunc=ps.Exponential,
                      recharge="Linear", name='recharge')
ml.add_stressmodel(sm)

# Solve
ml.solve()
ml.plot()