Esempio n. 1
0
mpl.rcParams['axes.titlesize'] = 15
mpl.rcParams['lines.linewidth'] = 1.8
mpl.rcParams['grid.linewidth'] = .25
mpl.rcParams['figure.subplot.wspace'] = 0.05
mpl.rcParams['figure.subplot.hspace'] = 0.05
mpl.rcParams['legend.fontsize'] = 10
mpl.rcParams['legend.framealpha'] = .75
mpl.rcParams['legend.loc'] = 'best'
mpl.rcParams['savefig.bbox'] = 'tight'
mpl.rcParams['savefig.dpi'] = 100

# Build map objects and get HRRR latitude and longitude grids.
latlon = get_hrrr_latlon()
lat = latlon['lat']
lon = latlon['lon']
m = draw_HRRR_map()                             # CONUS
mW = draw_centermap(40, -115, (10,10))          # West
mU = draw_centermap(39.5, -111.6, (3.2,3.2))    # Utah

# Variable constants
VARS = {'TMP:2 m':{'cmap':'magma',
                    'vmax':2.5,
                    'vmin':0,
                    'label':'2 m Temperature',
                    'units':'C'},
        'DPT:2 m':{'cmap':'magma',
                    'vmax':5,
                    'vmin':0,
                    'label':'2 m Dew Point',
                    'units':'C'},
        'GUST:surface':{'cmap':'magma',
Esempio n. 2
0
if __name__ == '__main__':
    #single = RMSD(DATE, 'REFC:entire', FORECASTS=range(19))
    from BB_maps.my_basemap import draw_HRRR_map, draw_centermap
    import matplotlib.pyplot as plt
    import matplotlib as mpl
    mpl.rcParams['figure.figsize'] = [15,15]
    mpl.rcParams['figure.titlesize'] = 15
    mpl.rcParams['figure.subplot.wspace'] = 0.05
    mpl.rcParams['figure.subplot.hspace'] = 0.05
    mpl.rcParams['xtick.labelsize'] = 10
    mpl.rcParams['ytick.labelsize'] = 10
    mpl.rcParams['lines.linewidth'] = 1.8
    mpl.rcParams['savefig.bbox'] = 'tight'
    mpl.rcParams['savefig.dpi'] = 100

    m = draw_HRRR_map(area_thresh=5000)
    mU = draw_centermap(lat=40, lon=-115, size=(10,10))

    sDATE = datetime(2018, 7, 13)
    eDATE = datetime(2018, 8, 13)
    #SAVEDIR = 'figs/hourly_RMSD/'
    SAVEDIR = '/uufs/chpc.utah.edu/common/home/u0553130/public_html/PhD/HRRR_RMSE/RMSD_v3'
    if not os.path.exists(SAVEDIR):
        os.makedirs(SAVEDIR)
    
    for variable in ['TMP:2 m', 'UGRD:10 m', 'VGRD:10 m', 'LTNG:entire', 'REFC:entire', 'WIND:10 m', 'CAPE:surface', 'HGT:500 mb', 'DPT:2 m']:
    #for variable in ['TMP:2 m']:
        if variable in ['LTNG:entire', 'APCP:surface', 'WIND:10 m']:
            # These variables are hourly values and don't have an analysis value
            FORECASTS = range(1,19) 
        else:
Esempio n. 3
0
                      verbose=False):
    args = [[(i, len(DATES_LIST)), D, variable, fxx, verbose]
            for i, D in enumerate(DATES_LIST)]
    reduce_CPUs = 2  # don't eat all computer resources
    cpus = np.minimum(multiprocessing.cpu_count() - reduce_CPUs, len(args))
    P = multiprocessing.Pool(cpus)
    all_variances = P.map(mean_spread_MP, args)
    P.close()
    mean_spread = np.sqrt(np.mean(all_variances, axis=0))
    return all_variances


# ================================================================
# ================================================================

m = draw_HRRR_map()

LAND = get_hrrr_variable(datetime(2019, 1, 1), 'LAND:surface')

VARS = [
    'GUST:surface', 'UVGRD:10 m', 'REFC:entire', 'LTNG:entire', 'CAPE:surface',
    'TMP:2 m', 'DPT:2 m', 'HGT:500'
]

seasons = {
    'DJF': {
        'sDATE': datetime(2017, 12, 1),
        'eDATE': datetime(2018, 3, 1)
    },
    'MAM': {
        'sDATE': datetime(2018, 3, 1),
Esempio n. 4
0
sys.path.append('/uufs/chpc.utah.edu/common/home/u0553130/pyBKB_v3')

from BB_HRRR.HRRR_Pando import get_hrrr_all_valid, \
                               get_hrrr_latlon,\
                               get_hrrr_variable
from BB_GOES.get_GLM import get_GLM_file_nearesttime,\
                            accumulate_GLM_FAST,\
                            bin_GLM_on_HRRR_grid
from BB_maps.my_basemap import draw_HRRR_map,\
                               draw_centermap
from BB_HRRR.HRRR_paths import get_domains
from BB_wx_calcs.binary_events import *

## Create HRRR map object with Basemap
print('Create HRRR map.')
m = draw_HRRR_map(resolution='c')
Hlat, Hlon = get_hrrr_latlon(DICT=False)

# Get all HRRR forecast lead times
fxx = range(1, 19)
print('Forecasts', list(fxx))

## Generate Domain Paths and Domain Masks
print('Generate domains and masks.')

domains = get_domains(add_states=['UT', 'CO', 'TX', 'FL'], HRRR_specific=True)
#domains = get_domains(add_states=['CO', 'TX', 'FL'], HRRR_specific=False)
print(domains.keys())


def get_GLM_HRRR_contingency_stats(validDATE,