Skip to content

Commit

Permalink
GitHub Issue #3 3d commit
Browse files Browse the repository at this point in the history
Fixed the handling of regridding via wgrib2 or MET tool- now doing things
based on original SBU code/config master config.
  • Loading branch information
Minna Win committed Jun 21, 2017
1 parent 12c2fc4 commit 1225f78
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions ush/series_by_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ def analysis_by_lead_time():
fhr_diff = fhr_end - fhr_beg
if fhr_diff == 0 and fhr_inc == 0:
fhr_inc = 1

elif fhr_inc == 0:
logger.error('ERROR: fcst range indicated with increment of 0 hrs, please check the configuration file.'
' Exiting...')
sys.exit(1)
# GitHub Issue #3 support:
if fhr_by_range:
start = fhr_beg
Expand Down Expand Up @@ -377,11 +380,19 @@ def perform_series_for_bucket(tile_dir, start, end, p, logger):
series_anly_configuration_file = p.opt["SERIES_ANALYSIS_BY_LEAD_CONFIG_PATH"]
fhr_of_interest = p.opt["FHR_OF_INTEREST"]
series_lead_out_dir = p.opt["SERIES_LEAD_OUT_DIR"]
fcst_tile_regex = p.opt["FCST_NC_TILE_REGEX"]
anly_tile_regex = p.opt["ANLY_NC_TILE_REGEX"]
var_list = p.opt["VAR_LIST"]
regrid_with_MET_tool = p.opt["REGRID_USING_MET_TOOL"]

if regrid_with_MET_tool:
# Regridding via MET Tool regrid_data_plane.
fcst_tile_regex = p.opt["FCST_NC_TILE_REGEX"]
anly_tile_regex = p.opt["ANLY_NC_TILE_REGEX"]
else:
# Regridding via wgrib2 tool.
fcst_tile_regex = p.opt["FCST_TILE_REGEX"]
anly_tile_regex = p.opt["ANLY_TILE_REGEX"]


fcst_tiles_list = []
anly_tiles_list = []
fhr_bucket = str(start).zfill(3) + "_to_F" + str(fhr_of_interest[end-1]).zfill(3)
Expand Down Expand Up @@ -544,11 +555,18 @@ def perform_series_for_range(tile_dir, start, end, step, p, logger):
series_analysis_exe = p.opt["SERIES_ANALYSIS"]
series_anly_configuration_file = p.opt["SERIES_ANALYSIS_BY_LEAD_CONFIG_PATH"]
series_lead_out_dir = p.opt["SERIES_LEAD_OUT_DIR"]
fcst_tile_regex = p.opt["FCST_NC_TILE_REGEX"]
anly_tile_regex = p.opt["ANLY_NC_TILE_REGEX"]
var_list = p.opt["VAR_LIST"]
regrid_with_MET_tool = p.opt["REGRID_USING_MET_TOOL"]

if regrid_with_MET_tool:
# Regridding via MET Tool regrid_data_plane.
fcst_tile_regex = p.opt["FCST_NC_TILE_REGEX"]
anly_tile_regex = p.opt["ANLY_NC_TILE_REGEX"]
else:
# Regridding via wgrib2 tool.
fcst_tile_regex = p.opt["FCST_TILE_REGEX"]
anly_tile_regex = p.opt["ANLY_TILE_REGEX"]

for fhr in range(start, end, step):
cur_fhr = str(fhr).zfill(3)
msg = ('INFO|[' + cur_filename + ':' + cur_function +
Expand Down

0 comments on commit 1225f78

Please sign in to comment.