rcapell / HYPEtools

An R package for working with HYPE hydrological model files
GNU Lesser General Public License v3.0
17 stars 5 forks source link

GoF in PlotBasinOutput does not correspond with GoF from HYPE output. #133

Closed MaartenWynants closed 2 years ago

MaartenWynants commented 2 years ago

Hej,

In certain model settings, the GoF outputs from HYPE do not correspond with these I get when plotting these in PlotBasinOutput. See examples: plot_S_2017-2018 simass.txt In earlier HYPE setting these were exactly the same, so I was wondering what could explain these differences and what GoF I should trust here. Especially the difference in NSE is large. I saw in the code that hydroGOF gof gof.default is imported, but not sure what package is actually used? Are the values calculated again or just pasted from the HYPE outputs?

Regards, Maarten

rcapell commented 2 years ago

Hi Maarten, thanks for the report! I haven't run any tests yet, so cannot confirm your observation yet. A quick first reply:

/rené

MaartenWynants commented 2 years ago

Hej Rene,

As a quick response, the plotted periods are the same so it is not that. Also the domain only contains one gauge so that should be the same. Below is the subass for TS: subass6.txt I will have a look at this HydroGOF::gof package and a further look at the code, maybe there is an issue with what data it compares.

rcapell commented 2 years ago

Sounds good, thanks! One last question: which HYPE version are you using?

MaartenWynants commented 2 years ago

HYPE_5_18_0

rcapell commented 2 years ago

Now I got to look at this a bit. I cannot reproduce the problem. Attaching some test data with COUT/ROUT time series and an accompanying subass file. With

library(HYPEtools)
library(hydroGOF)

# import test results
bsn <- ReadBasinOutput("testbasinoutput.txt")
sbs <- ReadSubass("testsubass.txt")

NSE(bsn$COUT, bsn$ROUT)
# => -1.591414
KGE(bsn$COUT, bsn$ROUT)
# => -0.1366507
sbs$NSE
# => -1.5914
sbs$KGE
# => -0.1367

PlotBasinOutput(bsn, driver = "screen", area = 873*10^6)

NSE(bsn$COUT[1:100], bsn$ROUT[1:100])
PlotBasinOutput(bsn, driver = "screen", area = 873*10^6, from = 1, to = 100)

image

Everything seems to be ok. Could you cross-check/am I missing something? HYPE 5.18.0 HYPEtools latest master hydroGOF 0.4.0

testbasinoutput.txt testsubass.txt h

c-brendel commented 2 years ago

Closing as non-reproducible after conversation with Maarten