ceff-tech / ffc_api_client

An R client for the online Functional Flows Calculator API
https://ceff-tech.github.io/ffc_api_client
9 stars 3 forks source link
environmental-flows functional-flows

Simple Functional Flows Calculator API client

This package is designed to:

  1. Process data through the online functional flows calculator
  2. Transform that data and return plots of the Dimensionless Reference Hydrograph (DRH) as well as boxplots showing the observed versus predicted percentile values for each metric.
  3. Have shortcut functions that handle all of this, while exposing the internals so you can access useful intermediate products, such as the functional flows calculator results as an R dataframe, in case you need to do more complex analysis.

It is meant to be used with simply a gage ID, or with a timeseries dataframe of flows along with either a stream segment COMID or longitude and latitude (it will look up the COMID for you). See Setup and Examples below for more.

Code Testing Status

  1. Documentation and Examples
  2. Setup
  3. Change Log

Full Documentation and Exmaples

We have moved all documentation and examples to our documentation website. A PDF manual is also available.

Setup

  1. If you don't already have devtools installed, run install.packages('devtools') in your R console, or install the package any way you prefer.
  2. Install this package with devtools::install_github('ceff-tech/ffc_api_client/ffcAPIClient'). If you get an error on this installation step, make sure you are using the latest version of the devtools package.
  3. Now we need to retrieve your token. In Firefox or Chrome, log into https://eflows.ucdavis.edu. Once logged in, make sure you are on your user profile page at https://eflows.ucdavis.edu/profile and then press F12 on your keyboard to bring up the Inspector, then switch to the Console tab.
  4. In the console, type localStorage.getItem('ff_jwt') - you may need to type it in yourself instead of pasting (or follow Firefox's instructions to enable pasting - it will tell you how after you try to paste). Hit Enter to send the command.
  5. Your browser will place text on the line below the command you typed - this is your "token". Save this value and copy it to your clipboard and we'll use it below. This value should stay private - if other people knew the value, they could use it to access your account on eflows.ucdavis.edu!

That's it. You can now run data through the online FFC using this package and process the results.

Change Log

Version 0.9.8.3

Version 0.9.8.2

Version 0.9.8.1

Version 0.9.8.0

Version 0.9.7.5

Version 0.9.7.4

Version 0.9.7.3

Version 0.9.7.2

Version 0.9.7.1

Version 0.9.7.0

Version 0.9.6.9

Version 0.9.6.8

Version 0.9.6.7

Version 0.9.6.6

Version 0.9.6.5

Version 0.9.6.4

Version 0.9.6.3

Version 0.9.6.2

Version 0.9.6.1

Version 0.9.6.0

Version 0.9.5.8

Version 0.9.5.7

Version 0.9.5.6

Version 0.9.5.5

Version 0.9.5.4

Version 0.9.5.3

Version 0.9.5.2

Version 0.9.5.1

Version 0.9.5

Version 0.9.4.2

Version 0.9.4.1

Version 0.9.4

Version 0.9.3