def __init__( self, model, obs, varid, seasonid='ANN', region=None, aux=None, names={}, plotparms=None): """filetable1, filetable2 should be filetables for each model. varid is a string, e.g. 'TREFHT'. The seasonal difference is Seasonid It is is a string, e.g. 'DJF-JJA'. """ filetable1, filetable2 = self.getfts(model, obs) import string #pdb.set_trace() modelfn = filetable1._filelist.files[0] obsfn = filetable2._filelist.files[0] self.legendTitles = [modelfn.split('/')[-1:][0], obsfn.split('/')[-1:][0]] self.legendComplete = {} self.StationData = stationData.stationData(filetable2._filelist.files[0]) plot_plan.__init__(self, seasonid) self.plottype = 'Scatter' ft1id, ft2id = filetable_ids(filetable1, filetable2) self.filetable_ids = [ft1id, ft2id] self.months = ['JAN', 'APR', 'JUL', 'OCT'] station = aux self.lat, self.lon = self.StationData.getLatLon(station) self.compositeTitle = defines.station_names[station]+'\n'+ \ 'latitude = ' + str(self.lat) + ' longitude = ' + str(self.lon) self.plotCompositeTitle = True self.IDsandUnits = None self.plot_ids = self.months self.plotall_id = 'all_seasons' if not self.computation_planned: self.plan_computation( model, obs, varid, station, plotparms )
def __init__( self, model, obs, varid, seasonid=None, region=None, aux=slice(0,None), names={}, plotparms=None ): """filetable1, filetable2 should be filetables for model and obs. varid is a string identifying the variable to be plotted, e.g. 'TREFHT'. seasonid is a string such as 'DJF'.""" if aux==None: aux=slice(0,None) filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self,seasonid) self.plottype = 'Isofill_polar' if plotparms is None: plotparms = { 'model':{'colormap':'rainbow'}, 'obs':{'colormap':'rainbow'}, 'diff':{'colormap':'bl_to_darkred'} } self.season = cdutil.times.Seasons(self._seasonid) # note that self._seasonid can differ froms seasonid self.region = region self.varid = varid ft1id,ft2id = filetable_ids(filetable1, filetable2) self.plot1_id = ft1id+'_'+varid+'_'+seasonid self.plot2_id = ft2id+'_'+varid+'_'+seasonid self.plot3_id = ft1id+' - '+ft2id+'_'+varid+'_'+seasonid self.plotall_id = ft1id+'_'+ft2id+'_'+varid+'_'+seasonid if not self.computation_planned: self.plan_computation( model, obs, varid, seasonid, region, aux, names=names, plotparms=plotparms )
def __init__( self, model, obs, varid, seasonid='ANN', region=None, aux=None, names={}, plotparms=None ): filetable1, filetable2 = self.getfts(model, obs) """filetable1, filetable2 should be filetables for each model. varid is a string, e.g. 'TREFHT'. The seasonal difference is Seasonid It is is a string, e.g. 'DJF-JJA'. """ import string plot_plan.__init__(self, seasonid) self.plottype = 'Scatter' self._seasonid = seasonid self.season = cdutil.times.Seasons(self._seasonid) ft1id, ft2id = filetable_ids(filetable1, filetable2) self.datatype = ['model', 'obs'] self.filetables = [filetable1, filetable2] self.filetable_ids = [ft1id, ft2id] self.seasons = ['ANN', 'DJF', 'JJA'] self.vars = ['LWCF', 'SWCF'] self.ft_ids = {} for dt, ft in zip(self.datatype, self.filetables): fn = ft._files[0] self.ft_ids[dt] = fn.split('/')[-1:][0] self.plot_ids = [] vars_id = '_'.join(self.vars) for season in self.seasons: for dt in self.datatype: plot_id = '_'.join([dt, season]) self.plot_ids += [plot_id] self.plotall_id = '_'.join(self.datatype + ['Warm', 'Pool']) if not self.computation_planned: self.plan_computation( model, obs, varid, seasonid, plotparms )
def __init__( self, model, obs, varnom, seasonid=None, region=None, aux=None, names={}, plotparms=None ): """filetable1, filetable2 should be filetables for model and obs. varnom is a string. The variable described may depend on time,lat,lon and will be averaged in those dimensions. But it also should have two other axes which will be used for the histogram. Seasonid is a string, e.g. 'DJF'. Region is an instance of the class rectregion (region.py). """ filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self,seasonid) region = interpret_region(region) self.reduced_variables = {} self.derived_variables = {} self.plottype = 'Boxfill' if plotparms is None: plotparms = { 'model':{'colormap':'rainbow'}, 'obs':{'colormap':'rainbow'}, 'diff':{'colormap':'bl_to_darkred'} } self.season = cdutil.times.Seasons(self._seasonid) # note that self._seasonid can differ froms seasonid ft1id,ft2id = filetable_ids(filetable1,filetable2) self.plot1_id = '_'.join([ft1id,varnom,seasonid,str(region),'histo']) self.plot2_id = '_'.join([ft2id,varnom,seasonid,str(region),'histo']) self.plot3_id = '_'.join([ft1id+'-'+ft2id,varnom,seasonid,str(region),'histo']) self.plotall_id = '_'.join([ft1id,ft2id,varnom,seasonid]) if not self.computation_planned: self.plan_computation( model, obs, varnom, seasonid, region, plotparms )
def __init__( self, model, obs, varid, seasonid=None, regionid=None, aux=None, names={}, plotparms=None ): """filetable1, filetable2 should be filetables for model and obs. varid is a string identifying the variable to be plotted, e.g. 'STRESS'. seasonid is a string such as 'DJF'.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self,seasonid) if plotparms is None: plotparms = { 'model':{'colormap':'rainbow'}, 'obs':{'colormap':'rainbow'}, 'diff':{'colormap':'bl_to_darkred'} } # self.plottype = ['Isofill','Vector'] <<<< later we'll add contour plots self.plottype = 'Vector' self.season = cdutil.times.Seasons(self._seasonid) # note that self._seasonid can differ froms seasonid if regionid=="Global" or regionid=="global" or regionid is None: self._regionid="Global" else: self._regionid=regionid self.region = interpret_region(regionid) self.varid = varid ft1id,ft2id = filetable_ids(filetable1,filetable2) self.plot1_id = ft1id+'_'+varid+'_'+seasonid self.plot2_id = ft2id+'_'+varid+'_'+seasonid self.plot3_id = ft1id+' - '+ft2id+'_'+varid+'_'+seasonid self.plotall_id = ft1id+'_'+ft2id+'_'+varid+'_'+seasonid if not self.computation_planned: self.plan_computation( model, obs, varid, seasonid, aux, plotparms )
def __init__( self, model, obs, varid, seasonid=None, regionid=None, aux=None, names={}, plotparms=None ): """filetable1, filetable2 should be filetables for model and obs. varid is a string, e.g. 'TREFHT'. Seasonid is a string, e.g. 'DJF'. At the moment we assume that data from filetable1 has CAM hybrid levels, and data from filetable2 has pressure levels.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self,seasonid) self.plottype = 'Isofill' if plotparms is None: plotparms = { 'model':{'colormap':'rainbow'}, 'obs':{'colormap':'rainbow'}, 'diff':{'colormap':'bl_to_darkred'} } self.season = cdutil.times.Seasons(self._seasonid) # note that self._seasonid can differ froms seasonid if regionid=="Global" or regionid=="global" or regionid is None: self._regionid="Global" else: self._regionid=regionid self.region = interpret_region(regionid) ft1id,ft2id = filetable_ids(filetable1,filetable2) self.plot1_id = '_'.join([ft1id,varid,seasonid,'contour']) self.plot2_id = '_'.join([ft2id,varid,seasonid,'contour']) self.plot3_id = '_'.join([ft1id+'-'+ft2id,varid,seasonid,'contour']) self.plotall_id = '_'.join([ft1id,ft2id,varid,seasonid]) if not self.computation_planned: self.plan_computation( model, obs, varid, seasonid, names, plotparms )
def __init__( self, model, obs, varid, seasonid=None, regionid=None, aux=None, names={}, plotparms=None ): """filetable1, filetable2 should be filetables for model and obs. varid is a string identifying the variable to be plotted, e.g. 'TREFHT'. seasonid is a string such as 'DJF'.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self,seasonid, regionid) self.plottype = 'Isofill' if plotparms is None: plotparms = { 'model':{'colormap':'rainbow'}, 'obs':{'colormap':'rainbow'}, 'diff':{'colormap':'bl_to_darkred'} } self.season = cdutil.times.Seasons(self._seasonid) # note that self._seasonid can differ froms seasonid if regionid=="Global" or regionid=="global" or regionid is None: self._regionid="Global" else: self._regionid=regionid self.region = interpret_region(regionid) self.varid = varid self.ft1nom,self.ft2nom = filetable_names(filetable1,filetable2) self.ft1nickname,self.ft2nickname = filetable_nicknames(filetable1,filetable2) ft1id,ft2id = filetable_ids(filetable1,filetable2) self.reduced_variables = {} self.derived_variables = {} self.plot1_id = ft1id+'_'+varid+'_'+seasonid self.plot2_id = ft2id+'_'+varid+'_'+seasonid self.plot3_id = ft1id+' - '+ft2id+'_'+varid+'_'+seasonid self.plot1var_id = ft1id+'_'+varid+'_var_'+seasonid self.plotall_id = ft1id+'_'+ft2id+'_'+varid+'_'+seasonid if not self.computation_planned: self.plan_computation( model, obs, varid, seasonid, aux, names, plotparms )
def __init__(self, model, obs, varid, seasonid=None, region=None, aux=None, names={}, plotparms=None): """filetable1, filetable2 should be filetables for model and obs. varid is a string identifying the derived variable to be plotted, e.g. 'Ocean_Heat'. The seasonid argument will be ignored.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self, seasonid) self.season = cdutil.times.Seasons( self._seasonid ) # note that self._seasonid can differ froms seasonid self.plottype = 'Yxvsx' vars = self._list_variables(model, obs) if varid not in vars: logger.info( "In amwg_plot_set2 __init__, ignoring varid input, will compute Ocean_Heat" ) varid = vars[0] logger.warning( "amwg_plot_set2 only uses NCEP obs, and will ignore any other obs specification." ) # TO DO: Although model vs NCEP obs is all that NCAR does, there's no reason why we # TO DO: shouldn't support something more general, at least model vs model. if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, plotparms)
def __init__(self, model, obs, varid, seasonid='ANN', region='global', aux=None, names={}, plotparms=None): """filetable1, should be a directory filetable for each model. varid is a string, e.g. 'TREFHT'. The zonal mean is computed for each month. """ filetable1, filetable2 = self.getfts(model, obs) self.season = seasonid self.FT1 = (filetable1 != None) self.FT2 = (filetable2 != None) self.CONTINUE = self.FT1 if not self.CONTINUE: logger.info("user must specify a file table") return None self.filetables = [filetable1] if self.FT2: self.filetables += [filetable2] if region in ["Global", "global", None]: self._regionid = "Global" else: self._regionid = region self.region = interpret_region(self._regionid) plot_plan.__init__(self, seasonid) if plotparms is None: plotparms = { 'model': { 'colormap': 'rainbow' }, 'obs': { 'colormap': 'rainbow' }, 'diff': { 'colormap': 'bl_to_darkred' } } self.plottype = 'Isofill' self._seasonid = seasonid self.season = cdutil.times.Seasons( self._seasonid ) # note that self._seasonid can differ froms seasonid ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot1_id = '_'.join([ft1id, varid, 'composite', 'contour']) if self.FT2: self.plot2_id = '_'.join([ft2id, varid, 'composite', 'contour']) self.plot3_id = '_'.join( [ft1id + '-' + ft2id, varid, seasonid, 'contour']) self.plotall_id = '_'.join([ft1id, ft2id, varid, seasonid]) if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, plotparms)
def __init__(self, model, obs, varid, seasonid='DJF-JJA', regionid=None, aux=None, names={}, plotparms=None): filetable1, filetable2 = self.getfts(model, obs) """filetable1, filetable2 should be filetables for each model. varid is a string, e.g. 'TREFHT'. The seasonal difference is Seasonid It is is a string, e.g. 'DJF-JJA'. """ import string #the following is for future case of setting 2 seasons if "-" in seasonid: _seasons = string.split(seasonid, '-') if len(_seasons) == 2: self._s1, self._s2 = _seasons else: self._s1 = 'DJF' self._s2 = 'JJA' seasonid = 'DJF-JJA' if regionid == "Global" or regionid == "global" or regionid is None: self._regionid = "Global" else: self._regionid = regionid self.region = interpret_region(regionid) plot_plan.__init__(self, seasonid) self.plottype = 'Isofill' if plotparms is None: plotparms = { 'model': { 'colormap': 'rainbow' }, 'obs': { 'colormap': 'rainbow' }, 'diff': { 'colormap': 'bl_to_darkred' } } self._seasonid = seasonid self.season = cdutil.times.Seasons( self._seasonid ) # note that self._seasonid can differ froms seasonid ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot1_id = '_'.join([ft1id, varid, self._s1, 'contour']) self.plot2_id = '_'.join([ft2id, varid, self._s2, 'contour']) self.plot3_id = '_'.join( [ft1id + '-' + ft2id, varid, seasonid, 'contour']) self.plotall_id = '_'.join([ft1id, ft2id, varid, seasonid]) if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, plotparms)
def __init__( self, model, obs, varnom, seasonid=None, regionid=None, aux=None, names={}, plotparms=None ): """filetable1, filetable2 should be filetables for model and obs. varnom is a string, e.g. 'TREFHT'. Seasonid is a string, e.g. 'DJF'.""" plot_plan.__init__(self,seasonid) self.season = cdutil.times.Seasons(self._seasonid) # note that self._seasonid can differ froms seasonid self.region, self._regionid, idregionid = interpret_region2( regionid ) basic_id.__init__(self,'set3',varnom,seasonid,idregionid) if not self.computation_planned: self.plan_computation( model, obs, varnom, seasonid, plotparms )
def __init__(self, model, obs, varid, seasonid=None, regionid=None, aux=None, names={}, plotparms=None): """filetable1, filetable2 should be filetables for model and obs. varid is a string identifying the variable to be plotted, e.g. 'TREFHT'. seasonid is a string such as 'DJF'.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self, seasonid, regionid) self.plottype = 'Isofill' if plotparms is None: plotparms = { 'model': { 'colormap': 'rainbow' }, 'obs': { 'colormap': 'rainbow' }, 'diff': { 'colormap': 'bl_to_darkred' } } self.season = cdutil.times.Seasons( self._seasonid ) # note that self._seasonid can differ froms seasonid if regionid == "Global" or regionid == "global" or regionid is None: self._regionid = "Global" else: self._regionid = regionid self.region = interpret_region(regionid) self.varid = varid self.ft1nom, self.ft2nom = filetable_names(filetable1, filetable2) self.ft1nickname, self.ft2nickname = filetable_nicknames( filetable1, filetable2) ft1id, ft2id = filetable_ids(filetable1, filetable2) self.reduced_variables = {} self.derived_variables = {} self.plot1_id = ft1id + '_' + varid + '_' + seasonid self.plot2_id = ft2id + '_' + varid + '_' + seasonid self.plot3_id = ft1id + ' - ' + ft2id + '_' + varid + '_' + seasonid self.plot1var_id = ft1id + '_' + varid + '_var_' + seasonid self.plotall_id = ft1id + '_' + ft2id + '_' + varid + '_' + seasonid if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, aux, names, plotparms)
def __init__(self, model, obs, varid, seasonid=None, region=None, aux=slice(0, None), names={}, plotparms=None): """filetable1, filetable2 should be filetables for model and obs. varid is a string identifying the variable to be plotted, e.g. 'TREFHT'. seasonid is a string such as 'DJF'.""" if aux == None: aux = slice(0, None) filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self, seasonid) self.plottype = 'Isofill_polar' if plotparms is None: plotparms = { 'model': { 'colormap': 'rainbow' }, 'obs': { 'colormap': 'rainbow' }, 'diff': { 'colormap': 'bl_to_darkred' } } self.season = cdutil.times.Seasons( self._seasonid ) # note that self._seasonid can differ froms seasonid self.region = region self.varid = varid ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot1_id = ft1id + '_' + varid + '_' + seasonid self.plot2_id = ft2id + '_' + varid + '_' + seasonid self.plot3_id = ft1id + ' - ' + ft2id + '_' + varid + '_' + seasonid self.plotall_id = ft1id + '_' + ft2id + '_' + varid + '_' + seasonid if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, region, aux, names=names, plotparms=plotparms)
def __init__(self, model, obs, varid, seasonid='JAN', region=None, aux=None, names={}, plotparms=None): """filetable1, filetable2 should be filetables for each model. varid is a string, e.g. 'TREFHT'. The seasonal difference is Seasonid It is is a string, e.g. 'DJF-JJA'. """ import string #pdb.set_trace() self.modelfns = [] self.obsfns = [] for ft in model: modelfn = ft._filelist.files[0] self.modelfns += [modelfn] for ft in obs: obsfn = ft._filelist.files[0] self.obsfns = [obsfn] self.legendTitles = [] plot_plan.__init__(self, seasonid) self.plottype = 'Taylordiagram' self._seasonid = seasonid self.season = cdutil.times.Seasons(self._seasonid) #ft1id, ft2id = filetable_ids(filetable1, filetable2) self.datatype = ['model', 'obs'] self.filetables = model if type(obs) is list and len(obs) > 0: self.filetable2 = obs[0] else: self.filetable2 = obs #self.filetable_ids = [ft1id, ft2id] #vardi is a list of variables self.vars = varid self.plot_ids = [] #vars_id = '_'.join(self.vars) #for dt in self.datatype: plot_id = 'Taylor' self.plot_ids += [plot_id] if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, aux, plotparms)
def __init__( self, model, obs, varnom, seasonid='ANN', regionid=None, aux=None, names={}, plotparms=None ): """filetable1, filetable2 should be filetables for model and obs. varnom is a string, e.g. 'TREFHT'. Seasonid is a string, e.g. 'DJF'.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self, seasonid) self.plottype = 'Yxvsx' self.season = cdutil.times.Seasons(self._seasonid) ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot_id = '_'.join([ft1id, ft2id, varnom, self.plottype]) region, self._regionid, idregionid = interpret_region2( regionid ) basic_id.__init__(self,'set10',varnom,seasonid,idregionid) self.computation_planned = False if not self.computation_planned: self.plan_computation( model, obs, varnom, seasonid, plotparms )
def __init__(self, model, obs, varid, seasonid=None, regionid=None, aux=None, names={}, plotparms=None): """filetable1, filetable2 should be filetables for model and obs. varid is a string identifying the variable to be plotted, e.g. 'STRESS'. seasonid is a string such as 'DJF'.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self, seasonid) if plotparms is None: plotparms = { 'model': { 'colormap': 'rainbow' }, 'obs': { 'colormap': 'rainbow' }, 'diff': { 'colormap': 'bl_to_darkred' } } # self.plottype = ['Isofill','Vector'] <<<< later we'll add contour plots self.plottype = 'Vector' self.season = cdutil.times.Seasons( self._seasonid ) # note that self._seasonid can differ froms seasonid if regionid == "Global" or regionid == "global" or regionid is None: self._regionid = "Global" else: self._regionid = regionid self.region = interpret_region(regionid) self.varid = varid ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot1_id = ft1id + '_' + varid + '_' + seasonid self.plot2_id = ft2id + '_' + varid + '_' + seasonid self.plot3_id = ft1id + ' - ' + ft2id + '_' + varid + '_' + seasonid self.plotall_id = ft1id + '_' + ft2id + '_' + varid + '_' + seasonid if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, aux, plotparms)
def __init__(self, model, obs, varid, seasonid=None, regionid=None, aux=None, names={}, plotparms=None): """filetable1, filetable2 should be filetables for model and obs. varid is a string, e.g. 'TREFHT'. Seasonid is a string, e.g. 'DJF'. At the moment we assume that data from filetable1 has CAM hybrid levels, and data from filetable2 has pressure levels.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self, seasonid) self.plottype = 'Isofill' if plotparms is None: plotparms = { 'model': { 'colormap': 'rainbow' }, 'obs': { 'colormap': 'rainbow' }, 'diff': { 'colormap': 'bl_to_darkred' } } self.season = cdutil.times.Seasons( self._seasonid ) # note that self._seasonid can differ froms seasonid if regionid == "Global" or regionid == "global" or regionid is None: self._regionid = "Global" else: self._regionid = regionid self.region = interpret_region(regionid) ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot1_id = '_'.join([ft1id, varid, seasonid, 'contour']) self.plot2_id = '_'.join([ft2id, varid, seasonid, 'contour']) self.plot3_id = '_'.join( [ft1id + '-' + ft2id, varid, seasonid, 'contour']) self.plotall_id = '_'.join([ft1id, ft2id, varid, seasonid]) if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, names, plotparms)
def __init__( self, model, obs, varid, seasonid='JAN', region=None, aux=None, names={}, plotparms=None ): """filetable1, filetable2 should be filetables for each model. varid is a string, e.g. 'TREFHT'. The seasonal difference is Seasonid It is is a string, e.g. 'DJF-JJA'. """ import string #pdb.set_trace() self.modelfns = [] self.obsfns = [] for ft in model: modelfn = ft._filelist.files[0] self.modelfns += [modelfn] for ft in obs: obsfn = ft._filelist.files[0] self.obsfns = [obsfn] self.legendTitles = [] plot_plan.__init__(self, seasonid) self.plottype = 'Taylordiagram' self._seasonid = seasonid self.season = cdutil.times.Seasons(self._seasonid) #ft1id, ft2id = filetable_ids(filetable1, filetable2) self.datatype = ['model', 'obs'] self.filetables = model if type(obs) is list and len(obs)>0: self.filetable2 = obs[0] else: self.filetable2 = obs #self.filetable_ids = [ft1id, ft2id] #vardi is a list of variables self.vars = varid self.plot_ids = [] #vars_id = '_'.join(self.vars) #for dt in self.datatype: plot_id = 'Taylor' self.plot_ids += [plot_id] if not self.computation_planned: self.plan_computation( model, obs, varid, seasonid, aux, plotparms )
def __init__(self, model, obs, varid, seasonid='ANN', region=None, aux=None, names={}, plotparms=None): filetable1, filetable2 = self.getfts(model, obs) """filetable1, filetable2 should be filetables for each model. varid is a string, e.g. 'TREFHT'. The seasonal difference is Seasonid It is is a string, e.g. 'DJF-JJA'. """ import string plot_plan.__init__(self, seasonid) self.plottype = 'Scatter' self._seasonid = seasonid self.season = cdutil.times.Seasons(self._seasonid) ft1id, ft2id = filetable_ids(filetable1, filetable2) self.datatype = ['model', 'obs'] self.filetables = [filetable1, filetable2] self.filetable_ids = [ft1id, ft2id] self.seasons = ['ANN', 'DJF', 'JJA'] self.vars = ['LWCF', 'SWCF'] self.ft_ids = {} for dt, ft in zip(self.datatype, self.filetables): fn = ft._files[0] self.ft_ids[dt] = fn.split('/')[-1:][0] self.plot_ids = [] vars_id = '_'.join(self.vars) for season in self.seasons: for dt in self.datatype: plot_id = '_'.join([dt, season]) self.plot_ids += [plot_id] self.plotall_id = '_'.join(self.datatype + ['Warm', 'Pool']) if not self.computation_planned: self.plan_computation(model, obs, varid, seasonid, plotparms)
def __init__( self, model, obs, varid, seasonid='ANN', region='global', aux=None, names={}, plotparms=None ): """filetable1, should be a directory filetable for each model. varid is a string, e.g. 'TREFHT'. The zonal mean is computed for each month. """ filetable1, filetable2 = self.getfts(model, obs) self.season = seasonid self.FT1 = (filetable1 != None) self.FT2 = (filetable2 != None) self.CONTINUE = self.FT1 if not self.CONTINUE: logger.info("user must specify a file table") return None self.filetables = [filetable1] if self.FT2: self.filetables +=[filetable2] if region in ["Global", "global", None]: self._regionid="Global" else: self._regionid=region self.region = interpret_region(self._regionid) plot_plan.__init__(self, seasonid) if plotparms is None: plotparms = { 'model':{'colormap':'rainbow'}, 'obs':{'colormap':'rainbow'}, 'diff':{'colormap':'bl_to_darkred'} } self.plottype = 'Isofill' self._seasonid = seasonid self.season = cdutil.times.Seasons(self._seasonid) # note that self._seasonid can differ froms seasonid ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot1_id = '_'.join([ft1id, varid, 'composite', 'contour']) if self.FT2: self.plot2_id = '_'.join([ft2id, varid, 'composite', 'contour']) self.plot3_id = '_'.join([ft1id+'-'+ft2id, varid, seasonid, 'contour']) self.plotall_id = '_'.join([ft1id,ft2id, varid, seasonid]) if not self.computation_planned: self.plan_computation( model, obs, varid, seasonid, plotparms )
def __init__(self, model, obs, varnom, seasonid=None, regionid=None, aux=None, names={}, plotparms=None): """filetable1, filetable2 should be filetables for model and obs. varnom is a string, e.g. 'TREFHT'. Seasonid is a string, e.g. 'DJF'.""" plot_plan.__init__(self, seasonid) self.season = cdutil.times.Seasons( self._seasonid ) # note that self._seasonid can differ froms seasonid self.region, self._regionid, idregionid = interpret_region2(regionid) basic_id.__init__(self, 'set3', varnom, seasonid, idregionid) if not self.computation_planned: self.plan_computation(model, obs, varnom, seasonid, plotparms)
def __init__( self, model, obs, varid, seasonid='DJF-JJA', regionid=None, aux=None, names={}, plotparms=None ): filetable1, filetable2 = self.getfts(model, obs) """filetable1, filetable2 should be filetables for each model. varid is a string, e.g. 'TREFHT'. The seasonal difference is Seasonid It is is a string, e.g. 'DJF-JJA'. """ import string #the following is for future case of setting 2 seasons if "-" in seasonid: _seasons = string.split(seasonid, '-') if len(_seasons) == 2: self._s1, self._s2 = _seasons else: self._s1 = 'DJF' self._s2 = 'JJA' seasonid = 'DJF-JJA' if regionid=="Global" or regionid=="global" or regionid is None: self._regionid="Global" else: self._regionid=regionid self.region = interpret_region(regionid) plot_plan.__init__(self, seasonid) self.plottype = 'Isofill' if plotparms is None: plotparms = { 'model':{'colormap':'rainbow'}, 'obs':{'colormap':'rainbow'}, 'diff':{'colormap':'bl_to_darkred'} } self._seasonid = seasonid self.season = cdutil.times.Seasons(self._seasonid) # note that self._seasonid can differ froms seasonid ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot1_id = '_'.join([ft1id, varid, self._s1, 'contour']) self.plot2_id = '_'.join([ft2id, varid, self._s2, 'contour']) self.plot3_id = '_'.join([ft1id+'-'+ft2id, varid, seasonid, 'contour']) self.plotall_id = '_'.join([ft1id,ft2id, varid, seasonid]) if not self.computation_planned: self.plan_computation( model, obs, varid, seasonid, plotparms )
def __init__(self, model, obs, varnom, seasonid='ANN', regionid=None, aux=None, names={}, plotparms=None): """filetable1, filetable2 should be filetables for model and obs. varnom is a string, e.g. 'TREFHT'. Seasonid is a string, e.g. 'DJF'.""" filetable1, filetable2 = self.getfts(model, obs) plot_plan.__init__(self, seasonid) self.plottype = 'Yxvsx' self.season = cdutil.times.Seasons(self._seasonid) ft1id, ft2id = filetable_ids(filetable1, filetable2) self.plot_id = '_'.join([ft1id, ft2id, varnom, self.plottype]) region, self._regionid, idregionid = interpret_region2(regionid) basic_id.__init__(self, 'set10', varnom, seasonid, idregionid) self.computation_planned = False if not self.computation_planned: self.plan_computation(model, obs, varnom, seasonid, plotparms)