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