Skip to main content

Python implementation of the rainfall runoff model CATCHMOD.

Project description

CATCHMOD is widely used rainfall runoff model in the United Kingdom. It was introduced by Wilby (1994). This version is developed in Python and utilises Cython to allow efficient execution of long time series.

https://travis-ci.org/pywr/pycatchmod.svg?branch=master

Features

pycatchmod includes the following features:

  • Core CATCHMOD algorithm written in Cython for speed,

  • Simultaneous simulation of multiple input timeseries with the same catchment parameters, and

  • Integration with numpy arrays.

  • Implementation of Oudin (2005) PET formula to calculate PET from temperature.

  • A command line interface

Installation

The module is primarily written in Cython and will need a C compiler installed to build. The code has been tested successfully with GCC (Linux), MSVC (Windows) and clang (OS X).

To install, use setup.py as you normally would:

python setup.py install

Once installed, tests can be run using the py.test command:

py.test tests

Command line interface

A command line interface has been written for convenience. This is installed as the pycatchmod command. See:

pycatchmod --help

You can access the help for each of the sub-commands using the --help switch, e.g.:

pycatchmod run --help

To run a model, use the run sub-command:

pycatchmod run --parameters thames.json --rainfall thames_rainfall.csv --pet thames_pet.csv --output thames_flow.csv

The command line interface also provides some tools for working with the Excel implementation of CATCHMOD. The parameters from a model can be extracted from an Excel file using dump e.g.:

pycatchmod dump --filename thames.xls

The parameters are printed in JSON format to the standard output (STDOUT). An example of this format can be found in the tests directory. This data can be redirected into a file using a pipe:

pycatchmod dump --filename thames.xls > thames.json

You can use the compare command to compare the results of pycatchmod and an Excel model. Any (significant) differences between the outputs is considered a bug (and should be reported via GitHub).

pycatchmod compare --filename thames.xls --plot

Changes

Version 1.1.0

  • Added feature to output flow per area.

Version 1.0.0

  • Initial release

Licence

This work is licenced under the GNU General Public Licence Version 3 (GNU GPLv3). Please see LICENCE for details.

Authors

Acknowledgements

This work was funded by the University of Manchester, United Kingdom.

References

Wilby, R., Greenfield, B., Glenny, C., 1994. A coupled synoptic-hydrological model for climate change impact assessment. Journal of Hydrology. 153. p265-290.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycatchmod-1.1.0.tar.gz (49.3 kB view hashes)

Uploaded Source

Built Distributions

pycatchmod-1.1.0-cp36-cp36m-win_amd64.whl (254.8 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

pycatchmod-1.1.0-cp36-cp36m-manylinux1_x86_64.whl (996.5 kB view hashes)

Uploaded CPython 3.6m

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page