A library for fitting multi-segment stage-discharge rating curves.
Project description
ratingcurve
A Python library for fitting hydrologic rating curves.
In hydrology, a rating curve is a mathematical relationship between streamflow and water surface elevation (stage).
Because stage is much easier to measure than streamflow, almost all streamflow timeseries are generated from rating curves.
Historically, those ratings were fitted by hand, which can be time consuming and error prone.
ratingcurve
provides an easy-to-use algorithm for fitting the standard form of rating curve, the segmented power law.
Installation
Install using pip
pip install ratingcurve
or conda
conda install -c conda-forge ratingcurve
Getting Started
This tutorial
notebook demonstrates basic usage of the package.
Try it locally or in Colab.
from ratingcurve.ratingmodel import PowerLawRating
from ratingcurve import data
# load tutorial data
df = data.load('green channel')
# initialize the model
powerrating = PowerLawRating(q=df['q'],
h=df['stage'],
q_sigma=df['q_sigma'],
segments=2)
# fit the model
trace = powerrating.fit()
powerrating.plot(trace)
Generate a rating table that can be imported into other applications.
powerating.table(trace)
For more, see the documentation.
Disclaimer
This software is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The software has not received final approval by the U.S. Geological Survey (USGS). No warranty, expressed or implied, is made by the USGS or the U.S. Government as to the functionality of the software and related material nor shall the fact of release constitute any such warranty. The software is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the software.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ratingcurve-0.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9460016228e6486ce92ae4ef33752acb345b7d4aca260c87c0fc2dd787a19705 |
|
MD5 | 1be8f8835a6514c776238528be031a33 |
|
BLAKE2b-256 | 8c67d0934270a1b108de778dc19e034aaa3b5fe0362eace4707d05ed120fc30a |