Esempio n. 1
0
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.basemap import cm, maskoceans

#from pygeode.plot import plot_v1 as pl
#from pygeode.plot import basemap as bm

## settings
nax = 2 # number of panels
ndom = 2
sf = dict(dpi=150) # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/' # figure directory

if __name__ == '__main__':
  
  ## read data
  data = openWRF('ctrl-1',[1982],range(11,12))
  print data[ndom-1]
  
  ## setup projection
  f = pyl.figure(facecolor='white', figsize = (6.25,4.25))
  ax = []
  for n in xrange(nax):
    ax.append(f.add_subplot(1,2,n+1))
  f.subplots_adjust(bottom=0.12, left=0.06, right=.97, top=.94, hspace=0.05, wspace=0.05) # hspace, wspace
  # setup lambert conformal basemap.
  # lat_1 is first standard parallel.
  # lat_2 is second standard parallel (defaults to lat_1).
  # lon_0,lat_0 is central point.
  # rsphere=(6378137.00,6356752.3142) specifies WGS4 ellipsoid
  # area_thresh=1000 means don't plot coastline features less
  # than 1000 km^2 in area.
Esempio n. 2
0
#subplots = (1,2)
#figsize = (6.25,4.25)
subplot = (2,2)
figsize = (6.25,6.25)
figtitle = 'Annual Average Precipitation [mm/day]'
axtitles = ['WRF Control','WRF Grell-3','CFSR Climatology', 'NARR Climatology']
margins = dict(bottom=0.025, left=0.065, right=.885, top=.925, hspace=0.05, wspace=0.05)
caxpos = [0.91, 0.05, 0.03, 0.9]
sf = dict(dpi=150) # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/' # figure directory

if __name__ == '__main__':
  
  # load WRF data
  domains = [1]; ndom = len(domains) # WRF domain
  way2, = openWRF(exp='2way-ctrl',years=[1983],months=[3], domains=domains)
  grell3, = openWRF(exp='grell3-ctrl',years=[1981],months=[2], domains=domains) 
  ctrl1, = openWRF(exp='ctrl-1',years=[1985],months=[5], domains=domains)
  ensA, = openWRF(exp='ens-A-ctrl',years=[1985],months=[5], domains=domains)
  WRF = (ctrl1, grell3, )
  # load CFSR data
  CFSR = openCFSRclim()
  # load NARR data 
  NARR = openNARRclim() # just load whole climatology
#  print NARR
  
  ## compute data
  data = []; lon = []; lat=[]  # list of data and coordinate fields to be plotted 
  # compute average WRF precip
  for exp in WRF:
    nrec = exp.time.values[-1]+1
Esempio n. 3
0
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.basemap import cm, maskoceans

#from pygeode.plot import plot_v1 as pl
#from pygeode.plot import basemap as bm

## settings
nax = 2  # number of panels
ndom = 2
sf = dict(dpi=150)  # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/'  # figure directory

if __name__ == '__main__':

    ## read data
    data = openWRF('ctrl-1', [1982], range(11, 12))
    print data[ndom - 1]

    ## setup projection
    f = pyl.figure(facecolor='white', figsize=(6.25, 4.25))
    ax = []
    for n in xrange(nax):
        ax.append(f.add_subplot(1, 2, n + 1))
    f.subplots_adjust(bottom=0.12,
                      left=0.06,
                      right=.97,
                      top=.94,
                      hspace=0.05,
                      wspace=0.05)  # hspace, wspace
    # setup lambert conformal basemap.
    # lat_1 is first standard parallel.
Esempio n. 4
0
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.basemap import cm, maskoceans

#from pygeode.plot import plot_v1 as pl
#from pygeode.plot import basemap as bm

## settings
nax = 2 # number of panels
ndom = 2
sf = dict(dpi=150) # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/' # figure directory

if __name__ == '__main__':
  
  ## read data
  data = openWRF('ctrl-1',[1982],list(range(11,12)))
  print(data[ndom-1])
  ## compute data
  precip = []; ndays = []
  for n in range(ndom):
    nrec = data[n].time.values[-1]+1
    ndays = data[n].xtime(time=nrec-1).get() /24/60 # xtime is in minutes, need days    
    dailyrain = data[n].rain(time=nrec-1).get() / ndays
