Page 5 of 8

Re: General Questions in Raven

Posted: Sat Nov 18, 2017 4:58 pm
by rchlumsk
Hi Elizabeth

I believe you just need to pull the data from within the hydrograph object returned by hyd.read to pass it to the function. The error you get is recreated when a NULL object is passed to the function. Here is an example using the function from the sample data in RavenR, hopefully you can use that to help you with your own data.

Code: Select all

library(RavenR)
data(hydrograph.data) # sample dataset
myhyd <- hydrograph.data # same format as hyd.read function

# manually specify the sim and obs data, or use hyd.extract function
sim <- myhyd$hyd$Sub43
obs <- myhyd$hyd$Sub43_obs
# ?hyd.extract
# dd <- hyd.extract(subs="Sub43",myhyd)

annual.peak(sim,obs)


Cheers,
Rob

Re: General Questions in Raven

Posted: Mon Nov 20, 2017 7:59 am
by ephilip
rchlumsk wrote:Hi Elizabeth

I believe you just need to pull the data from within the hydrograph object returned by hyd.read to pass it to the function. The error you get is recreated when a NULL object is passed to the function. Here is an example using the function from the sample data in RavenR, hopefully you can use that to help you with your own data.

Code: Select all

library(RavenR)
data(hydrograph.data) # sample dataset
myhyd <- hydrograph.data # same format as hyd.read function

# manually specify the sim and obs data, or use hyd.extract function
sim <- myhyd$hyd$Sub43
obs <- myhyd$hyd$Sub43_obs
# ?hyd.extract
# dd <- hyd.extract(subs="Sub43",myhyd)

annual.peak(sim,obs)


Cheers,
Rob


Good Morning Rob,

I tried the code you provided. It works with the data from RavenR for annual.peak(sim,obs). The function annual.peak(sim,obs) do work with my data as well. My post is not for annual.peak(sim,obs) but for the following functions:

annual.peak.event(sim,obs,add.r2=F)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

annual.peak.event.error(sim,obs)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

annual.peak.timing.error(sim,obs)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

flowdurcurve.plot(myhyd$sim, prd='1999-10-01/2007-09-30',seasonal=F)
Error in as.POSIXlt.default(x, tz = tz(x)) :
do not know how to convert 'x' to class “POSIXlt”

I get the same error with the data from the RavenR as well as from my data.

Your help is highly appreciated.

Thank you
Elizabeth

Re: General Questions in Raven

Posted: Wed Nov 29, 2017 8:49 am
by rchlumsk
Hi Elizabeth

This looks like an error that may be caused by some changes to either the xts package or the apply.wyearly function. I will look into this and let you know once I have a patch. Thanks for catching this.

Rob

Re: General Questions in Raven

Posted: Tue Dec 19, 2017 1:13 pm
by ephilip
Konhee Lee wrote:Hello Elizabeth,

The GAWSER-style snow balance was an attempt to emulate the SNOMLT process described in
acwc.sdp.sirsi.net/client/en_US/search/asset/1001420;jsessionid=22BBBEC081240AB73639002B9F4AE46B.enterprise-15000


Unfortunately, we did not have access to the source code and data, so we were not able to emulate it exactly the same.
We had matching snow water equivalent (SWC) and liquid water content (LWC), but our depth was off by 1 cm compared to the example in the documentation (pg 26).

An example rvi file to use the process can be something like:

#########################################################################
:FileType rvi ASCII Raven 2.5
:WrittenBy Konhee Lee
:CreationDate Nov 2016
# Simple snowmelt model to test GAWSER
#------------------------------------------------------------------------
:RunName run1
:StartDate 2000-01-01 00:00:00
:Duration 21
:Timestep 1
:Method ORDERED_SERIES
:Routing ROUTE_NONE
:SoilModel SOIL_ONE_LAYER
:RainSnowFraction RAINSNOW_DATA

#------------------------------------------------------------------------
#
:HydrologicProcesses
:Precipitation PRECIP_RAVEN ATMOS_PRECIP MULTIPLE
:SnowBalance SNOBAL_GAWSER MULTIPLE MULTIPLE
:Flush RAVEN_DEFAULT PONDED_WATER SURFACE_WATER
:EndHydrologicProcesses
#------------------------------------------------------------------------

#---------------------------------------------------------
# Output Options
#
:WriteForcingFunctions
:DebugMode yes

Let me know if you have any questions.

Regards,
Konhee




Hi Konhee,

I tried the SNOWBAL_GAWSER MULTIPLE MULTIPLE in the :HydrologicProcesses. I am getting the following error.

ERROR : ParseMainInputFile: Unrecognized snow balance process representation

Please help

Thank you
Elizabeth

Re: General Questions in Raven

Posted: Tue Dec 19, 2017 3:43 pm
by Konhee Lee
Hello Elizabeth,

