HARPgroup / cbp_wsm

1 stars 0 forks source link

R Flow Metrics for CBP/USGS Gage comparison #11

Open rburghol opened 6 years ago

rburghol commented 6 years ago

Metrics desired:

  1. September drought warning flow (10% on-exceedence flow)
  2. 7Q10
  3. August Low Flow - ALF analysis.
  4. Drought of record metric - we should use either 30, 60 or 90 day low flow

Algorithm: MONTHLY NON-EXCEEDENCE % (i.e. the September 10% flow)

  1. Load your data into a frame -- // all_flows is the complete flow record in a dataset -- T
  2. Make sure your data has a month column -- THIS IS THE PART YOU ALL NEED TO CHANGE (set a month or some other clever method that you all can figure)
  3. You may need a different method for USGS and CBP Model output?
  4. Extract flows for the month of intertest -- i.e. sep_flows = subset(all_flows, "month == 9");
  5. Run the quantile function once you have a vector of september flows, i.e.: x10 <- quantile(sep_flows,0.10);

Working Code: DROUGHT OF RECORD FLOW loflows <- group2(flows); l90 <- loflows["90 Day Min"]; ndx = which.min(as.numeric(l90[,"90 Day Min"])); dor_flow = round(loflows[ndx,]$"90