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 details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

File details

Details for the file pycatchmod-1.1.0.tar.gz.

File metadata

  • Download URL: pycatchmod-1.1.0.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for pycatchmod-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4744494dcf09b44bc2623968313a1c515cd37c1243a417bfa731a6270f3aa669
MD5 041c1d8e32987e6bea42476513a8e54f
BLAKE2b-256 51b825de345ba024a4cbd18ac312eb465aa3cab0535ca5bbf8cbfc28c4f1dd2a

See more details on using hashes here.

File details

Details for the file pycatchmod-1.1.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pycatchmod-1.1.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 254.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for pycatchmod-1.1.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 24433243e265820e23e914d1e4f81c27a0100926ef0e11cd88ad47f531dee2fd
MD5 92f481772b3f1539e557f62a5f352fca
BLAKE2b-256 9432a03cdd06609246cd1045be93907bf002a0d8fe3988fef9a52c6ba83c4977

See more details on using hashes here.

File details

Details for the file pycatchmod-1.1.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pycatchmod-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 996.5 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0 requests/2.21.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.7.1

File hashes

Hashes for pycatchmod-1.1.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8f770fe1c5a7abf244401bb7b0353462f37877032fb5acde2036e74cd17d11a4
MD5 9faf8fb9dc99c6c7a9ca25be9b8d279b
BLAKE2b-256 76574b092cf1c0bf6c947f50d5e82ad0c380b3daf6fb56fcb7ba04f28722f49d

See more details on using hashes here.

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