end_date = "%02d" % target_month + "%02d" % (int(start_date[-2:]) + 13) #Define the domain for display lat_down = config.getint('Plot', 'lat_down') lat_up = config.getint('Plot', 'lat_up') lon_left = config.getint('Plot', 'lon_left') lon_right = config.getint('Plot', 'lon_right') grid_lat = config.getint('Plot', 'grid_lat') grid_lon = config.getint('Plot', 'grid_lon') data_range = [0, days] title_str = 'TRMM Number of Dry Days Climatology' + '\n' + start_date + '-' + end_date name_str = plot_dir + 'TRMM_' + start_date + '-' + end_date + '_threshold' + str( threshold) + '_Climatology_BiWeekly_' + version + '.png' s2s.plot_processing(trmm_climatology[target_week, :, :], new_lat, new_lon, lat_down, lat_up, lon_left, lon_right, grid_lat, grid_lon, data_range, title_str, name_str, 'Climatology') data_range = [0, days] title_str = 'TRMM Number of Dry Days Total' + '\n' + str( target_year) + ' ' + start_date + '-' + end_date name_str = plot_dir + 'TRMM_' + str( target_year) + '_' + start_date + '-' + end_date + '_threshold' + str( threshold) + '_Total_BiWeekly_' + version + '.png' s2s.plot_processing( trmm_total[target_week, target_year - start_year, :, :], new_lat, new_lon, lat_down, lat_up, lon_left, lon_right, grid_lat, grid_lon, data_range, title_str, name_str, 'Total') data_range = [-1 * days, days] title_str = 'TRMM Number of Dry Days Anomaly' + '\n' + str(
#Define the domain for display lat_down = config.getint('Plot','lat_down') lat_up = config.getint('Plot','lat_up') lon_left = config.getint('Plot','lon_left') lon_right = config.getint('Plot','lon_right') grid_lat = config.getint('Plot','grid_lat') grid_lon = config.getint('Plot','grid_lon') #Plot ECMWF NDD climatology/total/anomaly for i_step in range(0,lead_times): start_date = week_initial_date[target_week] end_date = "%02d"%target_month + "%02d"%(int(start_date[-2:])+6) data_range = [0,days] title_str = 'ECMWF NDD Weekly Climatology' + '\n' + start_date + '-' + end_date + ' (LT' + str(i_step+1) + ')' name_str = plot_dir + 'ECMWF_' + start_date + '-' + end_date + '_' + 'LT' + str(i_step+1) + '_threshold' + str(threshold) + '_Climatology_Weekly.png' s2s_utility_prec.plot_processing(ec_climatology[i_step,target_week,:,:],ec_lat_weekly,ec_lon_weekly,lat_down,lat_up,lon_left,lon_right,grid_lat,grid_lon,data_range,title_str,name_str,'Climatology') data_range = [0,days] title_str = 'ECMWF NDD Weekly Total' + '\n' + str(target_year) + ' ' + start_date + '-' + end_date + ' (LT' + str(i_step+1) + ')' name_str = plot_dir + 'ECMWF_' + str(target_year) + '_' + start_date + '-' + end_date + '_' + 'LT' + str(i_step+1) + '_threshold' + str(threshold) + '_Total_Weekly.png' s2s_utility_prec.plot_processing(ec_total_ens_avg[i_step,target_week,target_year-start_year,:,:],ec_lat_weekly,ec_lon_weekly,lat_down,lat_up,lon_left,lon_right,grid_lat,grid_lon,data_range,title_str,name_str,'Total') data_range = [-1*days,days] title_str = 'ECMWF NDD Weekly Anomaly' + '\n' + str(target_year) + ' ' + start_date + '-' + end_date + ' (LT' + str(i_step+1) + ')' name_str = plot_dir + 'ECMWF_' + str(target_year) + '_' + start_date + '-' + end_date + '_' + 'LT' + str(i_step+1) + '_threshold' + str(threshold) + '_Anomaly_Weekly.png' s2s_utility_prec.plot_processing(ec_anomaly[i_step,target_week,target_year-start_year,:,:],ec_lat_weekly,ec_lon_weekly,lat_down,lat_up,lon_left,lon_right,grid_lat,grid_lon,data_range,title_str,name_str,'Anomaly') print('Finished!')
lat_up = 30 lon_left = 80 lon_right = 150 grid_lat = 10 grid_lon = 10 #Plot TRMM climatology/average/anomaly start_date = week_initial_date[target_week] end_date = start_date[:2] + "%02d" % (int(start_date[-2:]) + 6) data_range = [0, 18] #change data range for plotting accordingly title_str = 'TRMM Rainfall Climatology' + '\n' + start_date + '-' + end_date name_str = 'TRMM_' + start_date + '-' + end_date + '_Climatology.png' s2s_utility_prec.plot_processing(trmm_climatology[target_week, :, :], trmm_lat, trmm_lon, lat_down, lat_up, lon_left, lon_right, grid_lat, grid_lon, data_range, title_str, name_str, 'Climatology') data_range = [0, 36] title_str = 'TRMM Rainfall Average' + '\n' + str( target_year) + ' ' + start_date + '-' + end_date name_str = 'TRMM_' + str( target_year) + '_' + start_date + '-' + end_date + '_Average.png' s2s_utility_prec.plot_processing( trmm_average[target_week, target_year - start_year, :, :], trmm_lat, trmm_lon, lat_down, lat_up, lon_left, lon_right, grid_lat, grid_lon, data_range, title_str, name_str, 'Average') data_range = [-10, 10] title_str = 'TRMM Rainfall Anomaly' + '\n' + str(
s2s_utility_prec.write_ec_data(ec_output,ec_filename,ec_daily,ec_step,ec_week,ec_year,ec_day,ec_member,prec_lat,prec_lon,'Total') print('File saved! ' + ec_filename + ' to directory ' + ec_output) ec_filename = 'ECMWF_' + calendar.month_abbr[target_month] + '_threshold' + str(threshold) + '_Climatology_Mask_Weekly.nc' s2s_utility_prec.write_ec(ec_output,ec_filename,ec_climatology_mask,ec_step,ec_week,ec_year,prec_lat,prec_lon,'Climatology') print('File saved! ' + ec_filename + ' to directory ' + ec_output) #--------------------------------------------------------------- # This part is to output and display ECMWF Rainfall percentile mask #--------------------------------------------------------------- if plot_figure: #Define the domain for display lat_down = config.getint('Plot','lat_down') lat_up = config.getint('Plot','lat_up') lon_left = config.getint('Plot','lon_left') lon_right = config.getint('Plot','lon_right') grid_lat = config.getint('Plot','grid_lat') grid_lon = config.getint('Plot','grid_lon') #Plot ECMWF daily Rainfall XXth percentile climatology mask for i_step in range(0,lead_times): start_date = week_initial_date[target_week] end_date = "%02d"%target_month + "%02d"%(int(start_date[-2:])+6) data_range = [0,10] title_str = 'ECMWF Daily Rainfall ' + str(threshold) + 'th Percentile' + '\n' + str(start_date) + '-' + str(end_date) + ' (LT' + str(i_step+1) + ')' name_str = plot_dir + 'ECMWF_' + str(start_date) + '-' + str(end_date) + '_' + 'LT' + str(i_step+1) + '_threshold' + str(threshold) + '_climatology_mask.png' s2s_utility_prec.plot_processing(ec_climatology_mask[i_step,target_week,:,:],prec_lat,prec_lon,lat_down,lat_up,lon_left,lon_right,grid_lat,grid_lon,data_range,title_str,name_str,'Climatology_Mask') print('Finished!')