Contents

welltestpy Quickstart

_images/WTP.png

welltestpy provides a framework to handle, process, plot and analyse data from well based field campaigns.

Installation

The package can be installed via pip. On Windows you can install WinPython to get Python and pip running.

pip install welltestpy

Provided Subpackages

The following functions are provided directly

welltestpy.data      # Subpackage to handle data from field campaigns
welltestpy.estimate  # Subpackage to estimate field parameters
welltestpy.process   # Subpackage to pre- and post-process data
welltestpy.tools     # Subpackage with tools for plotting and triagulation

License

MIT

welltestpy Tutorial

In the following you will find several Tutorials on how to use welltestpy to explore its whole beauty and power.

welltestpy API

Purpose

welltestpy provides a framework to handle and plot data from well based field campaigns as well as a parameter estimation module.

Subpackages

data welltestpy subpackage providing datastructures.
estimate welltestpy subpackage providing routines to estimate pump test parameters.
process welltestpy subpackage providing routines to pre process test data.
tools welltestpy subpackage providing miscellaneous tools.

Classes

Campaign classes

The following classes can be used to handle field campaigns.

Campaign(name[, fieldsite, wells, tests, …]) Class for a well based campaign.
FieldSite(name[, description, coordinates]) Class for a field site.
Field Test classes

The following classes can be used to handle field test within a campaign.

PumpingTest(name, pumpingwell, pumpingrate) Class for a pumping test.

Loading routines

Campaign related loading routines

load_campaign(cmpfile) Load a campaign from file.

welltestpy.data

welltestpy subpackage providing datastructures.

Subpackages

data_io welltestpy subpackage providing input-output routines.
varlib welltestpy subpackage providing flow datastructures for variables.
testslib welltestpy subpackage providing flow datastructures for tests on a fieldsite.
campaignlib Welltestpy subpackage providing flow datastructures for field-campaigns.

Classes

Campaign classes

The following classes can be used to handle field campaigns.

Campaign(name[, fieldsite, wells, tests, …]) Class for a well based campaign.
FieldSite(name[, description, coordinates]) Class for a field site.
Field Test classes

The following classes can be used to handle field test within a campaign.

PumpingTest(name, pumpingwell, pumpingrate) Class for a pumping test.
Variable classes
Variable(name, value[, symbol, units, …]) Class for a variable.
TimeVar(value[, symbol, units, description]) Variable class special for time series.
HeadVar(value[, symbol, units, description]) Variable class special for groundwater head.
TemporalVar([value]) Variable class for a temporal variable.
CoordinatesVar(lat, lon[, symbol, units, …]) Variable class special for coordinates.
Observation(name, observation[, time, …]) Class for a observation.
StdyObs(name, observation[, description]) Observation class special for steady observations.
DrawdownObs(name, observation, time[, …]) Observation class special for drawdown observations.
StdyHeadObs(name, observation[, description]) Observation class special for steady drawdown observations.
Well(name, radius, coordinates[, welldepth, …]) Class for a pumping-/observation-well.

Routines

Loading routines

Campaign related loading routines

load_campaign(cmpfile) Load a campaign from file.
load_fieldsite(fdsfile) Load a field site from file.

Field test related loading routines

load_test(tstfile) Load a test from file.

Variable related loading routines

load_var(varfile) Load a variable from file.
load_obs(obsfile) Load an observation from file.
load_well(welfile) Load a well from file.

welltestpy.data.data_io

welltestpy subpackage providing input-output routines.

The following functions are provided

load_campaign(cmpfile)[source]

Load a campaign from file.

This reads a campaign from a csv file.

Parameters:cmpfile (str) – Path to the file
load_fieldsite(fdsfile)[source]

Load a field site from file.

This reads a field site from a csv file.

Parameters:fdsfile (str) – Path to the file
load_obs(obsfile)[source]

Load an observation from file.

This reads a observation from a csv file.

Parameters:obsfile (str) – Path to the file
load_test(tstfile)[source]

Load a test from file.

This reads a test from a csv file.

Parameters:tstfile (str) – Path to the file
load_var(varfile)[source]

Load a variable from file.

This reads a variable from a csv file.

Parameters:varfile (str) – Path to the file
load_well(welfile)[source]

Load a well from file.

This reads a well from a csv file.

Parameters:welfile (str) – Path to the file
save_campaign(campaign, path='', name=None)[source]

Save the campaign to file.

This writes the campaign to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Cmp_"+name. Default: None

Notes

The file will get the suffix ".cmp".

save_fieldsite(fieldsite, path='', name=None)[source]

Save a field site to file.

This writes the field site to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Field_"+name. Default: None

Notes

The file will get the suffix ".fds".

save_obs(obs, path='', name=None)[source]

Save an observation to file.

This writes the observation to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Obs_"+name. Default: None

Notes

The file will get the suffix ".obs".

save_pumping_test(pump_test, path='', name=None)[source]

Save a pumping test to file.

This writes the variable to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Test_"+name. Default: None

Notes

The file will get the suffix ".tst".

save_var(var, path='', name=None)[source]

Save a variable to file.

This writes the variable to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Var_"+name. Default: None

Notes

The file will get the suffix ".var".

save_well(well, path='', name=None)[source]

Save a well to file.

This writes the variable to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Well_"+name. Default: None

Notes

The file will get the suffix ".wel".

welltestpy.data.varlib

welltestpy subpackage providing flow datastructures for variables.

The following classes and functions are provided

Variable(name, value[, symbol, units, …]) Class for a variable.
TimeVar(value[, symbol, units, description]) Variable class special for time series.
HeadVar(value[, symbol, units, description]) Variable class special for groundwater head.
TemporalVar([value]) Variable class for a temporal variable.
CoordinatesVar(lat, lon[, symbol, units, …]) Variable class special for coordinates.
Observation(name, observation[, time, …]) Class for a observation.
StdyObs(name, observation[, description]) Observation class special for steady observations.
DrawdownObs(name, observation, time[, …]) Observation class special for drawdown observations.
StdyHeadObs(name, observation[, description]) Observation class special for steady drawdown observations.
TimeSeries(name, values, time[, description]) Time series obeservation.
Well(name, radius, coordinates[, welldepth, …]) Class for a pumping-/observation-well.
class Variable(name, value, symbol='x', units='-', description='no description')[source]

Bases: object

Class for a variable.

This is a class for a physical variable which is either a scalar or an array.

It has a name, a value, a symbol, a unit and a descrition string.

Parameters:
  • name (str) – Name of the Variable.
  • value (int or float or numpy.ndarray) – Value of the Variable.
  • symbole (str, optional) – Name of the Variable. Default: "x"
  • units (str, optional) – Units of the Variable. Default: "-"
  • description (str, optional) – Description of the Variable. Default: "no description"
Attributes:
info

str: Info about the Variable.

label

