Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
@author: ruben
"""
import pastas as ps
fname = '../data/B32D0136001_1.csv'
obs = ps.read_dino(fname)
fname = '../data/KNMI_Bilt.txt'
stress = ps.read_knmi(fname, 'EV24')
obs.plot()
stress.plot()
def test_create_model():
# Import and check the observed groundwater time series
obs = ps.read_dino('tests/data/dino_gwl_data.csv')
# Create the time series model
ml = ps.Model(obs, name="Test_Model")
# read weather data
rain = ps.read_knmi('tests/data/knmi_rain_data.txt', variables='RD')
evap = ps.read_knmi('tests/data/knmi_evap_data.txt', variables='EV24')
## Create stress
sm = ps.StressModel2(stress=[rain, evap], rfunc=ps.Exponential,
name='recharge')
ml.add_stressmodel(sm)
## Solve
ml.solve()
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 30 16:07:44 2016
@author: ruben
"""
import matplotlib.pyplot as plt
import pastas as ps
# # How to use it?
fname = '../data/B32D0136001_1.csv'
dino = ps.read_dino(fname)
# plot
dino[0].plot()
plt.show()
"""
In this example a daily simulation is conducted from 9:00 until 9:00 (dutch standard time)
This is the time at which precipitation is logged in dutch KNMI-stations.
"""
import pastas as ps
import pandas as pd
# read observations
obs = ps.read_dino('data/B58C0698001_1.csv')
# Create the time series model
ml = ps.Model(obs)
# read weather data
knmi = ps.read.knmi.KnmiStation.fromfile(
'data/neerslaggeg_HEIBLOEM-L_967-2.txt')
rain = ps.TimeSeries(knmi.data['RD'], settings='prec')
evap = ps.read_knmi('data/etmgeg_380.txt', variables='EV24')
if True:
# also add 9 hours to the evaporation
s = evap.series_original
s.index = s.index + pd.to_timedelta(9, 'h')
evap.series_original = s
"""
This test file is meant for developing purposes. Providing an easy method to
test the functioning of PASTAS during development.
"""
import pandas as pd
import pastas as ps
# Read observations
obs = ps.read_dino('data/B58C0698001_1.csv')
obs = obs.iloc[::5]
obs = obs[obs.index > pd.to_datetime('1-1-2010')]
# Create the time series model
ml = ps.Model(obs)
# Read weather data
prec = ps.read_knmi('data/neerslaggeg_HEIBLOEM-L_967-2.txt', variables='RD')
evap = ps.read_knmi('data/etmgeg_380.txt', variables='EV24')
# Create stress
if False:
sm = ps.StressModel2(stress=[prec, evap], rfunc=ps.Exponential,
name='recharge')
ml.add_stressmodel(sm)
elif False:
"""This file contains an example of the use of the Project class.
R.A. Collenteur - Artesia Water 2017
"""
import pastas as ps
# Create a simple model taken from example.py
obs = ps.read_dino('data/B58C0698001_1.csv')
rain = ps.read_knmi('data/neerslaggeg_HEIBLOEM-L_967-2.txt', variables='RD')
evap = ps.read_knmi('data/etmgeg_380.txt', variables='EV24')
# Create a Pastas Project
mls = ps.Project(name="test_project")
mls.add_series(obs, "GWL", kind="oseries", metadata=dict())
mls.add_series(rain, name="Prec", kind="prec", metadata=dict())
mls.add_series(evap, name="Evap", kind="evap", metadata=dict())
ml = mls.add_model(oseries="GWL")
sm = ps.StressModel2([mls.stresses.loc["Prec", "series"],
mls.stresses.loc["Evap", "series"]],
ps.Exponential, name='recharge')
ml.add_stressmodel(sm)
n = ps.NoiseModel()
"""
This test file is meant for developing purposes, providing an easy method to
test the functioning of Pastas recharge module during development.
Author: R.A. Collenteur, University of Graz.
"""
import pastas as ps
import pandas as pd
ps.set_log_level("ERROR")
# read observations
obs = ps.read_dino('data/B58C0698001_1.csv')
# Create the time series model
ml = ps.Model(obs, name="groundwater head")
# read weather data
rain = ps.read_knmi('data/neerslaggeg_HEIBLOEM-L_967-2.txt', variables='RD')
rain.multiply(1000)
evap = ps.read_knmi('data/etmgeg_380.txt', variables='EV24')
evap.multiply(1000)
# Create stress
sm = ps.RechargeModel(prec=rain, evap=evap, rfunc=ps.Exponential,
recharge="Linear", name='recharge')
ml.add_stressmodel(sm)
# Set tmin