Please note that the spelling should be SNOBAL_GAWSER not SNOWBAL_GAWSER.
Also make sure you have the latest version of Raven.

Regards,
Konhee

Re: General Questions in Raven

Posted: Wed Dec 20, 2017 8:16 am
by ephilip
Hi Konhee,

I am using Raven v2.7.

The code is:
:SnowBalance SNOBAL_GAWSER MULTIPLE MULTIPLE

I am getting the error

ERROR : ParseMainInputFile: Unrecognized snow balance process representation
ERROR : Errors found in input data. See Raven_errors.txt for details

Please help

Thank you
Elizabeth

Re: General Questions in Raven

Posted: Mon Jan 01, 2018 7:04 pm
by konhee93
Hello,

Could you send me your model to k76lee@uwaterloo.ca

-Konhee

Re: General Questions in Raven

Posted: Sun Jan 07, 2018 5:35 pm
by rchlumsk
Hi Elizabeth

Related to this thread quoted here, the package has been updated and the mentioned functions should not be working. Let me know if you come across any more bugs.

Cheers,
Rob

ephilip wrote:
rchlumsk wrote:Hi Elizabeth

I believe you just need to pull the data from within the hydrograph object returned by hyd.read to pass it to the function. The error you get is recreated when a NULL object is passed to the function. Here is an example using the function from the sample data in RavenR, hopefully you can use that to help you with your own data.

Code: Select all

library(RavenR)
data(hydrograph.data) # sample dataset
myhyd <- hydrograph.data # same format as hyd.read function

# manually specify the sim and obs data, or use hyd.extract function
sim <- myhyd$hyd$Sub43
obs <- myhyd$hyd$Sub43_obs
# ?hyd.extract
# dd <- hyd.extract(subs="Sub43",myhyd)

annual.peak(sim,obs)


Cheers,
Rob


Good Morning Rob,

I tried the code you provided. It works with the data from RavenR for annual.peak(sim,obs). The function annual.peak(sim,obs) do work with my data as well. My post is not for annual.peak(sim,obs) but for the following functions:

annual.peak.event(sim,obs,add.r2=F)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

annual.peak.event.error(sim,obs)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

annual.peak.timing.error(sim,obs)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

flowdurcurve.plot(myhyd$sim, prd='1999-10-01/2007-09-30',seasonal=F)
Error in as.POSIXlt.default(x, tz = tz(x)) :
do not know how to convert 'x' to class “POSIXlt”

I get the same error with the data from the RavenR as well as from my data.

Your help is highly appreciated.

Thank you
Elizabeth

Re: General Questions in Raven

Posted: Mon Jan 08, 2018 8:33 am
by ephilip
Good Morning Rob,

Not able to find the recently updated package in https://github.com/rchlumsk/RavenR/tree/master/tarballs

Please help

Thank you
Elizabeth



rchlumsk wrote:Hi Elizabeth

Related to this thread quoted here, the package has been updated and the mentioned functions should not be working. Let me know if you come across any more bugs.

Cheers,
Rob

ephilip wrote:
rchlumsk wrote:Hi Elizabeth

I believe you just need to pull the data from within the hydrograph object returned by hyd.read to pass it to the function. The error you get is recreated when a NULL object is passed to the function. Here is an example using the function from the sample data in RavenR, hopefully you can use that to help you with your own data.

Code: Select all

library(RavenR)
data(hydrograph.data) # sample dataset
myhyd <- hydrograph.data # same format as hyd.read function

# manually specify the sim and obs data, or use hyd.extract function
sim <- myhyd$hyd$Sub43
obs <- myhyd$hyd$Sub43_obs
# ?hyd.extract
# dd <- hyd.extract(subs="Sub43",myhyd)

annual.peak(sim,obs)


Cheers,
Rob


Good Morning Rob,

I tried the code you provided. It works with the data from RavenR for annual.peak(sim,obs). The function annual.peak(sim,obs) do work with my data as well. My post is not for annual.peak(sim,obs) but for the following functions:

annual.peak.event(sim,obs,add.r2=F)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

annual.peak.event.error(sim,obs)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

annual.peak.timing.error(sim,obs)
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied

flowdurcurve.plot(myhyd$sim, prd='1999-10-01/2007-09-30',seasonal=F)
Error in as.POSIXlt.default(x, tz = tz(x)) :
do not know how to convert 'x' to class “POSIXlt”

I get the same error with the data from the RavenR as well as from my data.

Your help is highly appreciated.

Thank you
Elizabeth

Re: General Questions in Raven

Posted: Mon Jan 08, 2018 10:20 am
by rchlumsk
Hi Elizabeth

I did not add the tarball for v1.0.5 this time, but you can install the latest package directly from GitHub using the devtools package.

Code: Select all

install.packages("devtools")
library(devtools)
devtools::install_github("rchlumsk/RavenR")


Check out the description of the RavenR package here: https://github.com/rchlumsk/RavenR

Cheers,
Rob