str: String containing: symbol in units.

scalar

bool: State if the variable is of scalar type.

value

int or float or numpy.ndarray: Value.

Methods

__call__([value]) Call a variable.
save([path, name]) Save a variable to file.
__call__(value=None)[source]

Call a variable.

Here you can set a new value or you can get the value of the variable.

Parameters:
Returns:

value – Value of the Variable.

Return type:

int or float or numpy.ndarray

save(path='', name=None)[source]

Save a variable to file.

This writes the variable to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Var_"+name. Default: None

Notes

The file will get the suffix ".var".

info

Info about the Variable.

Type:str
label

symbol in units.

Type:str
Type:String containing
scalar

State if the variable is of scalar type.

Type:bool
value

Value.

Type:int or float or numpy.ndarray
class TimeVar(value, symbol='t', units='s', description='time given in seconds')[source]

Bases: welltestpy.data.varlib.Variable

Variable class special for time series.

Parameters:
  • value (int or float or numpy.ndarray) – Value of the Variable.
  • symbole (str, optional) – Name of the Variable. Default: "t"
  • units (str, optional) – Units of the Variable. Default: "s"
  • description (str, optional) – Description of the Variable. Default: "time given in seconds"

Notes

Here the variable should be at most 1 dimensional and the name is fix set to "time".

Attributes:
info

str: Info about the Variable.

label

str: String containing: symbol in units.

scalar

bool: State if the variable is of scalar type.

value

int or float or numpy.ndarray: Value.

Methods

__call__([value]) Call a variable.
save([path, name]) Save a variable to file.
class HeadVar(value, symbol='h', units='m', description='head given in meters')[source]

Bases: welltestpy.data.varlib.Variable

Variable class special for groundwater head.

Parameters:
  • value (int or float or numpy.ndarray) – Value of the Variable.
  • symbole (str, optional) – Name of the Variable. Default: "h"
  • units (str, optional) – Units of the Variable. Default: "m"
  • description (str, optional) – Description of the Variable. Default: "head given in meters"

Notes

Here the variable name is fix set to "head".

Attributes:
info

str: Info about the Variable.

label

str: String containing: symbol in units.

scalar

bool: State if the variable is of scalar type.

value

int or float or numpy.ndarray: Value.

Methods

__call__([value]) Call a variable.
save([path, name]) Save a variable to file.
class TemporalVar(value=0.0)[source]

Bases: welltestpy.data.varlib.Variable

Variable class for a temporal variable.

Parameters:
Attributes:
info

str: Info about the Variable.

label

str: String containing: symbol in units.

scalar

bool: State if the variable is of scalar type.

value

int or float or numpy.ndarray: Value.

Methods

__call__([value]) Call a variable.
save([path, name]) Save a variable to file.
class CoordinatesVar(lat, lon, symbol='[Lat, Lon]', units='[deg, deg]', description='Coordinates given in degree-North and degree-East')[source]

Bases: welltestpy.data.varlib.Variable

Variable class special for coordinates.

Parameters:
  • lat (int or float or numpy.ndarray) – Lateral values of the coordinates.
  • lon (int or float or numpy.ndarray) – Longitutional values of the coordinates.
  • symbole (str, optional) – Name of the Variable. Default: "[Lat,Lon]"
  • units (str, optional) – Units of the Variable. Default: "[deg,deg]"
  • description (str, optional) – Description of the Variable. Default: "Coordinates given in degree-North and degree-East"

Notes

Here the variable name is fix set to "coordinates".

lat and lon should have the same shape.

Attributes:
info

str: Info about the Variable.

label

str: String containing: symbol in units.

scalar

bool: State if the variable is of scalar type.

value

int or float or numpy.ndarray: Value.

Methods

__call__([value]) Call a variable.
save([path, name]) Save a variable to file.
class Observation(name, observation, time=None, description='Observation')[source]

Bases: object

Class for a observation.

This is a class for time-dependent observations. It has a name and a descrition.

Parameters:
  • name (str) – Name of the Variable.
  • observation (Variable) – Name of the Variable. Default: "x"
  • time (Variable) – Value of the Variable.
  • description (str, optional) – Description of the Variable. Default: "Observation"
Attributes:
info

Get informations about the observation.

kind

str: name of the observation variable.

label

[tuple of] str: symbol in units.

labels

[tuple of] str: symbol in units.

observation

Observed values of the observation.

state

str: String containing state of the observation.

time

Time values of the observation.

units

[tuple of] str: units of the observation.

value

Value of the Observation.

Methods

__call__([observation, time]) Call a variable.
reshape() Reshape obeservations to flat array.
save([path, name]) Save an observation to file.
__call__(observation=None, time=None)[source]

Call a variable.

Here you can set a new value or you can get the value of the variable.

Parameters:
Returns:

reshape()[source]

Reshape obeservations to flat array.

save(path='', name=None)[source]

Save an observation to file.

This writes the observation to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Obs_"+name. Default: None

Notes

The file will get the suffix ".obs".

info

Get informations about the observation.

Here you can display informations about the observation.

kind

name of the observation variable.

Type:str
label

symbol in units.

Type:[tuple of] str
labels

symbol in units.

Type:[tuple of] str
observation

Observed values of the observation.

int or float or numpy.ndarray

state

String containing state of the observation.

Either "steady" or "transient".

Type:str
time

Time values of the observation.

int or float or numpy.ndarray

units

units of the observation.

Type:[tuple of] str
value

Value of the Observation.

[tuple of] int or float or numpy.ndarray

class StdyObs(name, observation, description='Steady observation')[source]

Bases: welltestpy.data.varlib.Observation

Observation class special for steady observations.

Parameters:
  • name (str) – Name of the Variable.
  • observation (Variable) – Name of the Variable. Default: "x"
  • description (str, optional) – Description of the Variable. Default: "Steady observation"
Attributes:
info

Get informations about the observation.

kind

str: name of the observation variable.

label

[tuple of] str: symbol in units.

labels

[tuple of] str: symbol in units.

observation

Observed values of the observation.

state

str: String containing state of the observation.

time

Time values of the observation.

units

[tuple of] str: units of the observation.

value

Value of the Observation.

Methods

__call__([observation, time]) Call a variable.
reshape() Reshape obeservations to flat array.
save([path, name]) Save an observation to file.
class DrawdownObs(name, observation, time, description='Drawdown observation')[source]

Bases: welltestpy.data.varlib.Observation

Observation class special for drawdown observations.

Parameters:
  • name (str) – Name of the Variable.
  • observation (Variable) – Observation.
  • time (Variable) – Time points of observation.
  • description (str, optional) – Description of the Variable. Default: "Drawdown observation"
Attributes:
info

Get informations about the observation.

kind

str: name of the observation variable.

label

[tuple of] str: symbol in units.

labels

[tuple of] str: symbol in units.

observation

Observed values of the observation.

