Ratingcurve: A Python Package for Fitting Streamflow Rating Curves
Abstract
:1. Introduction
- Estimating the optimal locations of breakpoints, as well as the number of segments;
- Accounting for uncertainty in the measurements and the rating model;
- Fitting with minimal data;
- Using similar assumptions to current operational methods;
- Using a community-developed probabilistic programming library;
- Having an easy-to-use Python package with documentation, tutorials, and test datasets.
2. Parameterization
3. Calibration
4. Usage
- rating = PowerLawRating(segments=2)
- rating.fit(q, h, e, method="advi")
- rating.plot()
- and produces a plot like Figure 1.
5. Benchmarking Results
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
ADVI | Automatic Differentiation Variational Inference |
MCMC | Markov chain Monte Carlo |
NUTS | No-U-Turn Sampler |
USGS | United States Geological Survey |
Appendix A. Additional Examples
Dataset | Data Source |
---|---|
Chalk Creek, USA | USGS streamgage 10131000 |
Colorado River, USA | USGS streamgage 09185600 |
Green River, USA | USGS streamgage 09261000 |
Provo River, USA | USGS streamgage 10154200 |
Three-Segment Simulated | This study |
Mahurangi River, New Zealand | Kiang et al. [20] |
Nordura River, Iceland | Hrafnkelsson et al. [10] |
Skajalfandafljot River, Iceland | Hrafnkelsson et al. [10] |
Isére River, France | Kiang et al. [20] |
References
- ISO 18320:2020; Hydrometry–Measurement of Liquid Flow in Open Channels—Determination of the Stage-Discharge Relationship. International Organization for Standardization: Geneva, Switzerland, 2020.
- Kennedy, E.J. Discharge Ratings at Gaging Stations, U.S. Geological Survey Techniques of Water-Resources Investigations, Book 3, Chapter A10; U.S. Geological Survey: Reston, VA, USA, 1984.
- Venetis, C. A note on the estimation of the parameters in logarithmic stage-discharge relationships with estimates of their error. Int. Assoc. Sci. Hydrol. Bull. 1970, 15, 105–111. [Google Scholar] [CrossRef]
- Reitan, T.; Petersen-Øverleir, A. Existence of the frequentistic estimate for power-law regression with a location parameter, with applications for making discharge rating curves. Stoch. Environ. Res. Risk Assess. 2006, 20, 445–453. [Google Scholar] [CrossRef]
- Fenton, J.D. On the generation of stream rating curves. J. Hydrol. 2018, 564, 748–757. [Google Scholar] [CrossRef]
- Manning, R. On the flow of water in open channels and pipes. Trans. Inst. Civ. Eng. Irel. 1891, 20, 179–207. [Google Scholar]
- Reitan, T.; Petersen-Øverleir, A. Bayesian methods for estimating multi-segment discharge rating curves. Stoch. Environ. Res. Risk Assess. 2008, 23, 627–642. [Google Scholar] [CrossRef]
- Le Coz, J.; Renard, B.; Bonnifait, L.; Branger, F.; Le Boursicaud, R. Combining hydraulic knowledge and uncertain gaugings in the estimation of hydrometric rating curves: A Bayesian approach. J. Hydrol. 2014, 509, 573–587. [Google Scholar] [CrossRef]
- Coxon, G.; Freer, J.; Westerberg, I.K.; Wagener, T.; Woods, R.; Smith, P.J. A novel framework for discharge uncertainty quantification applied to 500 UK gauging stations. Water Resour. Res. 2015, 51, 5531–5546. [Google Scholar] [CrossRef] [PubMed]
- Hrafnkelsson, B.; Sigurdarson, H.; Rögnvaldsson, S.; Örn Jansson, A.; Vias, R.D.; Gardarsson, S.M. Generalization of the power-law rating curve using hydrodynamic theory and Bayesian hierarchical modeling. Environmetrics 2021, 33, e2711. [Google Scholar] [CrossRef]
- Ma, Y.A.; Chen, Y.; Jin, C.; Flammarion, N.; Jordan, M.I. Sampling can be faster than optimization. Proc. Natl. Acad. Sci. USA 2019, 116, 20881–20885. [Google Scholar] [CrossRef] [PubMed]
- Petersen-Øverleir, A. Accounting for heteroscedasticity in rating curve estimates. J. Hydrol. 2004, 292, 173–181. [Google Scholar] [CrossRef]
- Salvatier, J.; Wiecki, T.V.; Fonnesbeck, C. Probabilistic programming in Python using PyMC3. PeerJ Comput. Sci. 2016, 2, e55. [Google Scholar] [CrossRef]
- Kucukelbir, A.; Tran, D.; Ranganath, R.; Gelman, A.; Blei, D.M. Automatic differentiation variational inference. J. Mach. Learn. Res. 2017, 18, 1–45. [Google Scholar]
- Hoffman, M.D.; Gelman, A. The No-U-Turn Sampler: Adaptively setting path lengths in Hamiltonian Monte Carlo. J. Mach. Learn. Res. 2014, 15, 1593–1623. [Google Scholar]
- Limpert, E.; Stahel, W.A.; Abbt, M. Log-normal distributions across the sciences: Keys and clues. BioScience 2001, 51, 341. [Google Scholar] [CrossRef]
- Herschy, R.W.; Herschy, R. Streamflow Measurement, 3rd ed.; CRC Press: Boca Raton, FL, USA, 2014. [Google Scholar] [CrossRef]
- Mansanarez, V.; Renard, B.; Coz, J.L.; Lang, M.; Darienzo, M. Shift Happens! Adjusting Stage-Discharge Rating Curves to Morphological Changes at Known Times. Water Resour. Res. 2019, 55, 2876–2899. [Google Scholar] [CrossRef]
- Hodson, T.O.; Doore, K.J. Ratingcurve: A Python Package for Fitting Streamflow Ratting Curves; U.S. Geological Survey: Reston, VA, USA, 2024. [CrossRef]
- Kiang, J.E.; Gazoorian, C.; McMillan, H.; Coxon, G.; Le Coz, J.; Westerberg, I.K.; Belleville, A.; Sevrez, D.; Sikorska, A.E.; Petersen-Øverleir, A.; et al. A Comparison of Methods for Streamflow Uncertainty Estimation. Water Resour. Res. 2018, 54, 7149–7176. [Google Scholar] [CrossRef]
Mean | Median | ||
---|---|---|---|
Stage | Discharge | Discharge | GSE |
ft | ft3 s−1 | ft3 s−1 | - |
2.20 | 1376.14 | 1376.16 | 1.0107 |
2.21 | 1388.27 | 1388.27 | 1.0107 |
2.22 | 1400.41 | 1400.40 | 1.0107 |
2.23 | 1412.57 | 1412.55 | 1.0106 |
2.24 | 1424.74 | 1424.73 | 1.0106 |
… | … | … | … |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Hodson, T.O.; Doore, K.J.; Kenney, T.A.; Over, T.M.; Yeheyis, M.B. Ratingcurve: A Python Package for Fitting Streamflow Rating Curves. Hydrology 2024, 11, 14. https://doi.org/10.3390/hydrology11020014
Hodson TO, Doore KJ, Kenney TA, Over TM, Yeheyis MB. Ratingcurve: A Python Package for Fitting Streamflow Rating Curves. Hydrology. 2024; 11(2):14. https://doi.org/10.3390/hydrology11020014
Chicago/Turabian StyleHodson, Timothy O., Keith J. Doore, Terry A. Kenney, Thomas M. Over, and Muluken B. Yeheyis. 2024. "Ratingcurve: A Python Package for Fitting Streamflow Rating Curves" Hydrology 11, no. 2: 14. https://doi.org/10.3390/hydrology11020014
APA StyleHodson, T. O., Doore, K. J., Kenney, T. A., Over, T. M., & Yeheyis, M. B. (2024). Ratingcurve: A Python Package for Fitting Streamflow Rating Curves. Hydrology, 11(2), 14. https://doi.org/10.3390/hydrology11020014