#    ndays = ( data[n].xtime(time=nrec-1).get() - data[n].xtime(time=0).get() )/24/60 # xtime is in minutes, need days    
#    dailyrain = ( data[n].rain(time=nrec-1).get() - data[n].rain(time=0).get() ) / ndays 
    precip.append(dailyrain.squeeze()) 
  
  ## setup projection
  f = pyl.figure(facecolor='white', figsize = (6.25,4.25))
  ax = []
  for n in range(nax):
Esempio n. 5
0
margins = dict(bottom=0.025,
               left=0.065,
               right=.885,
               top=.925,
               hspace=0.05,
               wspace=0.05)
caxpos = [0.91, 0.05, 0.03, 0.9]
sf = dict(dpi=150)  # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/'  # figure directory

if __name__ == '__main__':

    # load WRF data
    domains = [1]
    ndom = len(domains)  # WRF domain
    way2, = openWRF(exp='2way-ctrl', years=[1983], months=[3], domains=domains)
    grell3, = openWRF(exp='grell3-ctrl',
                      years=[1981],
                      months=[2],
                      domains=domains)
    ctrl1, = openWRF(exp='ctrl-1', years=[1985], months=[5], domains=domains)
    ensA, = openWRF(exp='ens-A-ctrl',
                    years=[1985],
                    months=[5],
                    domains=domains)
    WRF = (
        ctrl1,
        grell3,
    )
    # load CFSR data
    CFSR = openCFSRclim()
## figure settings
#subplot = (2,2)
#figsize = (6.25,6.25)
figtitle = 'Annual Average Precipitation [mm/day]'
axtitles = ['WRF Ctrl-1 (GPC)', 'WRF Ctrl-1 (TCS)']
sf = dict(dpi=150) # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/' # figure directory

if __name__ == '__main__':
  
  # load WRF data
  domains = [2]; ndom = len(domains) # WRF domain
#  way2, = openWRF(exp='2way-ctrl',years=[1982],months=[9], domains=domains)
#  grell3, = openWRF(exp='grell3-ctrl',years=[1980],months=[8], domains=domains) 
#  ctrl1, = openWRF(exp='ctrl-1',years=[1984],months=[7], domains=domains)
  ctrl1, = openWRF(exp='ctrl-1',years=[1980],months=[12], domains=domains)
  ctrl2, = openWRF(exp='ctrl-2',years=[1980],months=[12], domains=domains)
  WRF = (ctrl1, ctrl2)
  # load NARR data 
  NARR = openNARR() # just load whole climatology
  print NARR
  
  ## compute data
  data = []; lon = []; lat=[]  # list of data and coordinate fields to be plotted 
  # compute average WRF precip
  for exp in WRF:
    nrec = exp.time.values[-1]+1
    ndays = exp.xtime(time=nrec-1).get() /24/60 # xtime is in minutes, need days    
    dailyrain = exp.rain(time=nrec-1).get().squeeze() / ndays
    data.append(dailyrain)
    lon.append(exp.lon.get()); lat.append(exp.lat.get())
#subplots = (1,2)
#figsize = (6.25,4.25)
subplot = (2,2)
figsize = (6.25,6.25)
figtitle = 'Annual Average Precipitation [mm/day]'
axtitles = ['WRF 2-way nested','WRF Grell-3','WRF Control', 'NARR Climatology']
margins = dict(bottom=0.025, left=0.065, right=.885, top=.925, hspace=0.05, wspace=0.05)
caxpos = [0.91, 0.05, 0.03, 0.9]
sf = dict(dpi=150) # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/' # figure directory