state

str: String containing state of the observation.

time

Time values of the observation.

units

[tuple of] str: units of the observation.

value

Value of the Observation.

Methods

__call__([observation, time]) Call a variable.
reshape() Reshape obeservations to flat array.
save([path, name]) Save an observation to file.
class StdyHeadObs(name, observation, description='Steady State Drawdown observation')[source]

Bases: welltestpy.data.varlib.Observation

Observation class special for steady drawdown observations.

Parameters:
  • name (str) – Name of the Variable.
  • observation (Variable) – Observation.
  • description (str, optional) – Description of the Variable. Default: "Steady observation"
Attributes:
info

Get informations about the observation.

kind

str: name of the observation variable.

label

[tuple of] str: symbol in units.

labels

[tuple of] str: symbol in units.

observation

Observed values of the observation.

state

str: String containing state of the observation.

time

Time values of the observation.

units

[tuple of] str: units of the observation.

value

Value of the Observation.

Methods

__call__([observation, time]) Call a variable.
reshape() Reshape obeservations to flat array.
save([path, name]) Save an observation to file.
class TimeSeries(name, values, time, description='Timeseries.')[source]

Bases: welltestpy.data.varlib.Observation

Time series obeservation.

Parameters:
  • name (str) – Name of the Variable.
  • values (Variable) – Values of the time-series.
  • time (Variable) – Time points of the time-series.
  • description (str, optional) – Description of the Variable. Default: "Timeseries."
Attributes:
info

Get informations about the observation.

kind

str: name of the observation variable.

label

[tuple of] str: symbol in units.

labels

[tuple of] str: symbol in units.

observation

Observed values of the observation.

state

str: String containing state of the observation.

time

Time values of the observation.

units

[tuple of] str: units of the observation.

value

Value of the Observation.

Methods

__call__([observation, time]) Call a variable.
reshape() Reshape obeservations to flat array.
save([path, name]) Save an observation to file.
class Well(name, radius, coordinates, welldepth=1.0, aquiferdepth=None)[source]

Bases: object

Class for a pumping-/observation-well.

This is a class for a well within a aquifer-testing campaign.

It has a name, a radius, coordinates and a depth.

Parameters:
  • name (str) – Name of the Variable.
  • radius (Variable or float) – Value of the Variable.
  • coordinates (Variable or numpy.ndarray) – Value of the Variable.
  • welldepth (Variable or float, optional) – Depth of the well. Default: 1.0
  • aquiferdepth (Variable or float, optional) – Depth of the aquifer at the well. Default: "None"

Notes

You can calculate the distance between two wells w1 and w2 by simply calculating the difference w1 - w2.

Attributes:
aquiferdepth

float: Aquifer depth at the well.

coordinates

numpy.ndarray: Coordinates variable of the well.

depth

float: Depth of the well.

info

Get informations about the variable.

pos

numpy.ndarray: Position of the well.

radius

float: Radius of the well.

welldepth

float: Depth variable of the well.

wellradius

float: Radius variable of the well.

Methods

distance(well) Calculate distance to the well.
save([path, name]) Save a well to file.
distance(well)[source]

Calculate distance to the well.

Parameters:well (Well or tuple of float) – Coordinates to calculate the distance to or another well.
save(path='', name=None)[source]

Save a well to file.

This writes the variable to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Well_"+name. Default: None

Notes

The file will get the suffix ".wel".

aquiferdepth

Aquifer depth at the well.

Type:float
coordinates

Coordinates variable of the well.

Type:numpy.ndarray
depth

Depth of the well.

Type:float
info

Get informations about the variable.

Here you can display informations about the variable.

pos

Position of the well.

Type:numpy.ndarray
radius

Radius of the well.

Type:float
welldepth

Depth variable of the well.

Type:float
wellradius

Radius variable of the well.

Type:float

welltestpy.data.testslib

welltestpy subpackage providing flow datastructures for tests on a fieldsite.

The following classes and functions are provided

Test(name[, description, timeframe]) General class for a well based test.
PumpingTest(name, pumpingwell, pumpingrate) Class for a pumping test.
class Test(name, description='no description', timeframe=None)[source]

Bases: object

General class for a well based test.

This is a class for a well based test on a field site. It has a name, a descrition and a timeframe string.

Parameters:
  • name (str) – Name of the test.
  • description (str, optional) – Description of the test. Default: "no description"
  • timeframe (str, optional) – Timeframe of the test. Default: None
Attributes:
testtype

str: String containing the test type.

Methods

plot(wells[, exclude, fig, ax]) Generate a plot of the pumping test.
plot(wells, exclude=None, fig=None, ax=None, **kwargs)[source]

Generate a plot of the pumping test.

This will plot the test on the given figure axes.

Parameters:
  • ax (Axes) – Axes where the plot should be done.
  • wells (dict) – Dictonary containing the well classes sorted by name.
  • exclude (list, optional) – List of wells that should be excluded from the plot. Default: None

Notes

This will be used by the Campaign class.

testtype

String containing the test type.

Type:str
class PumpingTest(name, pumpingwell, pumpingrate, observations=None, aquiferdepth=1.0, aquiferradius=inf, description='Pumpingtest', timeframe=None)[source]

Bases: welltestpy.data.testslib.Test

Class for a pumping test.

This is a class for a pumping test on a field site. It has a name, a descrition, a timeframe and a pumpingwell string.

Parameters:
  • name (str) – Name of the test.
  • pumpingwell (str) – Pumping well of the test.
  • pumpingrate (float or Variable) – Pumping rate of at the pumping well. If a float is given, it is assumed to be given in m^3/s.
  • observations (dict, optional) – Observations made within the pumping test. The dict-keys are the well names of the observation wells or the pumpingwell. Values need to be an instance of Observation Default: None
  • aquiferdepth (float or Variable, optional) – Aquifer depth at the field site. If a float is given, it is assumed to be given in m. Default: 1.0
  • aquiferradius (float or Variable, optional) – Aquifer radius ot the field site. If a float is given, it is assumed to be given in m. Default: inf
  • description (str, optional) – Description of the test. Default: "Pumpingtest"
  • timeframe (str, optional) – Timeframe of the test. Default: None
Attributes:
aquiferdepth

float: aquifer depth at the field site.

aquiferradius

float: aquifer radius at the field site.

constant_rate

bool: state if this is a constant rate test.

depth

float: aquifer depth at the field site.

observations

dict: observations made at the field site.

observationwells

tuple of str: all well names.

pumpingrate

float: pumping rate variable at the pumping well.

radius

float: aquifer radius at the field site.

rate

float: pumping rate at the pumping well.

testtype

str: String containing the test type.

wells

tuple of str: all well names.

Methods

