Skip to content

Commit

Permalink
Added in ability for grid-to-grid use case plotting scripts to plot u…
Browse files Browse the repository at this point in the history
…sing initialization time
  • Loading branch information
malloryprow committed Apr 12, 2018
1 parent b830c41 commit 59b9b35
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
6 changes: 5 additions & 1 deletion ush/plotting_scripts/plot_grid2grid_anom_timemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
emonth = month_name[emon-1]
eday = int(edate[6:8])
cycle_int = int(os.environ['CYCLE'])
lead_int = int(os.environ['LEAD'])
sd = datetime.datetime(syear, smon, sday, cycle_int)
ed = datetime.datetime(eyear, emon, eday, cycle_int)+datetime.timedelta(days=1)
tdelta = datetime.timedelta(days=1)
Expand Down Expand Up @@ -174,7 +175,10 @@
model_now_stat_file_dates = data_array[:,4]
dateformat = "%Y%m%d_%H%M%S"
for d in range(len(model_now_stat_file_dates)):
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
if date_filter_method == 'Valid':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
elif date_filter_method == 'Initialization':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat) - datetime.timedelta(hours=lead_int)
model_now_dates_list.append(md.date2num(model_date))
model_now_dates = np.asarray(model_now_dates_list)
#account for missing data
Expand Down
6 changes: 5 additions & 1 deletion ush/plotting_scripts/plot_grid2grid_anom_ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
emonth = month_name[emon-1]
eday = int(edate[6:8])
cycle_int = int(os.environ['CYCLE'])
lead_int = int(os.environ['LEAD'])
sd = datetime.datetime(syear, smon, sday, cycle_int)
ed = datetime.datetime(eyear, emon, eday, cycle_int)+datetime.timedelta(days=1)
tdelta = datetime.timedelta(days=1)
Expand Down Expand Up @@ -145,7 +146,10 @@
model_now_stat_file_dates = data_array[:,4]
dateformat = "%Y%m%d_%H%M%S"
for d in range(len(model_now_stat_file_dates)):
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
if date_filter_method == 'Valid':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
elif date_filter_method == 'Initialization':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat) - datetime.timedelta(hours=lead_int)
model_now_dates_list.append(md.date2num(model_date))
model_now_dates = np.asarray(model_now_dates_list)
#account for missing data
Expand Down
6 changes: 5 additions & 1 deletion ush/plotting_scripts/plot_grid2grid_anom_ts_HGTfourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
emonth = month_name[emon-1]
eday = int(edate[6:8])
cycle_int = int(os.environ['CYCLE'])
lead_int = int(os.environ['LEAD'])
sd = datetime.datetime(syear, smon, sday, cycle_int)
ed = datetime.datetime(eyear, emon, eday, cycle_int)+datetime.timedelta(days=1)
tdelta = datetime.timedelta(days=1)
Expand Down Expand Up @@ -159,7 +160,10 @@
model_now_stat_file_dates = data_array[:,4]
dateformat = "%Y%m%d_%H%M%S"
for d in range(len(model_now_stat_file_dates)):
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
if date_filter_method == 'Valid':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
elif date_filter_method == 'Initialization':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat) - datetime.timedelta(hours=lead_int)
model_now_dates_list.append(md.date2num(model_date))
model_now_dates = np.asarray(model_now_dates_list)
#account for missing data
Expand Down
6 changes: 5 additions & 1 deletion ush/plotting_scripts/plot_grid2grid_pres_tp.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
emonth = month_name[emon-1]
eday = int(edate[6:8])
cycle_int = int(os.environ['CYCLE'])
lead_int = int(os.environ['LEAD'])
sd = datetime.datetime(syear, smon, sday, cycle_int)
ed = datetime.datetime(eyear, emon, eday, cycle_int)+datetime.timedelta(days=1)
tdelta = datetime.timedelta(days=1)
Expand Down Expand Up @@ -225,7 +226,10 @@
model_now_stat_file_dates = data_array[:,4]
dateformat = "%Y%m%d_%H%M%S"
for d in range(len(model_now_stat_file_dates)):
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
if date_filter_method == 'Valid':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
elif date_filter_method == 'Initialization':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat) - datetime.timedelta(hours=lead_int)
model_now_dates_list.append(md.date2num(model_date))
model_now_dates = np.asarray(model_now_dates_list)
#account for missing data
Expand Down
8 changes: 6 additions & 2 deletions ush/plotting_scripts/plot_grid2grid_pres_ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
emonth = month_name[emon-1]
eday = int(edate[6:8])
cycle_int = int(os.environ['CYCLE'])
lead_int = int(os.environ['LEAD'])
sd = datetime.datetime(syear, smon, sday, cycle_int)
ed = datetime.datetime(eyear, emon, eday, cycle_int)+datetime.timedelta(days=1)
tdelta = datetime.timedelta(days=1)
Expand Down Expand Up @@ -187,8 +188,11 @@
model_now_stat_file_dates = data_array[:,4]
dateformat = "%Y%m%d_%H%M%S"
for d in range(len(model_now_stat_file_dates)):
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
model_now_dates_list.append(md.date2num(model_date))
if date_filter_method == 'Valid':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
elif date_filter_method == 'Initialization':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat) - datetime.timedelta(hours=lead_int)
model_now_dates_list.append(md.date2num(model_date))
model_now_dates = np.asarray(model_now_dates_list)
#account for missing data
model_now_stat_now_dates_vals = np.zeros_like(dates)
Expand Down
6 changes: 5 additions & 1 deletion ush/plotting_scripts/plot_grid2grid_sfc_ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
emonth = month_name[emon-1]
eday = int(edate[6:8])
cycle_int = int(os.environ['CYCLE'])
lead_int = int(os.environ['LEAD'])
sd = datetime.datetime(syear, smon, sday, cycle_int)
ed = datetime.datetime(eyear, emon, eday, cycle_int)+datetime.timedelta(days=1)
tdelta = datetime.timedelta(days=1)
Expand Down Expand Up @@ -145,7 +146,10 @@
model_now_stat_file_dates = data_array[:,4]
dateformat = "%Y%m%d_%H%M%S"
for d in range(len(model_now_stat_file_dates)):
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
if date_filter_method == 'Valid':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat)
elif date_filter_method == 'Initialization':
model_date = datetime.datetime.strptime(model_now_stat_file_dates[d], dateformat) - datetime.timedelta(hours=lead_int)
model_now_dates_list.append(md.date2num(model_date))
model_now_dates = np.asarray(model_now_dates_list)
#account for missing data
Expand Down

0 comments on commit 59b9b35

Please sign in to comment.