Metadata-Version: 2.1
Name: welltestpy
Version: 0.3.1
Summary: welltestpy - package to handle well-based Field-campaigns.
Home-page: https://github.com/GeoStat-Framework/welltestpy
Author: Sebastian Mueller
Author-email: sebastian.mueller@ufz.de
Maintainer: Sebastian Mueller
Maintainer-email: sebastian.mueller@ufz.de
License: GPL -  see LICENSE
Platform: Windows
Platform: Linux
Platform: Solaris
Platform: Mac OS-X
Platform: Unix
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
Requires-Dist: numpy (>=1.13.0)
Requires-Dist: scipy (>=0.19.1)
Requires-Dist: pandas (>=0.20.3)
Requires-Dist: matplotlib (>=2.0.2)
Requires-Dist: anaflow
Requires-Dist: spotpy

# Welcome to WellTestPy

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1229051.svg)](https://doi.org/10.5281/zenodo.1229051)
[![PyPI version](https://badge.fury.io/py/welltestpy.svg)](https://badge.fury.io/py/welltestpy)
[![Build Status](https://travis-ci.org/GeoStat-Framework/welltestpy.svg?branch=master)](https://travis-ci.org/GeoStat-Framework/welltestpy)
[![Documentation Status](https://readthedocs.org/projects/welltestpy/badge/?version=latest)](https://geostat-framework.readthedocs.io/projects/welltestpy/en/latest/?badge=latest)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

<p align="center">
<img src="https://raw.githubusercontent.com/GeoStat-Framework/welltestpy/master/docs/source/pics/WTP.png" alt="WellTestPy-LOGO" width="251px"/>
</p>

## Purpose

WellTestPy provides a framework to handle and plot data from well based field campaigns as well as a data interpretation module.


## Installation

You can install the latest version with the following command:

    pip install welltestpy


## Documentation for WellTestPy

You can find the documentation under [geostat-framework.readthedocs.io][doc_link].


### Example 1: Create a Campaign containing a pumping test

In the following a simple pumping test is created with artificial drawdown data
generated by the Theis-solution.

```python
import numpy as np
import welltestpy as wtp
import anaflow as ana

### create the field-site and the campaign
field = wtp.data.FieldSite(name="UFZ", coordinates=[51.353839, 12.431385])
campaign = wtp.data.Campaign(name="UFZ-campaign", fieldsite=field)

### add 4 wells to the campaign
campaign.add_well(name="well_0", radius=0.1, coordinates=(0., 0.))
campaign.add_well(name="well_1", radius=0.1, coordinates=(1., -1.))
campaign.add_well(name="well_2", radius=0.1, coordinates=(2., 2.))
campaign.add_well(name="well_3", radius=0.1, coordinates=(-2., -1.))

### generate artificial drawdown data with the Theis solution
prate = -1e-4
time = np.geomspace(10, 7200, 10)
transmissivity = 1e-4
storage = 1e-4
rad = [
   campaign.wells["well_0"].radius,                     # well radius of well_0
   campaign.wells["well_0"] - campaign.wells["well_1"], # distance between 0-1
   campaign.wells["well_0"] - campaign.wells["well_2"], # distance between 0-2
   campaign.wells["well_0"] - campaign.wells["well_3"], # distance between 0-3
]
drawdown = ana.theis(
    rad=rad,
    time=time,
    T=transmissivity,
    S=storage,
    Qw=prate,
)

### create a pumping test at well_0
pumptest = wtp.data.PumpingTest(
    name="well_0",
    pumpingwell="well_0",
    pumpingrate=prate,
    description="Artificial pump test with Theis",
)

### add the drawdown observation at the 4 wells
pumptest.add_transient_obs("well_0", time, drawdown[:, 0])
pumptest.add_transient_obs("well_1", time, drawdown[:, 1])
pumptest.add_transient_obs("well_2", time, drawdown[:, 2])
pumptest.add_transient_obs("well_3", time, drawdown[:, 3])

### add the pumping test to the campaign
campaign.addtests(pumptest)

### plot the well constellation and a test overview
campaign.plot_wells()
campaign.plot()

### save the whole campaign
campaign.save()
```

This will give the following plots:

<p align="center">
<img src="https://raw.githubusercontent.com/GeoStat-Framework/welltestpy/master/docs/source/pics/01_wells.png" alt="Wells" width="600px"/>
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/GeoStat-Framework/welltestpy/master/docs/source/pics/01_pumptest.png" alt="Pumptest" width="600px"/>
</p>

And the campaign is stored to a file called `Cmp_UFZ-campaign.cmp`


### Example 2: Estimate transmissivity and storativity

The pumping test from example 1 can now be loaded and used to estimate the values for
transmissivity and storativity.

```python
import welltestpy as wtp

campaign = wtp.data.load_campaign("Cmp_UFZ-campaign.cmp")
estimation = wtp.estimate.Theisest("Estimate_theis", campaign)
estimation.setpumprate()
estimation.settime()
estimation.genrtdata()
estimation.run(
    dbname="database",
    plotname1="paratrace.pdf",
    plotname2="fit_plot.pdf",
    plotname3="parainteract.pdf",
    estname="estimation.txt",
)
```

This will give the following plots:

<p align="center">
<img src="https://raw.githubusercontent.com/GeoStat-Framework/welltestpy/master/docs/source/pics/02_fit.png" alt="Fit" width="600px"/>
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/GeoStat-Framework/welltestpy/master/docs/source/pics/02_paratrace.png" alt="Trace" width="600px"/>
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/GeoStat-Framework/welltestpy/master/docs/source/pics/02_parainter.png" alt="Interaction" width="600px"/>
</p>

The results are:

* `ln(T) = -9.22` which is equivalent to `T = 0.99 * 10^-4 m^2/s`
* `ln(S) = -9.10` which is equivalent to `S = 1.11 * 10^-4`


### Provided Subpackages

```python
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 miscellaneous tools
```


## Requirements

- [NumPy >= 1.13.0](https://www.numpy.org)
- [SciPy >= 0.19.1](https://www.scipy.org)
- [Pandas >= 0.20.3](https://pandas.pydata.org)
- [Matplotlib >= 2.0.2](https://matplotlib.org)
- [AnaFlow](https://github.com/GeoStat-Framework/AnaFlow)
- [SpotPy](https://github.com/thouska/spotpy)


## Contact

You can contact us via <info@geostat-framework.org>.


## License

[GPL][gpl_link] © 2018-2019

[gpl_link]: https://github.com/GeoStat-Framework/welltestpy/blob/master/LICENSE
[doc_link]: https://geostat-framework.readthedocs.io/projects/welltestpy/en/latest/