add_observations(obs) Add some specified observations.
add_steady_obs(well, observation[, description]) Add steady drawdown observations.
add_transient_obs(well, time, observation[, …]) Add transient drawdown observations.
del_observations(obs) Delete some specified observations.
make_steady([time]) Convert the pumping test to a steady state test.
plot(wells[, exclude, fig, ax]) Generate a plot of the pumping test.
save([path, name]) Save a pumping test to file.
state([wells]) Get the state of observation.
add_observations(obs)[source]

Add some specified observations.

Parameters:obs (dict, list, Observation) – Observations to be added.
add_steady_obs(well, observation, description='Steady State Drawdown observation')[source]

Add steady drawdown observations.

Parameters:
  • well (str) – well where the observation is made.
  • observation (Variable) – Observation.
  • description (str, optional) – Description of the Variable. Default: "Steady observation"
add_transient_obs(well, time, observation, description='Transient Drawdown observation')[source]

Add transient drawdown observations.

Parameters:
  • well (str) – well where the observation is made.
  • time (Variable) – Time points of observation.
  • observation (Variable) – Observation.
  • description (str, optional) – Description of the Variable. Default: "Drawdown observation"
del_observations(obs)[source]

Delete some specified observations.

This will delete observations from the pumping test. You can give a list of observations or a single observation by name.

Parameters:obs (list of str or str) – Observations to be deleted.
make_steady(time='latest')[source]

Convert the pumping test to a steady state test.

Parameters:time (str or float, optional) – Selected time point for steady state. If “latest”, the latest common time point is used. If None, it takes the last observation per well. If float, it will be interpolated. Default: “latest”
plot(wells, exclude=None, fig=None, ax=None, **kwargs)[source]

Generate a plot of the pumping test.

This will plot the pumping test on the given figure axes.

Parameters:
  • ax (Axes) – Axes where the plot should be done.
  • wells (dict) – Dictonary containing the well classes sorted by name.
  • exclude (list, optional) – List of wells that should be excluded from the plot. Default: None

Notes

This will be used by the Campaign class.

save(path='', name=None)[source]

Save a pumping test to file.

This writes the variable to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Test_"+name. Default: None

Notes

The file will get the suffix ".tst".

state(wells=None)[source]

Get the state of observation.

Either None, “steady”, “transient” or “mixed”.

Parameters:wells (list, optional) – List of wells, to check the observation state at. Default: all
aquiferdepth

aquifer depth at the field site.

Type:float
aquiferradius

aquifer radius at the field site.

Type:float
constant_rate

state if this is a constant rate test.

Type:bool
depth

aquifer depth at the field site.

Type:float
observations

observations made at the field site.

Type:dict
observationwells

all well names.

Type:tuple of str
pumpingrate

pumping rate variable at the pumping well.

Type:float
radius

aquifer radius at the field site.

Type:float
rate

pumping rate at the pumping well.

Type:float
wells

all well names.

Type:tuple of str

welltestpy.data.campaignlib

Welltestpy subpackage providing flow datastructures for field-campaigns.

The following classes and functions are provided

FieldSite(name[, description, coordinates]) Class for a field site.
Campaign(name[, fieldsite, wells, tests, …]) Class for a well based campaign.
class FieldSite(name, description='Field site', coordinates=None)[source]

Bases: object

Class for a field site.

This is a class for a field site. It has a name and a descrition.

Parameters:
  • name (str) – Name of the field site.
  • description (str, optional) – Description of the field site. Default: "no description"
  • coordinates (Variable, optional) – Coordinates of the field site (lat, lon). Default: None
Attributes:
coordinates

numpy.ndarray: Coordinates of the field site.

info

str: Info about the field site.

pos

numpy.ndarray: Position of the field site.

Methods

save([path, name]) Save a field site to file.
save(path='', name=None)[source]

Save a field site to file.

This writes the field site to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Field_"+name. Default: None

Notes

The file will get the suffix ".fds".

coordinates

Coordinates of the field site.

Type:numpy.ndarray
info

Info about the field site.

Type:str
pos

Position of the field site.

Type:numpy.ndarray
class Campaign(name, fieldsite='Fieldsite', wells=None, tests=None, timeframe=None, description='Welltest campaign')[source]

Bases: object

Class for a well based campaign.

This is a class for a well based test campaign on a field site. It has a name, a descrition and a timeframe.

Parameters:
  • name (str) – Name of the campaign.
  • fieldsite (str or Variable, optional) – The field site. Default: "Fieldsite"
  • wells (dict, optional) – The wells within the fild site. Keys are the well names and values are an instance of Well. Default: None
  • wells – The tests within the campaign. Keys are the test names and values are an instance of Test. Default: None
  • timeframe (str, optional) – Timeframe of the campaign. Default: None
  • description (str, optional) – Description of the field site. Default: "Welltest campaign"
Attributes:
fieldsite

FieldSite: Field site where the campaign was realised.

tests

dict: Tests within the campaign.

wells

dict: Wells within the campaign.

Methods

add_well(name, radius, coordinates[, …]) Add a single well to the campaign.
addtests(tests) Add some specified tests.
addwells(wells) Add some specified wells.
deltests(tests) Delete some specified tests.
delwells(wells) Delete some specified wells.
plot([select_tests]) Generate a plot of the tests within the campaign.
plot_wells(**kwargs) Generate a plot of the wells within the campaign.
save([path, name]) Save the campaign to file.
add_well(name, radius, coordinates, welldepth=1.0, aquiferdepth=None)[source]

Add a single well to the campaign.

Parameters:
  • name (str) – Name of the Variable.
  • radius (Variable or float) – Value of the Variable.
  • coordinates (Variable or numpy.ndarray) – Value of the Variable.
  • welldepth (Variable or float, optional) – Depth of the well. Default: 1.0
  • aquiferdepth (Variable or float, optional) – Depth of the aquifer at the well. Default: "None"
addtests(tests)[source]

Add some specified tests.

This will add tests to the campaign.

Parameters:tests (dict) – Tests to be added.
addwells(wells)[source]

Add some specified wells.

This will add wells to the campaign.

Parameters:wells (dict) – Wells to be added.
deltests(tests)[source]

Delete some specified tests.

This will delete tests from the campaign. You can give a list of tests or a single test by name.

Parameters:tests (list of str or str) – Tests to be deleted.
delwells(wells)[source]

Delete some specified wells.

This will delete wells from the campaign. You can give a list of wells or a single well by name.

Parameters:wells (list of str or str) – Wells to be deleted.
plot(select_tests=None, **kwargs)[source]

Generate a plot of the tests within the campaign.

This will plot an overview of the tests within the campaign.

Parameters:
  • select_tests (list, optional) – Tests that should be plotted. If None, all will be displayed. Default: None
  • **kwargs – Keyword-arguments forwarded to campaign_plot
plot_wells(**kwargs)[source]

Generate a plot of the wells within the campaign.

This will plot an overview of the wells within the campaign.

