Page 4 of 6

Re: Diagnostics and Calibration

Posted: Tue Sep 12, 2017 11:09 am
by konhee93
Hello Elizabeth,

Try sending all your input files to myself and Rob.

My email is k76lee@uwaterloo.ca

Re: Diagnostics and Calibration

Posted: Wed Sep 13, 2017 3:59 pm
by ephilip
Hi Lee,

While running the :EvaluationMetrics, I am getting the following error

WARNING : Invalid diagnostic (LOG_NASH) found in .rvi file
WARNING : Invalid diagnostic (KLING_GUPTA) found in .rvi file

Would you please help.

Thank you
Elizabeth

Re: Diagnostics and Calibration

Posted: Wed Sep 13, 2017 4:53 pm
by Konhee Lee
Hello Elizabeth,

Do the other diagnostics work fine?
If so, it might be a Raven version issue (the two diagnostics are latest additions to Raven).
Make sure you download the latest version of Raven (2.7).
Let me know if this fixes the issue.

Regards,
Konhee

Re: Diagnostics and Calibration

Posted: Thu Sep 14, 2017 8:26 am
by ephilip
Thank you, Lee

Re: Diagnostics and Calibration

Posted: Tue Oct 17, 2017 11:35 am
by ephilip
Greetings
Just a clarification: peak difference (PDIFF) given in page 93 calculates only the maximum peak difference for the time period of simulation run.

Re: Diagnostics and Calibration

Posted: Tue Oct 17, 2017 9:26 pm
by Konhee Lee
Hello,

PDIFF takes the maximum observation in the simulation period and the maximum simulated value in the simulation period and takes the difference.

Re: Diagnostics and Calibration

Posted: Tue Dec 05, 2017 1:45 pm
by Cameron
Hello I'm a Master student at Carleton University, and I've got a model up and running for my watershed. I am currently looking at the diagnostics, sensitivity and uncertainty. I'm running the GLUE algorithm in Ostrich which works well. The problem is however that I want to evaluate the upper and lower bounds of my model which has to be done at every time step. Currently I don't believe Ostrich has the capabilities to do this easily, therefore I would like to save every output (hydrograph.csv) from the GLUE algorithm and do it via R script, but the PreserveModelOutput keeps returning a error of:

'Raven' is not recognized as an internal or external command, operable program or batch file.
A subdirectory or file C:\Users\CAMERO~1\AppData\Local\Temp\mod0run1 already exists.

My Ostin.txt file looks like this

ProgramType GLUE
ObjectiveFunction GCOP
ModelExecutable Ost-RAVEN.bat
#PreserveBestModel save_best.bat
PreserveModelOutput yes

BeginFilePairs
JockGR4J.rvp.tpl; JockGR4J.rvp
EndFilePairs

#Parameter/DV Specification
BeginParams
...
...

I've tried a few different things but could use some help or suggestions.

Re: Diagnostics and Calibration

Posted: Tue Dec 05, 2017 10:54 pm
by rchlumsk
Hi Cameron

Glad to hear that Raven is being used over at Carleton! A couple of thoughts:

1) "'Raven' is not recognized as an internal or external command", you have likely done this already but just make sure that all of your references to the Raven executable are written out as Raven.exe (or whatever the full executable name is) rather than just "Raven"
2) I haven't experimented much with the Ostrich PreserveModelOutput feature, but in my work I have used either DOS/Unix or R (called within a DOS/Unix command) directly to save files, compile results, etc mid run. This can be done either directly in the model executable Ost-RAVEN.bat file or in the save_best.bat file, depending on the Ostrich mode and what you need.

If you like the second option, I would be happy to post a couple of code snippets to help you along.

Hope that helps! Let me know how it goes.
Rob

Re: Diagnostics and Calibration

Posted: Wed Dec 06, 2017 9:52 am
by Cameron
Hey Rob,

Thank you for the suggestions. I really like Raven, and its been a pleasure learning and using it.

The PreserveModelOuput works really well in the Demo 9 of Ostrich, but I also see that it saves the entire model, meaning I will run out of room fast on my HDD after a large number of runs if it does work with Raven. I am interested in the second option, and would appreciate code snippets as it will be more efficient then what I had in mind. The Ost-RAVEN.bat file or the save_best.bat should work, ideally I will be saving all the hydrograph.csv files and the associated diagnostic.csv file for each run, so I can build prediction intervals for the upper and lower bounds of the model. I am also prepared to store all the outputs as I'm sure it is going to take up a large amount of room.

Cheers,
Cameron

Re: Diagnostics and Calibration

Posted: Thu Dec 07, 2017 10:02 pm
by rchlumsk
Hi Cameron

I realized that my script did not do exactly what you need, since mine ran its own loop and controlled the Raven and Ostrich executables and had an iteration count internal to the DOS script, where as you need a global iteration variable accessible each time that ost-Raven.bat starts up. However, here is a code template and a couple of links to help you out, depending on whether you wish to use DOS to read in the iteration file and copy model outputs or just R.

Code: Select all

@echo off
cls REM automatically clear console

REM REM is a comment
ECHO Initializing ost-Raven.bat

REM run Raven from a parent folder, for example
REM adjust Raven.exe call to the name of the executable
cd ..
Raven.exe myfolder/modelname -o myfolder/output/
cd myfolder

REM ------------------
REM Copy relevant files to folder, DOS way
REM assume that you start with an iter.txt file of number 1 in order to store global variables
REM read in text file 'iter.txt', see URL link #1
REM store into variable called iter

REM Copy file with substituted prefix from iter variable
copy output/Hydrographs.csv storefilesfolder\%iter%_Hydrographs.csv /y
copy output/Diagnostics.csv storefilesfolder\%iter%_Diagnostics.csv /y

REM update iter.txt with new iteration
echo %iter%+1> iter.txt

REM ------------------
REM Copy relevant files to folder, R way
REM see URL number 2
Rscript copymyfiles.R   


https://stackoverflow.com/questions/2569640/dos-batch-command-to-read-some-info-from-text-file

https://stackoverflow.com/questions/238 ... copy-files

Hopefully this is enough of a boost to help you on your way. Let me know how it goes.
Cheers!
Rob