if __name__ == '__main__':
  
  # load WRF data
  domains = [1]; ndom = len(domains) # WRF domain
  way2, = openWRF(exp='2way-ctrl',years=[1982],months=[9], domains=domains)
  grell3, = openWRF(exp='grell3-ctrl',years=[1980],months=[8], domains=domains) 
  ctrl1, = openWRF(exp='ctrl-1',years=[1984],months=[7], domains=domains)
  WRF = (way2, grell3, ctrl1)
  # load NARR data 
  NARR = openNARR() # just load whole climatology
  print NARR
  
  ## compute data
  data = []; lon = []; lat=[]  # list of data and coordinate fields to be plotted 
  # compute average WRF precip
  for exp in WRF:
    nrec = exp.time.values[-1]+1
    ndays = exp.xtime(time=nrec-1).get() /24/60 # xtime is in minutes, need days    
    dailyrain = exp.rain(time=nrec-1).get().squeeze() / ndays
    data.append(dailyrain)
#subplot = (2,2)
#figsize = (6.25,6.25)
figtitle = 'Annual Average Precipitation [mm/day]'
axtitles = ['WRF Ctrl-1 (GPC)', 'WRF Ctrl-1 (TCS)']
sf = dict(dpi=150)  # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/'  # figure directory

if __name__ == '__main__':

    # load WRF data
    domains = [2]
    ndom = len(domains)  # WRF domain
    #  way2, = openWRF(exp='2way-ctrl',years=[1982],months=[9], domains=domains)
    #  grell3, = openWRF(exp='grell3-ctrl',years=[1980],months=[8], domains=domains)
    #  ctrl1, = openWRF(exp='ctrl-1',years=[1984],months=[7], domains=domains)
    ctrl1, = openWRF(exp='ctrl-1', years=[1980], months=[12], domains=domains)
    ctrl2, = openWRF(exp='ctrl-2', years=[1980], months=[12], domains=domains)
    WRF = (ctrl1, ctrl2)
    # load NARR data
    NARR = openNARR()  # just load whole climatology
    print NARR

    ## compute data
    data = []
    lon = []
    lat = []  # list of data and coordinate fields to be plotted
    # compute average WRF precip
    for exp in WRF:
        nrec = exp.time.values[-1] + 1
        ndays = exp.xtime(time=nrec -
                          1).get() / 24 / 60  # xtime is in minutes, need days
margins = dict(bottom=0.025,
               left=0.065,
               right=.885,
               top=.925,
               hspace=0.05,
               wspace=0.05)
caxpos = [0.91, 0.05, 0.03, 0.9]
sf = dict(dpi=150)  # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/'  # figure directory

if __name__ == '__main__':

    # load WRF data
    domains = [1]
    ndom = len(domains)  # WRF domain
    way2, = openWRF(exp='2way-ctrl', years=[1982], months=[9], domains=domains)
    grell3, = openWRF(exp='grell3-ctrl',
                      years=[1980],
                      months=[8],
                      domains=domains)
    ctrl1, = openWRF(exp='ctrl-1', years=[1984], months=[7], domains=domains)
    WRF = (way2, grell3, ctrl1)
    # load NARR data
    NARR = openNARR()  # just load whole climatology
    print NARR

    ## compute data
    data = []
    lon = []
    lat = []  # list of data and coordinate fields to be plotted
    # compute average WRF precip
Esempio n. 10
0
from myPlots.plots import surfacePlot
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.basemap import cm, maskoceans

#from pygeode.plot import plot_v1 as pl
#from pygeode.plot import basemap as bm

## settings
sf = dict(dpi=150) # print properties
folder = '/home/me/Research/Dynamical Downscaling/figures/' # figure directory


if __name__ == '__main__':
  
  ## read data
  data1, data2 = openWRF('ctrl-1',[1981],[1,2,12])
  print data1
  ## compute data
#  precip1 = data1.rain(time=) 
#  precip2 = 
  
  ## setup projection
  f = pyl.figure(facecolor='white', figsize = (6.25,4.25))
  ax = f.add_subplot(1,1,1)
  f.subplots_adjust(bottom=0.05, left=0.05, right=.93, top=.93) # hspace, wspace
  # setup lambert conformal basemap.
  # lat_1 is first standard parallel.
  # lat_2 is second standard parallel (defaults to lat_1).
  # lon_0,lat_0 is central point.
  # rsphere=(6378137.00,6356752.3142) specifies WGS4 ellipsoid
  # area_thresh=1000 means don't plot coastline features less