Parameters:**kwargs – Keyword-arguments forwarded to campaign_well_plot.
save(path='', name=None)[source]

Save the campaign to file.

This writes the campaign to a csv file.

Parameters:
  • path (str, optional) – Path where the variable should be saved. Default: ""
  • name (str, optional) – Name of the file. If None, the name will be generated by "Cmp_"+name. Default: None

Notes

The file will get the suffix ".cmp".

fieldsite

Field site where the campaign was realised.

Type:FieldSite
tests

Tests within the campaign.

Type:dict
wells

Wells within the campaign.

Type:dict

welltestpy.estimate

welltestpy subpackage providing routines to estimate pump test parameters.

Estimators

The following estimators are provided

ExtTheis3D(name, campaign[, val_ranges, …]) Class for an estimation of stochastic subsurface parameters.
ExtTheis2D(name, campaign[, val_ranges, …]) Class for an estimation of stochastic subsurface parameters.
Neuman2004(name, campaign[, val_ranges, …]) Class for an estimation of stochastic subsurface parameters.
Theis(name, campaign[, val_ranges, val_fix, …]) Class for an estimation of homogeneous subsurface parameters.
ExtThiem3D(name, campaign[, make_steady, …]) Class for an estimation of stochastic subsurface parameters.
ExtThiem2D(name, campaign[, make_steady, …]) Class for an estimation of stochastic subsurface parameters.
Neuman2004Steady(name, campaign[, …]) Class for an estimation of stochastic subsurface parameters.
Thiem(name, campaign[, make_steady, …]) Class for an estimation of homogeneous subsurface parameters.

Base Classes

Transient

All transient estimators are derived from the following class

TransientPumping(name, campaign, type_curve, …) Class to estimate transient Type-Curve parameters.
Steady Pumping

All steady estimators are derived from the following class

SteadyPumping(name, campaign, type_curve, …) Class to estimate steady Type-Curve parameters.
class ExtTheis3D(name, campaign, val_ranges=None, val_fix=None, testinclude=None, generate=False)[source]

Bases: welltestpy.estimate.transient_lib.TransientPumping

Class for an estimation of stochastic subsurface parameters.

