Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
Refs: #82
  • Loading branch information
malloryprow committed Oct 27, 2021
2 parents fc578a7 + f57d618 commit 8d6ffb7
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 22 deletions.
17 changes: 12 additions & 5 deletions ush/create_METplus_job_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,8 +1456,10 @@ def create_job_scripts_maps(start_date_dt, end_date_dt, case, case_abbrev,
'USWRF': ['sfc_avg6hr', 'toa_avg6hr'],
'ALBDO': ['sfc_avg6hr'],
'SUNSD': ['sfc'],
'TCDC': ['column_avg6hr', 'pbl_avg6hr', 'low_avg6hr',
'mid_avg6hr', 'high_avg6hr', 'convective'],
'TCDC': ['column_avg6hr', 'pbl_avg6hr', 'convective'],
'LCDC': ['low_avg6hr'],
'MCDC': ['mid_avg6hr'],
'HCDC': ['high_avg6hr'],
'PRES': ['lowcloudbase_avg6hr',
'midcloudbase_avg6hr',
'highcloudbase_avg6hr',
Expand Down Expand Up @@ -1515,8 +1517,10 @@ def create_job_scripts_maps(start_date_dt, end_date_dt, case, case_abbrev,
'ULWRF': ['sfc_avg6hr', 'toa_avg6hr'],
'DSWRF': ['sfc_avg6hr', 'toa_avg6hr'],
'USWRF': ['sfc_avg6hr', 'toa_avg6hr'],
'TCDC': ['column_avg6hr', 'low_avg6hr',
'mid_avg6hr', 'high_avg6hr']},
'TCDC': ['column_avg6hr'],
'LCDC': ['low_avg6hr'],
'MCDC': ['mid_avg6hr'],
'HCDC': ['high_avg6hr']},
'sfc': {'TMP': ['2mAGL']},
'totcol': {'PWAT': ['column'],
'CWAT': ['column']},
Expand Down Expand Up @@ -1570,7 +1574,10 @@ def create_job_scripts_maps(start_date_dt, end_date_dt, case, case_abbrev,
'ULWRF': ['lw_sfc_up', 'lw_toa_up'],
'DSWRF': ['sw_sfc_down', 'sw_toa_down'],
'USWRF': ['sw_sfc_up', 'sw_toa_up'],
'TCDC': ['cldt', 'cldl', 'cldm', 'cldh'],
'TCDC': ['cldt'],
'LCDC': ['cldl'],
'MCDC': ['cldm'],
'HCDC': ['cldh'],
'TMP': ['air'],
'PWAT': ['tpw'],
'CWAT': ['clwp'],
Expand Down
58 changes: 41 additions & 17 deletions ush/plotting_scripts/maps2d_plot_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ def get_maps2d_plot_settings(var_name, var_level):
formal_var_level = 'Surface'
elif 'sigma' in var_level:
var_GRIB_lvl_typ = '107'
formal_var_level = var_level.replace('sigma', '')+' Sigma Level'
formal_var_level = (var_level.split('_')[0] \
.replace('sigma', '')+' Sigma Level')
var_level.replace('sigma', '')+' Sigma Level'
elif 'msl' in var_level:
var_GRIB_lvl_typ = '102'
formal_var_level = 'Mean Sea Level Pressure'
Expand Down Expand Up @@ -214,6 +216,18 @@ def get_maps2d_plot_settings(var_name, var_level):
elif 'convective' in var_level:
var_GRIB_lvl_typ = '244'
formal_var_level = 'Convective Cloud Layer'
if '_' in var_level:
if 'range' in var_level.split('_')[1]:
formal_var_time_range = (', '+var_level.split('_')[1] \
.replace('range','')+' range')
elif 'avg' in var_level.split('_')[1]:
formal_var_time_range = (', '+var_level.split('_')[1] \
.replace('avg','')+' average')
elif 'accum' in var_level.split('_')[1]:
formal_var_time_range = (', '+var_level.split('_')[1] \
.replace('accum','')+' accumulation')
else: #instanteous
formal_var_time_range = ''
# Get settings
if var_name == '4LFTX': #best (4 layer) lifted index (K)
formal_var_name = 'Best (4-Layer) Lifted Index'
Expand Down Expand Up @@ -481,6 +495,14 @@ def get_maps2d_plot_settings(var_name, var_level):
print("ERROR: cannot find plot settings for "+var_name+" "
+"at "+var_GRIB_lvl_typ)
sys.exit(1)
elif var_name == 'HCDC': #high cloud cover (%)
formal_var_name = 'High Cloud Cover'
cmap = plt.cm.Blues
if var_GRIB_lvl_typ == '234': #high layer cloud layer
levels = np.array([0,10,20,30,40,50,60,80,100])
levels_diff = np.array([-30,-20,-15,-10,-5,-2,0,2,5,10,15,20,30])
var_scale = 1
var_units = '%'
elif var_name == 'HGT': #geopotential height (gpm)
formal_var_name = 'Geopotential Height'
cmap = plt.cm.cubehelix_r
Expand Down Expand Up @@ -590,6 +612,14 @@ def get_maps2d_plot_settings(var_name, var_level):
print("ERROR: cannot find plot settings for "+var_name+" "
+"at "+var_GRIB_lvl_typ)
sys.exit(1)
elif var_name == 'LCDC': #low cloud cover (%)
formal_var_name = 'Low Cloud Cover'
cmap = plt.cm.Blues
if var_GRIB_lvl_typ == '214': #low layer cloud layer
levels = np.array([0,10,20,30,40,50,60,80,100])
levels_diff = np.array([-30,-20,-15,-10,-5,-2,0,2,5,10,15,20,30])
var_scale = 1
var_units = '%'
elif var_name == 'LFTX': #lifted index (K)
formal_var_name = 'Lifted Index'
cmap = plt.cm.RdGy_r
Expand All @@ -614,6 +644,14 @@ def get_maps2d_plot_settings(var_name, var_level):
print("ERROR: cannot find plot settings for "+var_name+" "
+"at "+var_GRIB_lvl_typ)
sys.exit(1)
elif var_name == 'MCDC': #medium cloud cover (%)
formal_var_name = 'Medium Cloud Cover'
cmap = plt.cm.Blues
if var_GRIB_lvl_typ == '224': #medium layer cloud layer
levels = np.array([0,10,20,30,40,50,60,80,100])
levels_diff = np.array([-30,-20,-15,-10,-5,-2,0,2,5,10,15,20,30])
var_scale = 1
var_units = '%'
elif var_name == 'MSLET': #mean sea-level pressure (NAM reduction) (Pa)
formal_var_name = 'Mean Sea Level Pressure (NAM Reduction)'
cmap = plt.cm.rainbow
Expand Down Expand Up @@ -907,21 +945,6 @@ def get_maps2d_plot_settings(var_name, var_level):
levels_diff = np.array([-30,-20,-15,-10,-5,-2,0,2,5,10,15,20,30])
var_scale = 1
var_units = '%'
elif var_GRIB_lvl_typ == '214': #low layer cloud layer
levels = np.array([0,10,20,30,40,50,60,80,100])
levels_diff = np.array([-30,-20,-15,-10,-5,-2,0,2,5,10,15,20,30])
var_scale = 1
var_units = '%'
elif var_GRIB_lvl_typ == '224': #mid layer cloud layer
levels = np.array([0,10,20,30,40,50,60,80,100])
levels_diff = np.array([-30,-20,-15,-10,-5,-2,0,2,5,10,15,20,30])
var_scale = 1
var_units = '%'
elif var_GRIB_lvl_typ == '234': #high layer cloud layer
levels = np.array([0,10,20,30,40,50,60,80,100])
levels_diff = np.array([-30,-20,-15,-10,-5,-2,0,2,5,10,15,20,30])
var_scale = 1
var_units = '%'
elif var_GRIB_lvl_typ == '244': #convective layer cloud layer
levels = np.array([0,10,20,30,40,50,60,80,100])
levels_diff = np.array([-30,-20,-15,-10,-5,-2,0,2,5,10,15,20,30])
Expand Down Expand Up @@ -1313,11 +1336,12 @@ def get_maps2d_plot_settings(var_name, var_level):
sys.exit(1)
if var_name in ['PRMSL', 'MSLET', 'HPBL']:
var_info_title = (
formal_var_name+' ('+var_units+')'
formal_var_name+' ('+var_units+')'+formal_var_time_range
)
else:
var_info_title = (
formal_var_level+' '+formal_var_name+' ('+var_units+')'
+formal_var_time_range
)
return (var_info_title, levels, levels_diff, cmap, var_scale,
formal_var_name)
Binary file modified ush/webpage.tar
Binary file not shown.

0 comments on commit 8d6ffb7

Please sign in to comment.