def __init__( self, **kwargs ): self.StationDict = kwargs.get( 'StationDict', np.load( os.path.join( os.path.dirname(__file__), 'stations.npz' ) ) ) self.GridFile = kwargs.get( 'GridFile', np.load( os.path.join( os.path.dirname(__file__), 'sfcoa_lonlats.npz' ) ) ) self.gridlons = self.GridFile[ 'lons' ] self.gridlats = self.GridFile[ 'lats' ] self.area = kwargs.get( 'area', 'CONUS' ) self.DataDict = kwargs.get( 'datdict' ) self.TendDict = kwargs.get( 'tenddict' ) mproj = proj( area=self.area, stations=self.StationDict ) self.m = mproj.proj()
if vars.upper() == 'R' or vars.upper() == 'RUN' or vars.upper() == 'EXIT': break else: syntax.append( vars.upper() ) plt.close() if vars.upper() == 'EXIT': break else: for d in syntax: if not d: raise PlotErr, 'No Plot Functions' sys.exit() newlist = d.split( ' ' ) plotvar[ newlist[0] ] = newlist[-1] ## Draw the map pmap = proj( area='OK', stationdict=np.load('mesonet.npz') ) m = pmap.proj() m.drawcoastlines() m.drawcountries() m.drawstates() ## Contour the data grids gmaker = gridmaker.GRIDMAKER( area='OK', datdict=DataDict, tenddict=TendDict, StationDict=np.load('mesonet.npz') ) if plotvar[ 'PFUNC' ].startswith( '3' ): grid = gmaker.grid_3hr( datatype=plotvar[ 'PFUNC' ] ) elif plotvar[ 'PFUNC' ] == 'VORT' or plotvar[ 'PFUNC' ] == 'DIVR': grid = gmaker.VectorGrid( datatype=plotvar[ 'PFUNC' ] ) elif plotvar[ 'PFUNC' ] == 'TPFA' or plotvar[ 'PFUNC' ] == 'TPCA' or plotvar[ 'PFUNC' ] == 'MXRA' or plotvar[ 'PFUNC' ] == 'THEA': grid =gmaker.AdvectionGrid( datatype=plotvar[ 'PFUNC' ] ) else: grid = gmaker.grid( datatype=plotvar[ 'PFUNC' ] ) m.contourf( grid[0], grid[1], grid[2], grid[3], cmap=grid[4] )
def __init__( self, **kwargs ): self.StationDict = kwargs.get( 'StationDict', np.load( os.path.join( os.path.dirname(__file__), 'stations.npz' ) ) ) self.area = kwargs.get( 'area', 'CONUS' ) self.DataDict = kwargs.get( 'DatDict' ) pmap = proj( area=self.area ) self.m = pmap.proj()