With this class you can run an estimation of statistical subsurface parameters. It utilizes the extended theis solution in 3D which assumes a log-normal distributed transmissivity field with a gaussian correlation function and an anisotropy ratio 0 < e <= 1.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown at given time points.
gen_setup([prate_kw, rad_kw, time_kw, dummy]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
settime([time, tmin, tmax, typ, steps]) Set uniform time points for the observations.
class ExtTheis2D(name, campaign, val_ranges=None, val_fix=None, testinclude=None, generate=False)[source]

Bases: welltestpy.estimate.transient_lib.TransientPumping

Class for an estimation of stochastic subsurface parameters.

With this class you can run an estimation of statistical subsurface parameters. It utilizes the extended theis solution in 2D which assumes a log-normal distributed transmissivity field with a gaussian correlation function.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown at given time points.
gen_setup([prate_kw, rad_kw, time_kw, dummy]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
settime([time, tmin, tmax, typ, steps]) Set uniform time points for the observations.
class Neuman2004(name, campaign, val_ranges=None, val_fix=None, testinclude=None, generate=False)[source]

Bases: welltestpy.estimate.transient_lib.TransientPumping

Class for an estimation of stochastic subsurface parameters.

With this class you can run an estimation of statistical subsurface parameters. It utilizes the apparent Transmissivity from Neuman 2004 which assumes a log-normal distributed transmissivity field with an exponential correlation function.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown at given time points.
gen_setup([prate_kw, rad_kw, time_kw, dummy]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
settime([time, tmin, tmax, typ, steps]) Set uniform time points for the observations.
class Theis(name, campaign, val_ranges=None, val_fix=None, testinclude=None, generate=False)[source]

Bases: welltestpy.estimate.transient_lib.TransientPumping

Class for an estimation of homogeneous subsurface parameters.

With this class you can run an estimation of homogeneous subsurface parameters. It utilizes the theis solution.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown at given time points.
gen_setup([prate_kw, rad_kw, time_kw, dummy]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
settime([time, tmin, tmax, typ, steps]) Set uniform time points for the observations.
class ExtThiem3D(name, campaign, make_steady=True, val_ranges=None, val_fix=None, testinclude=None, generate=False)[source]

Bases: welltestpy.estimate.steady_lib.SteadyPumping

Class for an estimation of stochastic subsurface parameters.

With this class you can run an estimation of statistical subsurface parameters. It utilizes the extended thiem solution in 3D which assumes a log-normal distributed transmissivity field with a gaussian correlation function and an anisotropy ratio 0 < e <= 1.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • make_steady (bool, optional) – State if the tests should be converted to steady observations. See: PumpingTest.make_steady. Default: True
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown.
gen_setup([prate_kw, rad_kw, r_ref_kw, …]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
class ExtThiem2D(name, campaign, make_steady=True, val_ranges=None, val_fix=None, testinclude=None, generate=False)[source]

Bases: welltestpy.estimate.steady_lib.SteadyPumping

Class for an estimation of stochastic subsurface parameters.

With this class you can run an estimation of statistical subsurface parameters. It utilizes the extended thiem solution in 2D which assumes a log-normal distributed transmissivity field with a gaussian correlation function.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • make_steady (bool, optional) – State if the tests should be converted to steady observations. See: PumpingTest.make_steady. Default: True
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown.
gen_setup([prate_kw, rad_kw, r_ref_kw, …]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
class Neuman2004Steady(name, campaign, make_steady=True, val_ranges=None, val_fix=None, testinclude=None, generate=False)[source]

Bases: welltestpy.estimate.steady_lib.SteadyPumping

Class for an estimation of stochastic subsurface parameters.

With this class you can run an estimation of statistical subsurface parameters from steady drawdown. It utilizes the apparent Transmissivity from Neuman 2004 which assumes a log-normal distributed transmissivity field with an exponential correlation function.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • make_steady (bool, optional) – State if the tests should be converted to steady observations. See: PumpingTest.make_steady. Default: True
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown.
gen_setup([prate_kw, rad_kw, r_ref_kw, …]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
class Thiem(name, campaign, make_steady=True, val_ranges=None, val_fix=None, testinclude=None, generate=False)[source]

Bases: welltestpy.estimate.steady_lib.SteadyPumping

Class for an estimation of homogeneous subsurface parameters.

With this class you can run an estimation of homogeneous subsurface parameters. It utilizes the thiem solution.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • make_steady (bool, optional) – State if the tests should be converted to steady observations. See: PumpingTest.make_steady. Default: True
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown.
gen_setup([prate_kw, rad_kw, r_ref_kw, …]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
class TransientPumping(name, campaign, type_curve, val_ranges, val_fix=None, fit_type=None, val_kw_names=None, val_plot_names=None, testinclude=None, generate=False)[source]

Bases: object

Class to estimate transient Type-Curve parameters.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • type_curve (callable) – The given type-curve. Output will be reshaped to flat array.
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • fit_type (dict or None) – Dictionary containing fitting type for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. fit_type can be “lin”, “log” (np.exp(val) will be used) or a callable function. By default, values will be fit linearly. Default: None
  • val_kw_names (dict or None) –

    Dictionary containing keyword names in the type-curve for each value.

    {value-name: kwargs-name in type_curve}

    This is usefull if fitting is not done by linear values. By default, parameter names will be value names. Default: None

  • val_plot_names (dict or None) –

    Dictionary containing keyword names in the type-curve for each value.

    {value-name: string for plot legend}

    This is usefull to get better plots. By default, parameter names will be value names. Default: None

  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown at given time points.
gen_setup([prate_kw, rad_kw, time_kw, dummy]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
settime([time, tmin, tmax, typ, steps]) Set uniform time points for the observations.
gen_data()[source]

Generate the observed drawdown at given time points.

It will also generate an array containing all radii of all well combinations.

gen_setup(prate_kw='rate', rad_kw='rad', time_kw='time', dummy=False)[source]

Generate the Spotpy Setup.

Parameters:
  • prate_kw (str, optional) – Keyword name for the pumping rate in the used type curve. Default: “rate”
  • rad_kw (str, optional) – Keyword name for the radius in the used type curve. Default: “rad”
  • time_kw (str, optional) – Keyword name for the time in the used type curve. Default: “time”
  • dummy (bool, optional) – Add a dummy parameter to the model. This could be used to equalize sensitivity analysis. Default: False
run(rep=5000, parallel='seq', run=True, folder=None, dbname=None, traceplotname=None, fittingplotname=None, interactplotname=None, estname=None, plot_style='WTP')[source]

Run the estimation.

Parameters:
  • rep (int, optional) – The number of repetitions within the SCEua algorithm in spotpy. Default: 5000
  • parallel (str, optional) –

    State if the estimation should be run in parallel or not. Options:

    • "seq": sequential on one CPU
    • "mpi": use the mpi4py package

    Default: "seq"

  • run (bool, optional) – State if the estimation should be executed. Otherwise all plots will be done with the previous results. Default: True
  • folder (str, optional) – Path to the output folder. If None the CWD is used. Default: None
  • dbname (str, optional) – File-name of the database of the spotpy estimation. If None, it will be the current time + "_db". Default: None
  • traceplotname (str, optional) – File-name of the parameter trace plot of the spotpy estimation. If None, it will be the current time + "_paratrace.pdf". Default: None
  • fittingplotname (str, optional) – File-name of the fitting plot of the estimation. If None, it will be the current time + "_fit.pdf". Default: None
  • interactplotname (str, optional) – File-name of the parameter interaction plot of the spotpy estimation. If None, it will be the current time + "_parainteract.pdf". Default: None
  • estname (str, optional) – File-name of the results of the spotpy estimation. If None, it will be the current time + "_estimate". Default: None
  • plot_style (str, optional) – Plot stlye. The default is “WTP”.
sensitivity(rep=None, parallel='seq', folder=None, dbname=None, plotname=None, traceplotname=None, sensname=None, plot_style='WTP')[source]

Run the sensitivity analysis.

Parameters:
  • rep (int, optional) – The number of repetitions within the FAST algorithm in spotpy. Default: estimated
  • parallel (str, optional) –

    State if the estimation should be run in parallel or not. Options:

    • "seq": sequential on one CPU
    • "mpi": use the mpi4py package

    Default: "seq"

  • folder (str, optional) – Path to the output folder. If None the CWD is used. Default: None
  • dbname (str, optional) – File-name of the database of the spotpy estimation. If None, it will be the current time + "_sensitivity_db". Default: None
  • plotname (str, optional) – File-name of the result plot of the sensitivity analysis. If None, it will be the current time + "_sensitivity.pdf". Default: None
  • traceplotname (str, optional) – File-name of the parameter trace plot of the spotpy sensitivity analysis. If None, it will be the current time + "_senstrace.pdf". Default: None
  • sensname (str, optional) – File-name of the results of the FAST estimation. If None, it will be the current time + "_estimate". Default: None
  • plot_style (str, optional) – Plot stlye. The default is “WTP”.
setpumprate(prate=-1.0)[source]

Set a uniform pumping rate at all pumpingwells wells.

We assume linear scaling by the pumpingrate.

Parameters:prate (float, optional) – Pumping rate. Default: -1.0
settime(time=None, tmin=10.0, tmax=inf, typ='quad', steps=10)[source]

Set uniform time points for the observations.

Parameters:
  • time (numpy.ndarray, optional) – Array of specified time points. If None is given, they will be determind by the observation data. Default: None
  • tmin (float, optional) – Minimal time value. It will set a minimal value of 10s. Default: 10
  • tmax (float, optional) – Maximal time value. Default: inf
  • typ (str or float, optional) –

    Typ of the time selection. You can select from:

    • "exp": for exponential behavior
    • "log": for logarithmic behavior
    • "geo": for geometric behavior
    • "lin": for linear behavior
    • "quad": for quadratic behavior
    • "cub": for cubic behavior
    • float: here you can specifi any exponent (“quad” would be equivalent to 2)

    Default: “quad”

  • steps (int, optional) – Number of generated time steps. Default: 10
campaign = None

Copy of the input campaign to be modified

Type:welltestpy.data.Campaign
campaign_raw = None

Copy of the original input campaign

Type:welltestpy.data.Campaign
data = None

observation data

Type:numpy.ndarray
estimated_para = None

estimated parameters by name

Type:dict
name = None

Name of the Estimation

Type:str
prate = None

Pumpingrate at the pumping well

Type:float
rad = None

array of the radii from the wells

Type:numpy.ndarray
radnames = None

names of the radii well combination

Type:numpy.ndarray
result = None

result of the spotpy estimation

Type:list
rinf = None

radius of the furthest wells

Type:float
rwell = None

radius of the pumping wells

Type:float
sens = None

result of the spotpy sensitivity analysis

Type:dict
setup_kw = None

TypeCurve Spotpy Setup definition

Type:dict
testinclude = None

dictonary of which tests should be included

Type:dict
time = None

time points of the observation

Type:numpy.ndarray
class SteadyPumping(name, campaign, type_curve, val_ranges, make_steady=True, val_fix=None, fit_type=None, val_kw_names=None, val_plot_names=None, testinclude=None, generate=False)[source]

Bases: object

Class to estimate steady Type-Curve parameters.

Parameters:
  • name (str) – Name of the Estimation.
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used to estimate the paramters
  • type_curve (callable) – The given type-curve. Output will be reshaped to flat array.
  • val_ranges (dict) – Dictionary containing the fit-ranges for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Ranges should be a tuple containing min and max value.
  • make_steady (bool, optional) – State if the tests should be converted to steady observations. See: PumpingTest.make_steady. Default: True
  • val_fix (dict or None) – Dictionary containing fixed values for the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. Default: None
  • fit_type (dict or None) – Dictionary containing fitting type for each value in the type-curve. Names should be as in the type-curve signiture or replaced in val_kw_names. fit_type can be “lin”, “log” (np.exp(val) will be used) or a callable function. By default, values will be fit linearly. Default: None
  • val_kw_names (dict or None) –

    Dictionary containing keyword names in the type-curve for each value.

    {value-name: kwargs-name in type_curve}

    This is usefull if fitting is not done by linear values. By default, parameter names will be value names. Default: None

  • val_plot_names (dict or None) –

    Dictionary containing keyword names in the type-curve for each value.

    {value-name: string for plot legend}

    This is usefull to get better plots. By default, parameter names will be value names. Default: None

  • testinclude (dict, optional) – dictonary of which tests should be included. If None is given, all available tests are included. Default: None
  • generate (bool, optional) – State if time stepping, processed observation data and estimation setup should be generated with default values. Default: False

Methods

gen_data() Generate the observed drawdown.
gen_setup([prate_kw, rad_kw, r_ref_kw, …]) Generate the Spotpy Setup.
run([rep, parallel, run, folder, dbname, …]) Run the estimation.
sensitivity([rep, parallel, folder, dbname, …]) Run the sensitivity analysis.
setpumprate([prate]) Set a uniform pumping rate at all pumpingwells wells.
gen_data()[source]

Generate the observed drawdown.

It will also generate an array containing all radii of all well combinations.

gen_setup(prate_kw='rate', rad_kw='rad', r_ref_kw='r_ref', h_ref_kw='h_ref', dummy=False)[source]

Generate the Spotpy Setup.

Parameters:
  • prate_kw (str, optional) – Keyword name for the pumping rate in the used type curve. Default: “rate”
  • rad_kw (str, optional) – Keyword name for the radius in the used type curve. Default: “rad”
  • r_ref_kw (str, optional) – Keyword name for the reference radius in the used type curve. Default: “r_ref”
  • h_ref_kw (str, optional) – Keyword name for the reference head in the used type curve. Default: “h_ref”
  • dummy (bool, optional) – Add a dummy parameter to the model. This could be used to equalize sensitivity analysis. Default: False
run(rep=5000, parallel='seq', run=True, folder=None, dbname=None, traceplotname=None, fittingplotname=None, interactplotname=None, estname=None, plot_style='WTP')[source]

Run the estimation.

Parameters:
  • rep (int, optional) – The number of repetitions within the SCEua algorithm in spotpy. Default: 5000
  • parallel (str, optional) –

    State if the estimation should be run in parallel or not. Options:

    • "seq": sequential on one CPU
    • "mpi": use the mpi4py package

    Default: "seq"

  • run (bool, optional) – State if the estimation should be executed. Otherwise all plots will be done with the previous results. Default: True
  • folder (str, optional) – Path to the output folder. If None the CWD is used. Default: None
  • dbname (str, optional) – File-name of the database of the spotpy estimation. If None, it will be the current time + "_db". Default: None
  • traceplotname (str, optional) – File-name of the parameter trace plot of the spotpy estimation. If None, it will be the current time + "_paratrace.pdf". Default: None
  • fittingplotname (str, optional) – File-name of the fitting plot of the estimation. If None, it will be the current time + "_fit.pdf". Default: None
  • interactplotname (str, optional) – File-name of the parameter interaction plot of the spotpy estimation. If None, it will be the current time + "_parainteract.pdf". Default: None
  • estname (str, optional) – File-name of the results of the spotpy estimation. If None, it will be the current time + "_estimate". Default: None
  • plot_style (str, optional) – Plot stlye. The default is “WTP”.
sensitivity(rep=None, parallel='seq', folder=None, dbname=None, plotname=None, traceplotname=None, sensname=None, plot_style='WTP')[source]

Run the sensitivity analysis.

Parameters:
  • rep (int, optional) – The number of repetitions within the FAST algorithm in spotpy. Default: estimated
  • parallel (str, optional) –

    State if the estimation should be run in parallel or not. Options:

    • "seq": sequential on one CPU
    • "mpi": use the mpi4py package

    Default: "seq"

  • folder (str, optional) – Path to the output folder. If None the CWD is used. Default: None
  • dbname (str, optional) – File-name of the database of the spotpy estimation. If None, it will be the current time + "_sensitivity_db". Default: None
  • plotname (str, optional) – File-name of the result plot of the sensitivity analysis. If None, it will be the current time + "_sensitivity.pdf". Default: None
  • traceplotname (str, optional) – File-name of the parameter trace plot of the spotpy sensitivity analysis. If None, it will be the current time + "_senstrace.pdf". Default: None
  • sensname (str, optional) – File-name of the results of the FAST estimation. If None, it will be the current time + "_estimate". Default: None
  • plot_style (str, optional) – Plot stlye. The default is “WTP”.
setpumprate(prate=-1.0)[source]

Set a uniform pumping rate at all pumpingwells wells.

We assume linear scaling by the pumpingrate.

Parameters:prate (float, optional) – Pumping rate. Default: -1.0
campaign = None

Copy of the input campaign to be modified

Type:welltestpy.data.Campaign
campaign_raw = None

Copy of the original input campaign

Type:welltestpy.data.Campaign
data = None

observation data

Type:numpy.ndarray
estimated_para = None

estimated parameters by name

Type:dict
h_ref = None

reference head at the biggest distance

Type:float
name = None

Name of the Estimation

Type:str
prate = None

Pumpingrate at the pumping well

Type:float
r_ref = None

reference radius of the biggest distance

Type:float
rad = None

array of the radii from the wells

Type:numpy.ndarray
radnames = None

names of the radii well combination

Type:numpy.ndarray
result = None

result of the spotpy estimation

Type:list
rinf = None

radius of the furthest wells

Type:float
rwell = None

radius of the pumping wells

Type:float
sens = None

result of the spotpy sensitivity analysis

Type:dict
setup_kw = None

TypeCurve Spotpy Setup definition

Type:dict
testinclude = None

dictonary of which tests should be included

Type:dict

welltestpy.process

welltestpy subpackage providing routines to pre process test data.

Included functions

The following classes and functions are provided

normpumptest(pumptest[, pumpingrate, factor]) Normalize the pumping rate of a pumping test.
combinepumptest(campaign, test1, test2[, …]) Combine two pumping tests to one.
filterdrawdown(observation[, tout, dxscale]) Smooth the drawdown data of an observation well.
normpumptest(pumptest, pumpingrate=-1.0, factor=1.0)[source]

Normalize the pumping rate of a pumping test.

Parameters:
  • pumpingrate (float, optional) – Pumping rate. Default: -1.0
  • factor (float, optional) – Scaling factor that can be used for unit conversion. Default: 1.0
combinepumptest(campaign, test1, test2, pumpingrate=None, finalname=None, factor1=1.0, factor2=1.0, infooftest1=True, replace=True)[source]

Combine two pumping tests to one.

They need to have the same pumping well.

Parameters:
  • campaign (welltestpy.data.Campaign) – The pumping test campaign which should be used.
  • test1 (str) – Name of test 1.
  • test2 (str) – Name of test 2.
  • pumpingrate (float, optional) – Pumping rate. Default: -1.0
  • finalname (str, optional) – Name of the final test. If replace is True and finalname is None, it will get the name of test 1. Else it will get a combined name of test 1 and test 2. Default: None
  • factor1 (float, optional) – Scaling factor for test 1 that can be used for unit conversion. Default: 1.0
  • factor2 (float, optional) – Scaling factor for test 2 that can be used for unit conversion. Default: 1.0
  • infooftest1 (bool, optional) – State if the final test should take the information from test 1. Default: True
  • replace (bool, optional) – State if the original tests should be erased. Default: True
filterdrawdown(observation, tout=None, dxscale=2)[source]

Smooth the drawdown data of an observation well.

Parameters:
  • observation (welltestpy.data.Observation) – The observation to be smoothed.
  • tout (numpy.ndarray, optional) – Time points to evaluate the smoothed observation at. If None, the original time points of the observation are taken. Default: None
  • dxscale (int, optional) – Scale of time-steps used for smoothing. Default: 2

welltestpy.tools

welltestpy subpackage providing miscellaneous tools.

Included functions

The following functions are provided for point triangulation

triangulate(distances, prec[, all_pos]) Triangulate points by given distances.
sym(A) Get the symmetrized version of a lower or upper triangle-matrix A.

The following plotting routines are provided

campaign_plot(campaign[, select_test, fig, …]) Plot an overview of the tests within the campaign.
fadeline(ax, x, y[, label, color, steps]) Fading line for matplotlib.
plot_well_pos(well_const[, names, title, …]) Plot all well constellations and label the points with the names.
campaign_well_plot(campaign[, plot_tests, …]) Plot of the well constellation within the campaign.
plotfit_transient(setup, data, para, rad, …) Plot of transient estimation fitting.
plotfit_steady(setup, data, para, rad, …) Plot of steady estimation fitting.
plotparainteract(result, paranames[, …]) Plot of parameter interaction.
plotparatrace(result[, parameternames, …]) Plot of parameter trace.
plotsensitivity(paralabels, sensitivities[, …]) Plot of sensitivity results.
triangulate(distances, prec, all_pos=False)[source]

Triangulate points by given distances.

try to triangulate points by given distances within a symmetric matrix ‘distances’ with distances[i,j] = |pi-pj|

thereby p0 will be set to the origin (0,0) and p1 to (|p0-p1|,0)

Parameters:
  • distances (numpy.ndarray) –

    Given distances among the point to be triangulated. It hat to be a symmetric matrix with a vanishing diagonal and

    distances[i,j] = |pi-pj|

    If a distance is unknown, you can set it to -1.

  • prec (float) – Given Precision to be used within the algorithm. This can be used to smooth away messure errors
  • all_pos (bool, optional) – If True all possible constellations will be calculated. Otherwise, the first possibility will be returned. Default: False
sym(A)[source]

Get the symmetrized version of a lower or upper triangle-matrix A.

campaign_plot(campaign, select_test=None, fig=None, style='WTP', **kwargs)[source]

Plot an overview of the tests within the campaign.

Parameters:
  • campaign (Campaign) – The campaign to be plotted.
  • select_test (dict, optional) – The selected tests to be added to the plot. The default is None.
  • fig (Figure, optional) – Matplotlib figure to plot on. The default is None.
  • style (str, optional) – Plot stlye. The default is “WTP”.
  • **kwargs (TYPE) – Keyword arguments forwarded to the tests plotting routines.
Returns:

fig – The created matplotlib figure.

Return type:

Figure

fadeline(ax, x, y, label=None, color=None, steps=20, **kwargs)[source]

Fading line for matplotlib.

This is a workaround to produce a fading line.

Parameters:
  • ax (axis) – Axis to plot on.
  • x (list) – start and end value of x components of the line
  • y (list) – start and end value of y components of the line
  • label (str, optional) – label for the legend. Default: None
  • color (MPL color, optional) – color of the line Default: None
  • steps (int, optional) – steps of fading Default: 20
  • **kwargs – keyword arguments that are forwarded to plt.plot
plot_well_pos(well_const, names=None, title='', filename=None, plot_well_names=True, ticks_set='auto', fig=None, style='WTP')[source]

Plot all well constellations and label the points with the names.

Parameters:
  • well_const (list) – List of well constellations.
  • names (list of str, optional) – Names for the wells. The default is None.
  • title (str, optional) – Plot title. The default is “”.
  • filename (str, optional) – Filename if the result should be saved. The default is None.
  • plot_well_names (bool, optional) – Whether to plot the well-names. The default is True.
  • ticks_set (int or str, optional) – Tick spacing in the plot. The default is “auto”.
  • fig (Figure, optional) – Matplotlib figure to plot on. The default is None.
  • style (str, optional) – Plot stlye. The default is “WTP”.
Returns:

fig – The created matplotlib figure.

Return type:

Figure

campaign_well_plot(campaign, plot_tests=True, plot_well_names=True, fig=None, style='WTP')[source]

Plot of the well constellation within the campaign.

Parameters:
  • campaign (Campaign) – The campaign to be plotted.
  • plot_tests (bool, optional) – DESCRIPTION. The default is True.
  • plot_well_names (TYPE, optional) – DESCRIPTION. The default is True.
  • fig (Figure, optional) – Matplotlib figure to plot on. The default is None.
  • style (str, optional) – Plot stlye. The default is “WTP”.
Returns:

ax – The created matplotlib axes.

Return type:

Axes

plotfit_transient(setup, data, para, rad, time, radnames, extra, plotname=None, fig=None, ax=None, style='WTP')[source]

Plot of transient estimation fitting.

plotfit_steady(setup, data, para, rad, radnames, extra, plotname=None, ax_ins=True, fig=None, ax=None, style='WTP')[source]

Plot of steady estimation fitting.

plotparainteract(result, paranames, plotname=None, fig=None, style='WTP')[source]

Plot of parameter interaction.

plotparatrace(result, parameternames=None, parameterlabels=None, xticks=None, stdvalues=None, plotname=None, fig=None, style='WTP')[source]

Plot of parameter trace.

plotsensitivity(paralabels, sensitivities, plotname=None, fig=None, ax=None, style='WTP')[source]

Plot of sensitivity results.