DOI-USGS / streamMetabolizer

streamMetabolizer uses inverse modeling to estimate aquatic metabolism (photosynthesis and respiration) from time series data on dissolved oxygen, water temperature, depth, and light.
http://usgs-r.github.io/streamMetabolizer/
Other
36 stars 22 forks source link

Hourly data for streamMetabolizer #368

Closed CasieSmith closed 6 years ago

CasieSmith commented 6 years ago

Hello,

Much of the USGS continuous water-quality data are hourly. Can I put in hourly data to this model?

Bronson1to11 <- data_metab(num_days='10', res='60', attach.units=TRUE) gives: Error in match.arg(res) : 'arg' should be one of “5”, “10”, “15”, “30”

Is there anyway that I can modify the code to have it recognize the 60 minute data? Thank you!

aappling-usgs commented 6 years ago

Yes, your own data can certainly be hourly. When generating the specifications list (through a call to specs()), either set required_timestep to 1/24, or (even easier) leave it at the default of required_timestep=NA.

data_metab just provides example data to facilitate tests and getting started running streamMetabolizer before your own data are prepared. That function does not make 60-minutely example data available, but if you really want 60-minute example data, you can create some like this:

example_30min <- data_metab(num_days='10', res='30', attach.units=FALSE)
example_hourly <- dplyr::slice(example_30min, seq(1, nrow(example_30min), by=2)) # keep every other row