"#d40000",  # 4.00 - 5.00 inches
    "#bc0000",  # 5.00 - 6.00 inches
    "#f800fd",  # 6.00 - 8.00 inches
    "#9854c6",  # 8.00 - 10.00 inches
    "#fdfdfd"   # 10.00+
]
precip_colormap = matplotlib.colors.ListedColormap(nws_precip_colors)

# Precip bins to be used for precip
clevs = [0,1,2.5,5,7.5,10,15,20,30,40,50,70,100,150]


# More map configuration
# draw coastlines, country boundaries
m.drawcoastlines(linewidth=0.25)
m.drawcountries(linewidth=0.25)
# draw parallels.
parallels = np.arange(-40.,40,10.)
m.drawparallels(parallels,labels=[1,0,0,0],fontsize=10)
# draw meridians
meridians = np.arange(80.,180.,10.)
m.drawmeridians(meridians,labels=[0,0,0,1],fontsize=10)


# Make grid for TRMM data
# ny = trmm_precip.shape[0]
# nx = trmm_precip.shape[1]
# lons, lats = m.makegrid(nx, ny)                     # get lat/lons of ny by nx evenly spaced grid.
# x, y = m(lons, lats)                                # compute map proj coordinates.

# Alternative grid
Example #2
0
# Borders for Papua New Guinea (approximate for now)

# East: 8.23.18.4.S 165.11.08.7.E
# West: 5.50.46.7.S 139.47.10.4.E

# North: 0.05'58.7"S 149.32'31.5"E
# South: 12.26'14.3"S 151.49'38.0"E

# Precip bins to be used for precip
clevs = [0, 1, 2.5, 5, 7.5, 10, 15, 20, 30, 40, 50, 70, 100, 150]

# More map configuration
# draw coastlines, country boundaries
m.drawcoastlines(linewidth=0.25)
m.drawcountries(linewidth=0.25)
# draw parallels.
parallels = np.arange(-40., 40, 10.)
m.drawparallels(parallels, labels=[1, 0, 0, 0], fontsize=10)
# draw meridians
meridians = np.arange(80., 180., 10.)
m.drawmeridians(meridians, labels=[0, 0, 0, 1], fontsize=10)

# Make grid for TRMM data
ny = trmm_precip.shape[0]
nx = trmm_precip.shape[1]
lons, lats = m.makegrid(nx, ny)  # get lat/lons of ny by nx evenly spaced grid.
x, y = m(lons, lats)  # compute map proj coordinates.

# Make grid for SACA data
ny_saca = saca_precip.shape[0]
    colors = ("#F5A5FF", "#C4B7FF", "#78CAFF", "#00D9FF", "#00E3FF", "#00E9E8",
              "#00EAC4", "#00E89A", "#26E46A", "#87DC25", "#B9D300", "#DEC900",
              "#FCBC00", "#FFAF58", "#FFA28D", "#FF97BA")
    print 'plt_diff_fc_abs_error'
    fig, axarr = plt.subplots(1, 2, figsize=(7.87, 3))
    for itim, tim in enumerate(timelist):
        print itim, tim
        dateobj = datetime.datetime.strptime(tim, '%Y%m%d')
        ax = axarr[itim]
        plt.sca(ax)

        m           = Basemap(projection='cyl', llcrnrlon=-40, \
                   urcrnrlon=30.,llcrnrlat=25,urcrnrlat=80, \
                   resolution='i', area_thresh=10000.)
        m.drawcoastlines(False)
        m.drawcountries()
        m.drawcoastlines(linewidth=0.5)
        x, y = m(lon, lat)
        mylevels = np.arange(520, 590, 5)
        # cs0         = m.contourf(x,y,((datadict_od_geopot_500[itim][timelist[itim]]/9.80665)/10.)-((datadict_od_geopot_1000[itim][timelist[itim]]/9.80665)/10.),
        #                          shading='flat',latlon=True, levels=mylevels,
        #                          cmap=plt.cm.gist_rainbow_r, extend = 'both',
        #                          alpha=0.8)
        # cs1         = m.contour(x,y,(datadict_od_geopot_500[itim][timelist[itim]]/9.80665)/10.,
        #                         latlon = True, levels = np.arange(520,581,5),
        #                         colors='k', linewidths=2,
        #                         zorder=3)
        cs1 = m.contourf(
            x,
            y, (datadict_od_geopot_500[itim][timelist[itim]] / 9.80665) / 10.,
            latlon=True,