Diagnostics and Calibration

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

Re: Diagnostics and Calibration

Postby konhee93 » Tue Sep 12, 2017 11:09 am

Hello Elizabeth,

Try sending all your input files to myself and Rob.

My email is k76lee@uwaterloo.ca

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

Re: Diagnostics and Calibration

Postby ephilip » Wed Sep 13, 2017 3:59 pm

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

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

Re: Diagnostics and Calibration

Postby Konhee Lee » Wed Sep 13, 2017 4:53 pm

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

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

Re: Diagnostics and Calibration

Postby ephilip » Thu Sep 14, 2017 8:26 am

Thank you, Lee

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

Re: Diagnostics and Calibration

Postby ephilip » Tue Oct 17, 2017 11:35 am

Greetings
Just a clarification: peak difference (PDIFF) given in page 93 calculates only the maximum peak difference for the time period of simulation run.

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

Re: Diagnostics and Calibration

Postby Konhee Lee » Tue Oct 17, 2017 9:26 pm

Hello,

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

Cameron
Posts: 2
Joined: Tue Dec 05, 2017 1:29 pm

Re: Diagnostics and Calibration

Postby Cameron » Tue Dec 05, 2017 1:45 pm

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.

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

Re: Diagnostics and Calibration

Postby rchlumsk » Tue Dec 05, 2017 10:54 pm

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

Cameron
Posts: 2
Joined: Tue Dec 05, 2017 1:29 pm

Re: Diagnostics and Calibration

Postby Cameron » Wed Dec 06, 2017 9:52 am

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

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

Re: Diagnostics and Calibration

Postby rchlumsk » Thu Dec 07, 2017 10:02 pm

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


Return to “Modelling Approaches and Tips”