""" Used by Xiao-Ming Hu (xhu@ou.edu) to plot MODIS cloud aerosol around the world Apr. 17, 2020 """ from oco2_modis_vistool import do_modis_overlay_plot from oco2_modis_vistool import load_OCO2_Lite_overlay_data import numpy as np from datetime import timedelta, date #odat = np.loadtxt('OCO-2_9_LITE_LEVEL2_extracted_2016only.nc_20sMean_fromStempede2.txt', skiprows=1) odat = np.loadtxt('OCO-2_9_LITE_LEVEL2_extracted_2019only.nc_2sMean.txt', skiprows=1) #odat = np.loadtxt('OCO-2_9_LITE_LEVEL2_extracted_2019only.nc_20sMean.txt', skiprows=1) print(odat.shape) Date = odat[:,0]/1000000 Date = Date.astype(int) print(Date.shape) def daterange(start_date, end_date): for n in range(int ((end_date - start_date).days)): yield start_date + timedelta(n) #start_date = date(2019, 1, 1) #i_infile = 0 #end_date = date(2019, 12, 31) start_date = date(2019, 6, 1) i_infile = 0 end_date = date(2019, 7, 11) #start_date = date(2019, 12, 1) #i_infile = 335 #end_date = date(2019, 1, 3) # test for single_date in daterange(start_date, end_date): date_to_findstr = single_date.strftime("%Y%m%d") date_to_find = int(date_to_findstr) #.astype(int) print(type(date_to_find)) index_select = np.argwhere(Date==date_to_find) print("going to find ",date_to_find) print(index_select.shape) # print(index_select) lat_data = odat[index_select,2] lon_data = odat[index_select,3] variable_data = odat[index_select,1] figurename = "wrfout_d01_MODIScloud_xhu_%d" % (i_infile) # figurename = "wrfout_d01_MODIScloud_xhu_sub_%d" % (i_infile) print(figurename) # do_modis_overlay_plot([55, -138], # CONUS # [24, -59.05], # do_modis_overlay_plot([55, -127.], # CONUS # [24, -67.05], do_modis_overlay_plot([20, -89.], # SouthAmerica Peru` [-55, -25.05], # do_modis_overlay_plot([55, 75], # China # [17, 135], # do_modis_overlay_plot([44, 110], #Eastern China # [27, 128], single_date.strftime("%Y-%m-%d"), lat_data, lon_data, variable_data, out_plot=figurename,var_label="$XCO_2$\n ppm") i_infile = i_infile + 1