rvn_rvt_obsfile {RavenR}R Documentation

Create Raven observation data (rvt) file

Description

Creates an observation data file named filename from a continuous (gap-free) xts time series ts

Usage

rvn_rvt_obsfile(filename, ts, SBID, typestr = "HYDROGRAPH", units = "m3/s")

Arguments

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

Value

TRUE returns TRUE if function runs properly

Author(s)

James R. Craig, University of Waterloo

See Also

rvn_ts_infill for infilling time series, and rvn_rvt_obsweights to write an rvt observation weights file.

Examples

# 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()



[Package RavenR version 2.1.0 Index]