from hydroDL import kPath, utils import importlib import time import numpy as np from hydroDL.data import usgs, gageII, gridMET, ntn, transform caseLst = ['0801', '0802', '0803', '0804', '0805', '0902', '0903', '0904'] dataName = 'Q90ref' dm = dbBasin.DataModelFull(dataName) outName = '{}-B10'.format(dataName) yP, ycP = basinFull.testModel( outName, DM=dm, batchSize=20, testSet='all') yO, ycO = basinFull.getObs(outName, 'all', DM=dm) indT = np.where(dm.t == np.datetime64('2010-01-01'))[0][0] nash0 = utils.stat.calNash(yP[indT:, :, 0], yO[indT:, :, 0]) rmse0 = utils.stat.calRmse(yP[indT:, :, 0], yO[indT:, :, 0]) corr0 = utils.stat.calCorr(yP[indT:, :, 0], yO[indT:, :, 0]) bias0 = utils.stat.calBias(yP[indT:, :, 0], yO[indT:, :, 0]) nashLst = list() rmseLst = list() corrLst = list() biasLst = list() for case in caseLst: testSet = 'EcoB'+case nashLstTemp = list()
import time import numpy as np from hydroDL.data import usgs, gageII, gridMET, ntn, transform import matplotlib dataName = 'Q90ref' dm = dbBasin.DataModelFull(dataName) indT = np.where(dm.t == np.datetime64('2010-01-01'))[0][0] # global model nashLst1 = list() rmseLst1 = list() corrLst1 = list() outName = '{}-B10'.format(dataName) yP, ycP = basinFull.testModel(outName, DM=dm, batchSize=20, testSet='all') yO, ycO = basinFull.getObs(outName, 'all', DM=dm) corr1 = utils.stat.calCorr(yP[:indT, :, 0], yO[:indT, :, 0]) corr2 = utils.stat.calCorr(yP[indT:, :, 0], yO[indT:, :, 0]) # tsMap siteNoLst = dm.siteNoLst dfCrd = gageII.readData(varLst=['LAT_GAGE', 'LNG_GAGE'], siteNoLst=siteNoLst) lat = dfCrd['LAT_GAGE'].values lon = dfCrd['LNG_GAGE'].values def funcMap(): figM, axM = plt.subplots(1, 1, figsize=(12, 4)) axplot.mapPoint(axM, lat, lon, corr2, vRange=[0.5, 1], s=16) axM.set_title('corr LSTM streamflow') figP = plt.figure(figsize=[16, 6])