rvn_rvt_obsfile {RavenR} | R Documentation |
Creates an observation data file named filename from a continuous (gap-free) xts time series ts
rvn_rvt_obsfile(filename, ts, SBID, typestr = "HYDROGRAPH", units = "m3/s")
filename |
observation data file to be created, with .rvt extension |
ts |
xts time series with single data column |
SBID |
Subbasin ID for hydrographs and reservoir stages or HRU ID for observations of state variables (e.g., snow depth) |
typestr |
Raven-recognized data type string: 'HYDROGRAPH', 'RESERVOIR_STAGE', 'RESERVOIR_INFLOW', 'RESERVOIR_NET_INFLOW', or a state variable name (e.g., SOIL[0] or SNOW) |
units |
units of the data (should be consistent with Raven units; neither Raven nor this routine checks or corrects |
TRUE returns TRUE if function runs properly
James R. Craig, University of Waterloo
rvn_ts_infill
for infilling time series, and rvn_rvt_obsweights
to write an rvt observation weights file.
# locate hydrograph sample csv data from RavenR package ff <- system.file("extdata","run1_Hydrographs.csv", package="RavenR") # read in Raven Hydrographs file, store into mydata mydata <- rvn_hyd_read(ff, tzone="EST") # generate rvt file using just observations from Subbasin ID 36 flows <- rvn_ts_infill(mydata$hyd$Sub36_obs) tf <- file.path(tempdir(), "run1_Hydrographs.rvt") rvn_rvt_obsfile(tf, flows, 36, typestr = "HYDROGRAPH") readLines(tf) %>% head()