Beispiel #1
0
plt.show()


# plot
dfCrd = gageII.readData(
    varLst=['LAT_GAGE', 'LNG_GAGE'], siteNoLst=siteNoLst)
lat = dfCrd['LAT_GAGE'].values
lon = dfCrd['LNG_GAGE'].values
codePdf = usgs.codePdf


def funcMap():
    figM, axM = plt.subplots(2, 1, figsize=(8, 6))
    axplot.mapPoint(axM[0], lat, lon, errMatLst[0][:, 0, 1], s=12)
    axplot.mapPoint(axM[1], lat, lon, errMatLst[1][:, 0, 1], s=12)
    figP, axP = plt.subplots(1, 1, figsize=(8, 6))
    return figM, axM, figP, axP, lon, lat


def funcPoint(iP, axP):
    siteNo = siteNoLst[iP]
    dfPred1, dfObs1 = basins.loadSeq(outLst[0], siteNo)
    dfPred2, dfObs2 = basins.loadSeq(outLst[1], siteNo)
    t = dfPred1['date'].values.astype(np.datetime64)
    tBar = np.datetime64('2000-01-01')
    axplot.plotTS(axP, t, [dfPred1['00060'], dfPred2['00060'], dfObs2['00060']], tBar=tBar,
                  legLst=['w/ C', 'w/o C', 'obs'], styLst='---', cLst='bgr')


figplot.clickMap(funcMap, funcPoint)
Beispiel #2
0
    rmse1, corr1 = waterQuality.calErrSeq(dfP1[code], dfObs[code])
    t = dfObs.index.values
    tBar = np.datetime64('2000-01-01')
    axplot.plotTS(axP,
                  t, [dfP1[code], dfObs[code]],
                  tBar=tBar,
                  legLst=['LSTM', 'obs'],
                  styLst='-*',
                  cLst='br')
    tStr = '{}, rmse [{:.2f} {:.2f}], corr [{:.2f} {:.2f}]'.format(
        siteNo, rmse1[0], rmse1[1], corr1[0], corr1[1])
    axP.set_title(tStr)


importlib.reload(figplot)
figM, figP = figplot.clickMap(funcMap, funcPoint)

for ax in figP.axes:
    ax.set_xlim(np.datetime64('2010-01-01'), np.datetime64('2015-01-01'))
figP.canvas.draw()

for ax in figP.axes:
    ax.set_xlim(np.datetime64('1990-01-01'), np.datetime64('1995-01-01'))
figP.canvas.draw()

for ax in figP.axes:
    ax.set_xlim(np.datetime64('1980-01-01'), np.datetime64('2020-01-01'))
figP.canvas.draw()

for ax in figP.axes:
    ax.set_ylim(5, 30)