Name | ratingcurve JSON |
Version |
1.0.2
JSON |
| download |
home_page | None |
Summary | A library for fitting multi-segment stage-discharge rating curves. |
upload_time | 2024-05-30 23:12:57 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | License ======= Unless otherwise noted, this project is in the public domain in the United States because it contains materials that originally came from the United States Geological Survey, an agency of the United States Department of Interior. For more information, see the official USGS copyright policy at https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication. CC0 1.0 Universal Summary ------------------------- This is a human-readable summary of the [Legal Code (read the full text)][1]. ### No Copyright The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. ### Other Information In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights. Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law. When using or citing the work, you should not imply endorsement by the author or the affirmer. [1]: https://creativecommons.org/publicdomain/zero/1.0/legalcode |
keywords |
usgs
streamflow
rating curve
|
VCS |
|
bugtrack_url |
|
requirements |
pymc
pandas
pytensor
patsy
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ratingcurve
*A Python package 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.
For the most part, those rating curves are still fit manually by drawing a curve to the data,
which can be time consuming and subjective.
To improve that process, the U.S. Geological Survey (USGS), among others, is evaluating methods for automating that fitting.
Several automated methods currently exist, but each parameterizes the rating curve slightly differently,
and because of the nature of the problem, those slight differences can greatly affect performance.
To help the community evaluate different parameterizations,
we created the `ratingcurve` package, which implements our best parameterization for others to try.
Furthermore, the implementation uses [PyMC](https://www.pymc.io/welcome.html), a general purpose library for probabilistic modeling,
which makes it easier for others to modify the model to test different parameterizations or fitting algorithms.
If you can improve upon our parameterization, USGS might use your algorithm to generate streamflow timeseries at thousands of locations around the United States.
The package includes simple demonstrations and test datasets to get you started.
Please report any bugs, suggest enhancements, or ask questions by creating an [issue](https://github.com/thodson-usgs/ratingcurve/issues).
## Installation
Install using pip
```sh
pip install ratingcurve
```
or conda
```sh
conda install -c conda-forge ratingcurve
```
## Basic Usage
This [`tutorial`](https://github.com/thodson-usgs/ratingcurve/blob/main/docs/notebooks/segmented-power-law-tutorial.ipynb) demonstrates basic usage of fitting and plottig a rating curve
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/thodson-usgs/ratingcurve/blob/main/docs/notebooks/segmented-power-law-tutorial.ipynb)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/thodson-usgs/ratingcurve/main?labpath=docs%2Fnotebooks%2Fsegmented-power-law-tutorial.ipynb)
```python
from ratingcurve.ratings import PowerLawRating
from ratingcurve import data
# load tutorial data
df = data.load('green channel')
# initialize the model
powerrating = PowerLawRating(segments=2)
# fit the model
trace = powerrating.fit(q=df['q'],
h=df['stage'],
q_sigma=df['q_sigma'])
powerrating.plot()
```
![example plot](https://github.com/thodson-usgs/ratingcurve/blob/main/docs/assets/green-channel-rating-plot.png?raw=true)
Once fit, easily generate a rating table that can be imported into other applications.
```python
powerrating.table()
```
For more, see the [documentation](https://thodson-usgs.github.io/ratingcurve/meta/intro.html).
## 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.
## Citation
Hodson, T.O., Doore, K.J., Kenney, T.A., Over T.M., and Yeheyis, M.B., 2024, Ratingcurve: A Python Package for Fitting Streamflow Rating Curves, Hydrology 11, no. 2: 14. https://doi.org/10.3390/hydrology11020014
```
@Article{hydrology11020014,
AUTHOR = {Hodson, Timothy O. and Doore, Keith J. and Kenney, Terry A. and Over, Thomas M. and Yeheyis, Muluken B.},
TITLE = {Ratingcurve: A Python Package for Fitting Streamflow Rating Curves},
JOURNAL = {Hydrology},
VOLUME = {11},
YEAR = {2024},
NUMBER = {2},
ARTICLE-NUMBER = {14},
URL = {https://www.mdpi.com/2306-5338/11/2/14},
ISSN = {2306-5338},
DOI = {10.3390/hydrology11020014}
}
```
Raw data
{
"_id": null,
"home_page": null,
"name": "ratingcurve",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Timothy Hodson <thodson@usgs.gov>",
"keywords": "USGS, streamflow, rating curve",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/e8/53/6acf6e3674065a064f26360a127694e9766cfc6476fcd6799afaba260a76/ratingcurve-1.0.2.tar.gz",
"platform": null,
"description": "# ratingcurve\n*A Python package for fitting hydrologic rating curves.*\n\nIn hydrology, a rating curve is a mathematical relationship between streamflow and water surface elevation (stage).\nBecause stage is much easier to measure than streamflow, almost all streamflow timeseries are generated from rating curves.\nFor the most part, those rating curves are still fit manually by drawing a curve to the data,\nwhich can be time consuming and subjective.\nTo improve that process, the U.S. Geological Survey (USGS), among others, is evaluating methods for automating that fitting. \nSeveral automated methods currently exist, but each parameterizes the rating curve slightly differently,\nand because of the nature of the problem, those slight differences can greatly affect performance.\nTo help the community evaluate different parameterizations,\nwe created the `ratingcurve` package, which implements our best parameterization for others to try.\nFurthermore, the implementation uses [PyMC](https://www.pymc.io/welcome.html), a general purpose library for probabilistic modeling, \nwhich makes it easier for others to modify the model to test different parameterizations or fitting algorithms.\nIf you can improve upon our parameterization, USGS might use your algorithm to generate streamflow timeseries at thousands of locations around the United States.\nThe package includes simple demonstrations and test datasets to get you started.\n\nPlease report any bugs, suggest enhancements, or ask questions by creating an [issue](https://github.com/thodson-usgs/ratingcurve/issues).\n \n## Installation\nInstall using pip\n```sh\npip install ratingcurve\n```\nor conda\n```sh\nconda install -c conda-forge ratingcurve\n```\n\n## Basic Usage\nThis [`tutorial`](https://github.com/thodson-usgs/ratingcurve/blob/main/docs/notebooks/segmented-power-law-tutorial.ipynb) demonstrates basic usage of fitting and plottig a rating curve\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/thodson-usgs/ratingcurve/blob/main/docs/notebooks/segmented-power-law-tutorial.ipynb)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/thodson-usgs/ratingcurve/main?labpath=docs%2Fnotebooks%2Fsegmented-power-law-tutorial.ipynb)\n\n```python\nfrom ratingcurve.ratings import PowerLawRating\nfrom ratingcurve import data\n\n# load tutorial data\ndf = data.load('green channel')\n\n# initialize the model\npowerrating = PowerLawRating(segments=2)\n \n# fit the model\ntrace = powerrating.fit(q=df['q'],\n h=df['stage'], \n q_sigma=df['q_sigma'])\npowerrating.plot()\n```\n![example plot](https://github.com/thodson-usgs/ratingcurve/blob/main/docs/assets/green-channel-rating-plot.png?raw=true)\n\n\nOnce fit, easily generate a rating table that can be imported into other applications.\n```python\npowerrating.table()\n```\n\nFor more, see the [documentation](https://thodson-usgs.github.io/ratingcurve/meta/intro.html).\n\n## Disclaimer\n\nThis software is preliminary or provisional and is subject to revision. \nIt is being provided to meet the need for timely best science.\nThe software has not received final approval by the U.S. Geological Survey (USGS).\nNo 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. \nThe 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.\n\n## Citation\nHodson, T.O., Doore, K.J., Kenney, T.A., Over T.M., and Yeheyis, M.B., 2024, Ratingcurve: A Python Package for Fitting Streamflow Rating Curves, Hydrology 11, no. 2: 14. https://doi.org/10.3390/hydrology11020014\n\n```\n@Article{hydrology11020014,\nAUTHOR = {Hodson, Timothy O. and Doore, Keith J. and Kenney, Terry A. and Over, Thomas M. and Yeheyis, Muluken B.},\nTITLE = {Ratingcurve: A Python Package for Fitting Streamflow Rating Curves},\nJOURNAL = {Hydrology},\nVOLUME = {11},\nYEAR = {2024},\nNUMBER = {2},\nARTICLE-NUMBER = {14},\nURL = {https://www.mdpi.com/2306-5338/11/2/14},\nISSN = {2306-5338},\nDOI = {10.3390/hydrology11020014}\n}\n```\n",
"bugtrack_url": null,
"license": "License ======= Unless otherwise noted, this project is in the public domain in the United States because it contains materials that originally came from the United States Geological Survey, an agency of the United States Department of Interior. For more information, see the official USGS copyright policy at https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits Additionally, we waive copyright and related rights in the work worldwide through the CC0 1.0 Universal public domain dedication. CC0 1.0 Universal Summary ------------------------- This is a human-readable summary of the [Legal Code (read the full text)][1]. ### No Copyright The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. ### Other Information In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights. Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law. When using or citing the work, you should not imply endorsement by the author or the affirmer. [1]: https://creativecommons.org/publicdomain/zero/1.0/legalcode ",
"summary": "A library for fitting multi-segment stage-discharge rating curves.",
"version": "1.0.2",
"project_urls": {
"homepage": "https://github.com/thodson-usgs/ratingcurve",
"repository": "https://github.com/thodson-usgs/ratingcurve.git"
},
"split_keywords": [
"usgs",
" streamflow",
" rating curve"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ac81b12735f32b1129d83c5d9d55bbf553ce01d1ae97012eb28c0ce92431204d",
"md5": "79b86758b8cccf0442b1d07664ecb86f",
"sha256": "a2a63c08c344f135b9c4cf476b3526cd45912b1158b3825ac29481b44216c74b"
},
"downloads": -1,
"filename": "ratingcurve-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "79b86758b8cccf0442b1d07664ecb86f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 46672,
"upload_time": "2024-05-30T23:12:55",
"upload_time_iso_8601": "2024-05-30T23:12:55.889210Z",
"url": "https://files.pythonhosted.org/packages/ac/81/b12735f32b1129d83c5d9d55bbf553ce01d1ae97012eb28c0ce92431204d/ratingcurve-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e8536acf6e3674065a064f26360a127694e9766cfc6476fcd6799afaba260a76",
"md5": "5d44f5129fb923aab973e386eea2232a",
"sha256": "bc81e27fb5ce7cb7c2f1eb01daf50034ea59e9d212d480c6d991997307a5f191"
},
"downloads": -1,
"filename": "ratingcurve-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "5d44f5129fb923aab973e386eea2232a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 91008,
"upload_time": "2024-05-30T23:12:57",
"upload_time_iso_8601": "2024-05-30T23:12:57.105464Z",
"url": "https://files.pythonhosted.org/packages/e8/53/6acf6e3674065a064f26360a127694e9766cfc6476fcd6799afaba260a76/ratingcurve-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-30 23:12:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thodson-usgs",
"github_project": "ratingcurve",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pymc",
"specs": [
[
">=",
"5.0.0"
]
]
},
{
"name": "pandas",
"specs": []
},
{
"name": "pytensor",
"specs": []
},
{
"name": "patsy",
"specs": []
}
],
"lcname": "ratingcurve"
}