You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation of timeseries objects in opemi-om R version is ultra-simplistic, only considering exact match of timestamp, and failing catastrophically if no match is found (the data retrieval line doesn't fail, just the method of setting the state variable). This needs to be more robust to be sure (handle missing/mismatched data and fail gracefully with error). Also, there needs to be means to do interpolation. The PHP version of vahydro timeseries object had the following modes:
0: linear,
1: previous value,
2: next value,
3: period mean,
4: period min,
5: period max,
6: period sum
Using SQL to create a perfectly matched and interpolated timeseries before run execution
before model run, use SQL to create a timeseries that matches the timestamp of the timer exactly.
Should make all data in UTC format in order to avoid daylight savings time weirdness
xts date range retrieval functions
The xts class (extending zoo) allows for retrieval of date ranges:
# now create an instance of the timeSeriesInput class we've just made
k <- openmi.om.timeSeriesInput();
# Create dat by reading tmp_file
tmp_file = "http://deq2.bse.vt.edu/files/icprb/potomac_111518_precip_in.tsv"
dat <- read.table(tmp_file, sep="\t", header=TRUE)
# Convert dat into xts
k$tsvalues <- xts(dat, order.by = as.POSIXct(dat$Date, format="%m/%d/%Y"))
# use xts timespan notation, i.e.:
# tr = "1999-01-09/1999-01-10 12:00:00"
tr = paste(as.POSIXct('1999-01-9'),(as.POSIXct('1999-01-9') + hours(36)), sep="/")
k$tsvalues[tr]
Previous versions of the model employed timeseries inputs that were pre-processed to do all interpolation prior to execution, allowing easy, exact-matching at run-time. (Example: CBP runoff timeseries input https://github.com/HARPgroup/vahydro/issues/7 )
Benchmark exact matching to period summing
examine methods of pre-run period summing , benchmark time taken
The text was updated successfully, but these errors were encountered:
Overview
Current implementation of timeseries objects in opemi-om R version is ultra-simplistic, only considering exact match of timestamp, and failing catastrophically if no match is found (the data retrieval line doesn't fail, just the method of setting the state variable). This needs to be more robust to be sure (handle missing/mismatched data and fail gracefully with error). Also, there needs to be means to do interpolation. The PHP version of vahydro timeseries object had the following modes:
Using SQL to create a perfectly matched and interpolated timeseries before run execution
See https://github.com/HARPgroup/openmi-om/blob/master/examples/timestamp_queries.R
xts date range retrieval functions
The xts class (extending zoo) allows for retrieval of date ranges:
Produces:
To which could be applied the functions:
Benchmarking/Performance
Previous versions of the model employed timeseries inputs that were pre-processed to do all interpolation prior to execution, allowing easy, exact-matching at run-time. (Example: CBP runoff timeseries input https://github.com/HARPgroup/vahydro/issues/7 )
The text was updated successfully, but these errors were encountered: