postprocessor = Postprocessor(hspfmodel, process_dates, comid = comid) # make the figure canvas fig = pyplot.figure(figsize = (15,9)) # font sizes titlesize = 14 axissize = 12 ticksize = 11 # get the monthly flows otimes, m_oflow = postprocessor.get_obs_flow(tstep = 'monthly') stimes, m_sflow = postprocessor.get_sim_flow(comid, tstep = 'monthly') # plot the monthly simulated versus the observed ax3 = pyplot.subplot2grid((2,3), (0,1), aspect = 'equal') ax3.set_title('Monthly Flow Parity Plot', size = titlesize) ax3.set_xlabel('Observed Monthly Flows (m\u00B3/s)', size = axissize) ax3.set_ylabel('Simulated Monthly Flows (m\u00B3/s)', size = axissize) # get the max value for the limits maxflow = max(max(m_oflow), max(m_sflow)) # add plot for the data
# dates for the calibration start = datetime.datetime(y, 1, 1) end = datetime.datetime(y + 2, 1, 1) ds = start, end # use the postprocessor to get the time series postprocessor = Postprocessor(hspfmodel, ds, comid=comid) # get the flows and other timeseries from the two-year calibration stimes, sflow = postprocessor.get_sim_flow(comid) otimes, oflow = postprocessor.get_obs_flow() ptimes, precip = postprocessor.get_precipitation(comid) etimes, evap = postprocessor.get_evaporation(comid) times, pet = postprocessor.get_pet(comid=comid) # close this postprocessor postprocessor.close() # get the flows for the thirty-year model i = ttimes.index(start) if end in ttimes: j = ttimes.index(end) thirty = tflow[i:j]
# dates for the calibration start = datetime.datetime(y, 1, 1) end = datetime.datetime(y + 2, 1, 1) ds = start, end # use the postprocessor to get the time series postprocessor = Postprocessor(hspfmodel, ds, comid = comid) # get the flows and other timeseries from the two-year calibration stimes, sflow = postprocessor.get_sim_flow(comid) otimes, oflow = postprocessor.get_obs_flow() ptimes, precip = postprocessor.get_precipitation(comid) etimes, evap = postprocessor.get_evaporation(comid) times, pet = postprocessor.get_pet(comid = comid) # close this postprocessor postprocessor.close() # get the flows for the thirty-year model i = ttimes.index(start) if end in ttimes: j = ttimes.index(end) thirty = tflow[i:j]
interflow = ifwo / area / (end - start).days * 365.25 baseflow = agwo / area / (end - start).days * 365.25 evapotranspiration = evap / area / (end - start).days * 365.25 # use the postprocessor to get the simulation stats dates = start,end postprocessor = Postprocessor(hspfmodel, dates, comid = comid) # get the NSE during the calibration period d = datetime.datetime(y, 1, 1), datetime.datetime(y + 2 , 1, 1) stimes, sflow = postprocessor.get_sim_flow(comid, tstep = 'daily', dates = d) otimes, oflow = postprocessor.get_obs_flow(tstep = 'daily', dates = d) NSEcalibration = (1 - sum((numpy.array(sflow)-numpy.array(oflow))**2) / sum((numpy.array(oflow) - numpy.mean(oflow))**2)) # get the total precipitation during the calibration period ptimes, precip = postprocessor.get_precipitation(comid, dates = d) precipitation = sum(precip) / (d[1] - d[0]).days * 365.25 # get the validation NSE stimes, sflow = postprocessor.get_sim_flow(comid, tstep = 'daily') otimes, oflow = postprocessor.get_obs_flow(tstep = 'daily')
postprocessor = Postprocessor(hspfmodel, process_dates, comid=comid) # make the figure canvas fig = pyplot.figure(figsize=(15, 9)) # font sizes titlesize = 14 axissize = 12 ticksize = 11 # get the monthly flows otimes, m_oflow = postprocessor.get_obs_flow(tstep='monthly') stimes, m_sflow = postprocessor.get_sim_flow(comid, tstep='monthly') # plot the monthly simulated versus the observed ax3 = pyplot.subplot2grid((2, 3), (0, 1), aspect='equal') ax3.set_title('Monthly Flow Parity Plot', size=titlesize) ax3.set_xlabel('Observed Monthly Flows (m\u00B3/s)', size=axissize) ax3.set_ylabel('Simulated Monthly Flows (m\u00B3/s)', size=axissize) # get the max value for the limits maxflow = max(max(m_oflow), max(m_sflow)) # add plot for the data