Giter Club home page Giter Club logo

nickyrong / shinycfa Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 2.0 364 KB

Shiny app for quick data screening & flood frequency analysis on HYDAT dataset (Water Survey Canada streamflow data). The name CFA is in recognition of the old Consolidated Frequency Analysis tool published in the MS-DOS era but the two have no relation.

Home Page: https://app.waterexplorer.net/shinyCFA

License: MIT License

R 100.00%
hydrometric-stations flood-frequency-analysis hydat-database wsc tidyhydat

shinycfa's Introduction

Authors


Overview

ShinyCFA is currently available at: https://nickrongkp.shinyapps.io/ShinyCFA/ Please note that it is hosted with low limit data plan and be conservative with your usage (i.e. close the tab/browser when not using the app), thank you.

This app allows the user to enter a Water Survey of Canada (WSC) station ID and access streamflow data from the Hydat Database. The data can be summarized in tabular or graphical formats and flood frequency analysis (FFA) can also be performed using a variety of distributions.

The functionality to extract data from the Hydat Database in this app is provided by the tidyhydat package.


App Functionality:

Currently the app allows the user to:

  • View the locations of Water Survey of Canada (WSC) hydrometric stations (non-searchable map)
  • Select a hydrometric station and summarize streamflow data in a table format (daily, monthly, yearly) and download the summarized data
  • View a hydrometric station historical daily hydrograph in an interactive graph
  • View a hydrometric station hydrological regime
  • Run a Flood Frequency Analysis on the annual daily or instantaneous maximum streamflow series using various distributions

Frequency Analysis Methods:

The frequency distribution(s) are fitted using L-moments method from R package lmom by J. R. M. Hosking. L-moments of the sample data are calculated and distribution parameters are then estimated from the calculated L-moments.

Return periods of annual maximum discharge are calculated using the Weibull formula: Tr = (N+1) / m where N is the sample size and m is the rank. Probability of Non-exceedance is the inverse of return period: P = 1 / Tr. The frequency distribution plot x-axis has been transformed into probabilistic scale: η = −log(−log(P)) = −log[−log(1 − 1/Tr)] where η is the reduced variate.

Further readings:

  • Hosking, J., & Wallis, J. (1997). Regional Frequency Analysis: An Approach Based on L-Moments. Cambridge: Cambridge University Press. doi:10.1017/CBO9780511529443
  • Makkonen, L. (2006). Plotting Positions in Extreme Value Analysis, Journal of Applied Meteorology and Climatology, 45(2), 334-340. doi:10.1175/JAM2349.1

License

Copyright © 2022 Nick Rong & Nate Smith

Released under the License: MIT

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please note that this project is released with a Contributor Code of Conduct.By participating in this project you agree to abide by its terms.

Also note that this project was created under a learning objective and it is provided in the event it is useful to others. Accordingly, it is not necessarily under active development.

shinycfa's People

Contributors

nickyrong avatar wraysmith avatar

Watchers

 avatar  avatar  avatar

Forkers

wraysmith bnei

shinycfa's Issues

Extending the date

When using this app, the data is available until 2020-10-31. Could it be possible to pull the data beyond what is available say for instance up until 2022-10-31 which is available at HYDAT portal?

Thanks

Unable to query stations

Unable to query stations in Yukon, e.g. 09AE002, and others when manually entering them.
I keep getting this message: "Disconnected from server. Reload".
And when I reload, same thing continues to happen.
This is my first time using ShinyCFA.
I tried it both in Google Chrome and Edge, and got the same error.

Hydrograph does not work with seasonal gauges

The hydrograph tab will run into error when the gauge is seasonal:

Warning: Error in :: NA/NaN argument
168: %>%
167: renderPlot [/ShinyCFA/server.R#287]
165: func
125: drawPlot
111: reactive:plotObj
95: drawReactive
82: origRenderFunc
81: output$hydrograph
1: runApp

Feature wish-list for v3.0 development

  • Map search
    Currently the map is not searchable (user must manually zoom around & click individual station tag to find stations of interest). It will be good to have some search function for the map (filter by range of drainage area, data availability period, location/proximity, etc.)

  • Distribution fitting Goodness-of-Fit
    Frequency distribution fitting can add an objective evaluation (Goodness of Fit tests). Maybe a table or figure using nsRFA::MSClaio2008()? Usage see: https://cran.r-project.org/web/packages/nsRFA/vignettes/MSClaio2008.pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.