def plotStation(standx) : good_plot=None # check with time window field to see if it has a ok time window string try : tw = timeWindow(twf.getText()); except Exception, e: JOptionPane.showMessageDialog(None,e.getMessage()) twf.setText(repr(tw))
sta_obs=BList_obs[standx] f_obs=FList_obs[standx] plotList = [] # loop over instantaneous and residual plots for data_type in ['inst', 'resid']: print "Station", sta_obs, data_type # # for both model and observed data, each curve will actually # be two curves: one for actual data, the other a different # color and thickness for when MTZ historic stage is good # # model data gsm=group_mdl.clone() # start with a copy of model stage data gsm.filterBy(sta_mdl) # reduce to just this station if len(gsm) == 0: # check there is data for this station JOptionPane.showMessageDialog(None, "Couldn't find model data for " + repr(sta_mdl)) break if len(gsm) > 1: # if true, you'll have to filter by the A or F part JOptionPane.showMessageDialog(None, "Too many model paths, add a filter for A and/or F part"+ repr(gsm)) break ref_mdl = DataReference.create(gsm[0],tw) if ref_mdl==None: # check for data for this tw JOptionPane.showMessageDialog(None, "No Model data for time window " + repr(tw) ) break if data_type=='resid': # convert to 1 day interval for resid plot ref_mdl=per_avg(ref_mdl,interval='1DAY') path_mdl=ref_mdl.getPathname() apart_mdl = path_mdl.getPart(path_mdl.A_PART) epart_mdl = path_mdl.getPart(path_mdl.E_PART)