Skip to main content

An open source version of the Environment Agency's River Quality Planning software written in Python. It aims to be transparent, extendable and easy to automate.

Project description

PyRQP

An open source version of the Environment Agency's River Quality Planning (RQP) software written in Python. It aims to be transparent, extendable and easy to automate.

RQP

RQP is one of the main tools used for discharge permitting and water management in the UK. The main purpose of the tool is to simulate the mixing of two inputs (generally a river and a discharge) to estimate the distribution of the output concentration of the downstream mixing zone. Typical uses of the tool would be to determine the possible impact of an increased flow discharged at a location, or the quality required at a given discharge to meet a specific water quality standard downstream of the discharge. RQP is the model underpinning the functionality implemented by the Environment Agency's catchment simulator SIMCAT and UKWIR's SAGIS.

There are two key points underlying the methodology of the RQP tool:

  1. The input data are correlated. That is, they are dependent on one another and change together to a certain degree.
  2. It is possible to simulate the mix of two distributions by using a numerical method such as Monte Carlo (i.e., repeated random sampling to obtain numerical results).

Correlation

RQP generates four sets of random correlated data based on each parameter's distributions, which are generally considered to be lognormal. The parameters are: river flow, discharge flow, river concentration and discharge concentration. The following is a graphical representation of what this looks like for river flow and quality. The correlation between river flow and discharge flow is typically 0.6.

LogNormal

Example of river flow and quality correlation of 0.6 for two lognormal distributions. River flow mean and std are 20 and 4.5; river quality mean and std are 4 and 0.9. These values are approximate

Monte Carlo

By applying a simple mass balance, the downstream flow and concentration is calculated. A graphical representation of the Monte Carlo method for mixing distributions is shown below.

MonteCarlo

Monte Carlo sampling method

Source: Henderson, Brent & Bui, Elisabeth. (2005). Determining Uncertainty in Sediment & Nutrient Transport Models for Ecological Risk Assessment. Report No 2. LWA/MDBC Project UMO43: Risk-based Approaches to Managing Contaminants in Catchments. CSIRO.

Usage

Please check the notebook folder for examples of how to use it.

Installation

This package is available for installation using PyPI:

pip install PyRQP

However, the pip version may lag behind the release version. For most users it is recommended that they download the package directly from GitHub.

Citation

Please consider citing this website when using PyRQP:

Juan-Garcia, P. (2023, October 17). PauJuan/PyRQP Open source River Quality Planning software written in Python. GitHub. https://github.com/PauJuan/PyRQP

License

Copyright (C) 2023 Pau Juan-Garcia

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

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

pyrqp-0.0.2.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrqp-0.0.2-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file pyrqp-0.0.2.tar.gz.

File metadata

  • Download URL: pyrqp-0.0.2.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.10.9

File hashes

Hashes for pyrqp-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e35fc6e1682455aa494063a5fa9a0ee844ec7f4a054a56586ce195910aadb079
MD5 8cd96e3a454fba78132b89d18947e970
BLAKE2b-256 c057bf9e67f7cd131e44d68f3636c79dd596608c9563f3141700e64789fed5dd

See more details on using hashes here.

File details

Details for the file pyrqp-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyrqp-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.10.9

File hashes

Hashes for pyrqp-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 625b8ebd6b5aa17d27b9c04ac1276531164293c6705759f345da344c242e3b98
MD5 2752298b09363610eca8e20dbdc5718d
BLAKE2b-256 a1999cdcf5b2fe018e834c79281885a1f591616d553af626c7d5c2f6ed26a00b

See more details on using hashes here.

Supported by

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