General Questions in Raven

Ask questions or report problems
rchlumsk
Posts: 156
Joined: Fri Sep 16, 2016 3:18 pm

Re: General Questions in Raven

Postby rchlumsk » Sat Nov 18, 2017 4:58 pm

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
Robert Chlumsky
rchlumsk@uwaterloo.ca

ephilip
Posts: 48
Joined: Sun Jun 25, 2017 8:37 pm

Re: General Questions in Raven

Postby ephilip » Mon Nov 20, 2017 7:59 am

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

rchlumsk
Posts: 156
Joined: Fri Sep 16, 2016 3:18 pm

Re: General Questions in Raven

Postby rchlumsk » Wed Nov 29, 2017 8:49 am

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
Robert Chlumsky
rchlumsk@uwaterloo.ca

ephilip
Posts: 48
Joined: Sun Jun 25, 2017 8:37 pm

Re: General Questions in Raven

Postby ephilip » Tue Dec 19, 2017 1:13 pm

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

Konhee Lee
Posts: 10
Joined: Thu Jun 22, 2017 1:35 pm

Re: General Questions in Raven

Postby Konhee Lee » Tue Dec 19, 2017 3:43 pm

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

ephilip
Posts: 48
Joined: Sun Jun 25, 2017 8:37 pm

Re: General Questions in Raven

Postby ephilip » Wed Dec 20, 2017 8:16 am

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

konhee93
Posts: 3
Joined: Thu Sep 07, 2017 9:41 pm

Re: General Questions in Raven

Postby konhee93 » Mon Jan 01, 2018 7:04 pm

Hello,

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

-Konhee

rchlumsk
Posts: 156
Joined: Fri Sep 16, 2016 3:18 pm

Re: General Questions in Raven

Postby rchlumsk » Sun Jan 07, 2018 5:35 pm

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
Robert Chlumsky
rchlumsk@uwaterloo.ca

ephilip
Posts: 48
Joined: Sun Jun 25, 2017 8:37 pm

Re: General Questions in Raven

Postby ephilip » Mon Jan 08, 2018 8:33 am

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

rchlumsk
Posts: 156
Joined: Fri Sep 16, 2016 3:18 pm

Re: General Questions in Raven

Postby rchlumsk » Mon Jan 08, 2018 10:20 am

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
Robert Chlumsky
rchlumsk@uwaterloo.ca


Return to “Help & Support”