diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index 01d6653569759c0c8fa1b08ef20f0e6521ce892a..8a9be296c2f072111ebb2d3d33d8d286254f6e3a 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -1838,5 +1838,5 @@ def run_make_images(ckpt_dir_s_path='/Users/tomrink/tf_model/', prob_thresh=0.5, obs_times, obs_lons, obs_lats, _ = time_filter_3(ice_dict, ts_0, ts_1) _, ice_lons, ice_lats = run_evaluate_static(filename=fname, ckpt_dir_s_path=ckpt_dir_s_path, prob_thresh=prob_thresh, satellite=satellite, domain=domain) - make_icing_image(fname, ice_lons, ice_lats, clvrx_str_time, ice_lons_vld=obs_lons, ice_lats_vld=obs_lats, extent=extent) + make_icing_image(fname, ice_lons, ice_lats, clvrx_str_time, satellite, domain, ice_lons_vld=obs_lons, ice_lats_vld=obs_lats, extent=extent) print('Done: ', clvrx_str_time) diff --git a/modules/util/plot.py b/modules/util/plot.py index 8aa029ac33f4adc37d7131174f1553523616c53f..9c3477272eeda4332153f79a0869f06dd941fb02 100644 --- a/modules/util/plot.py +++ b/modules/util/plot.py @@ -15,7 +15,7 @@ import cartopy.crs as ccrs import xarray as xr import os import h5py -from util.util import get_grid_values_all +from util.util import get_grid_values_all, get_cartopy_crs from util.setup import home_dir @@ -227,20 +227,21 @@ def plot_image3(image, cmap='Greys'): plt.title('GOES-16', loc='left', fontweight='bold', fontsize=15) -def make_icing_image(clvrx_file, ice_lons, ice_lats, clvrx_str_time, ice_lons_vld=None, ice_lats_vld=None, imagename='icing', extent=[-110, -60, 10, 55]): +def make_icing_image(clvrx_file, ice_lons, ice_lats, clvrx_str_time, satellite, domain, ice_lons_vld=None, ice_lats_vld=None, imagename='icing', extent=[-110, -60, 10, 55]): h5f = h5py.File(clvrx_file, 'r') image = get_grid_values_all(h5f, 'temp_10_4um_nom') - exmpl_ds = xr.open_dataset(exmp_file) - mdat = exmpl_ds.metpy.parse_cf('Rad') - geos = mdat.metpy.cartopy_crs - x = mdat.x - y = mdat.y + # exmpl_ds = xr.open_dataset(exmp_file) + # mdat = exmpl_ds.metpy.parse_cf('Rad') + # geos = mdat.metpy.cartopy_crs + # x = mdat.x + # y = mdat.y + geos, xlen, xmin, xmax, ylen, ymin, ymax = get_cartopy_crs(satellite, domain) fig = plt.figure(figsize=(48, 30)) ax = fig.add_subplot(1, 1, 1, projection=geos) ax.set_extent(extent, crs=ccrs.PlateCarree()) - ax.imshow(image, origin='upper', extent=(x.min(), x.max(), y.min(), y.max()), cmap='Greys', transform=geos) + ax.imshow(image, origin='upper', extent=(xmin, xmax, ymin, ymax), cmap='Greys', transform=geos) ax.coastlines(resolution='50m', color='black', linewidth=0.25) ax.add_feature(ccrs.cartopy.feature.STATES, linewidth=0.25) if ice_lons is not None: diff --git a/modules/util/util.py b/modules/util/util.py index 84480008830dc752931ed9c1938966b937790e5e..a71f8c08653083297f9b5d20a663e5cc5d6ca16c 100644 --- a/modules/util/util.py +++ b/modules/util/util.py @@ -406,19 +406,21 @@ exmp_file_conus = '/Users/tomrink/data/OR_ABI-L1b-RadC-M6C14_G16_s20193140811215 exmp_file_fd = '/Users/tomrink/data/OR_ABI-L1b-RadF-M6C16_G16_s20212521800223_e20212521809542_c20212521809596.nc' -def make_for_full_domain_predict(clvrx_file, name_list=None, domain='FD'): +def make_for_full_domain_predict(clvrx_file, name_list=None, satellite='GOES16', domain='FD'): w_x = 16 w_y = 16 - if domain == 'CONUS': - exmpl_ds = xr.open_dataset(exmp_file_conus) - elif domain == 'FD': - exmpl_ds = xr.open_dataset(exmp_file_fd) - mdat = exmpl_ds.metpy.parse_cf('Rad') - geos = mdat.metpy.cartopy_crs - xlen = mdat.x.values.size - ylen = mdat.y.values.size - exmpl_ds.close() + # if domain == 'CONUS': + # exmpl_ds = xr.open_dataset(exmp_file_conus) + # elif domain == 'FD': + # exmpl_ds = xr.open_dataset(exmp_file_fd) + # mdat = exmpl_ds.metpy.parse_cf('Rad') + # geos = mdat.metpy.cartopy_crs + # xlen = mdat.x.values.size + # ylen = mdat.y.values.size + # exmpl_ds.close() + + geos, xlen, xmin, xmax, ylen, ymin, ymax = get_cartopy_crs(satellite, domain) h5f = h5py.File(clvrx_file, 'r')