예제 #1
0
from BB_basemap.draw_maps import draw_Utah_map


"""
I only download the Multiband Level 2 formated data.
"""

# ----------------------------------------------------------------------------
# CONUS Map object
m = Basemap(projection='geos', lon_0='-75.0',
            resolution='i', area_thresh=10000,
            llcrnrx=-3626269.5, llcrnry=1584175.9,
            urcrnrx=1381770.0, urcrnry=4588198.0)

# Map of Utah
mU = draw_Utah_map()

# Load the Latitude and Longitude grid
#GOES16_latlon = '/uufs/chpc.utah.edu/common/home/horel-group/archive/GOES16/goes16_conus_latlon.npy'
#latlon = np.load(GOES16_latlon).item()

# ----------------------------------------------------------------------------
def download_goes16(DATE,
                    domain='C',
                    product='ABI-L2-MCMIP'):
    """
    Downloads GOES-16 NetCDF files from the Amazon AWS
    https://noaa-goes16.s3.amazonaws.com
    
    Input:
        DATE - a datetime object that includes.
예제 #2
0
    import matplotlib.pyplot as plt
    from mpl_toolkits.basemap import Basemap

    import sys
    sys.path.append('/uufs/chpc.utah.edu/common/home/u0553130/pyBKB_v2/')
    from BB_basemap.draw_maps import draw_CONUS_HRRR_map, draw_Utah_map

    DATE = datetime(2017, 9, 25)
    DIR = '/uufs/chpc.utah.edu/common/home/horel-group/archive/%s/BB_test/goes16/' % DATE.strftime(
        '%Y%m%d')

    FILES = files_on_pando(DATE)

    mHRRR = draw_CONUS_HRRR_map()
    mUtah = draw_Utah_map()

    for f in FILES:
        G = get_GOES16_truecolor(DIR + f, nightIR=True)

        # Plot on HRRR domain Map
        plt.figure(1)
        plt.clf()
        plt.cla()
        newmap = mHRRR.pcolormesh(G['LONS'],
                                  G['LATS'],
                                  G['TrueColor'][:, :, 1],
                                  color=G['rgb_tuple'],
                                  linewidth=0,
                                  latlon=True)
        newmap.set_array(
예제 #3
0
temp = grbs.select(name="2 metre temperature")[0].values - 273.15
lat, lon = grbs.select(name="2 metre temperature")[0].latlons()

# Open HRRRx and get surface temperature
grbsX = pygrib.open(DIR+'hrrrX/hrrrX.t03z.wrfsfcf00.grib2')
tempX = grbsX.select(name="2 metre temperature")[0].values - 273.15
latX, lonX = grbsX.select(name="2 metre temperature")[0].latlons()

# Note: lat/lon and latX/lonX should be the same


# Draw map of Utah and plot temperatures
fig = plt.figure(figsize=[13,5])
# first pannel
ax = fig.add_subplot(131)
m = draw_Utah_map()
m.drawstates()
m.drawcoastlines()
m.pcolormesh(lon, lat, temp, cmap='Spectral_r', vmax=temp.max(), vmin=temp.min())
plt.colorbar(orientation='horizontal', shrink=.9, pad=.03)
plt.title('hrrr')

# second pannel
ax = fig.add_subplot(132)
m = draw_Utah_map()
m.drawstates()
m.drawcoastlines()
m.pcolormesh(lon, lat, tempX, cmap='Spectral_r', vmax=temp.max(), vmin=temp.min())
plt.colorbar(orientation='horizontal', shrink=.9, pad=.03)
plt.title('hrrrX')