How to use the pastas.read_dino 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 / examples / reads / test_read_series.py View on Github external
"""

@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()
github pastas / pastas / tests / test_004.py View on Github external
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()
github pastas / pastas / examples / reads / test_dinodata.py View on Github external
# -*- 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()
github pastas / pastas / examples / example_900.py View on Github external
"""
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
github pastas / pastas / examples / example_no_conv.py View on Github external
"""
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:
github pastas / pastas / examples / example_project.py View on Github external
"""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()
github pastas / pastas / examples / example_tmin.py View on Github external
"""
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