Skip to content
Snippets Groups Projects
Commit 52ff282f authored by tomrink's avatar tomrink
Browse files

switch to total column prediction for now - need more R&D

parent fa037591
No related branches found
No related tags found
No related merge requests found
...@@ -206,36 +206,27 @@ def plot_image2(image, cmap='Greys'): ...@@ -206,36 +206,27 @@ def plot_image2(image, cmap='Greys'):
plt.close() # Close current figure plt.close() # Close current figure
# Example GOES file to retrieve GEOS parameters in MetPy form (CONUS) def plot_image3(image, bt, cmap='Greys'):
exmp_file = '/Users/tomrink/data/OR_ABI-L1b-RadC-M6C14_G16_s20193140811215_e20193140813588_c20193140814070.nc'
# Full Disk geos, xlen, xmin, xmax, ylen, ymin, ymax = get_cartopy_crs('GOES16', 'CONUS')
#exmp_file = '/Users/tomrink/data/OR_ABI-L1b-RadF-M6C16_G16_s20212521800223_e20212521809542_c20212521809596.nc'
exmp_name = 'Rad'
# exmp_file = '/Users/tomrink/data/H08/HS_H08_20200601_0330_B01_FLDK.nc'
# exmp_name = 'RAD'
def plot_image3(image, cmap='Greys'):
exmpl_ds = xr.open_dataset(exmp_file)
mdat = exmpl_ds.metpy.parse_cf(exmp_name)
geos = mdat.metpy.cartopy_crs
x = mdat.x
y = mdat.y
fig = plt.figure(figsize=(15, 12)) fig = plt.figure(figsize=(15, 12))
ax = fig.add_subplot(1, 1, 1, projection=geos) ax = fig.add_subplot(1, 1, 1, projection=geos)
ax.set_extent([-105, -70, 15, 50], crs=ccrs.PlateCarree()) ax.set_extent([-105, -70, 15, 50], crs=ccrs.PlateCarree())
ax.imshow(image, cmap=cmap, origin='upper', extent=(x.min(), x.max(), y.min(), y.max()), transform=geos) #ax.imshow(bt, cmap=cmap, origin='upper', extent=(xmin, xmax, ymin, ymax), transform=geos)
#ax.imshow(image, cmap='YlGnBu', origin='upper', extent=(xmin, xmax, ymin, ymax), vmin=0.6, vmax=1.0, transform=geos)
ax.imshow(image, cmap='Blues', origin='upper', extent=(xmin, xmax, ymin, ymax), vmin=0.52, vmax=1.0, transform=geos)
ax.coastlines(resolution='50m', color='blue', linewidth=0.25) ax.coastlines(resolution='50m', color='blue', linewidth=0.25)
# ax.add_feature(ccrs.cartopy.feature.STATES, linewidth=0.25) ax.add_feature(ccrs.cartopy.feature.STATES, linewidth=0.25)
plt.title('GOES-16', loc='left', fontweight='bold', fontsize=15) plt.title('GOES-16', loc='left', fontweight='bold', fontsize=15)
fig.savefig('/Users/tomrink/image') fig.savefig('/Users/tomrink/image')
def make_icing_image(h5f, ice_lons, ice_lats, clvrx_str_time, satellite, domain, ice_lons_vld=None, ice_lats_vld=None, imagename='icing', extent=[-110, -60, 10, 55]): def make_icing_image(h5f, probs, ice_lons, ice_lats, clvrx_str_time, satellite, domain, ice_lons_vld=None, ice_lats_vld=None, imagename='icing', extent=[-110, -60, 10, 55]):
image = get_grid_values_all(h5f, 'temp_10_4um_nom')
geos, xlen, xmin, xmax, ylen, ymin, ymax = get_cartopy_crs(satellite, domain) geos, xlen, xmin, xmax, ylen, ymin, ymax = get_cartopy_crs(satellite, domain)
bg_image = None
if h5f is not None:
bg_image = get_grid_values_all(h5f, 'temp_10_4um_nom')
fig = plt.figure(figsize=(48, 30)) fig = plt.figure(figsize=(48, 30))
ax = fig.add_subplot(1, 1, 1, projection=geos) ax = fig.add_subplot(1, 1, 1, projection=geos)
...@@ -244,15 +235,17 @@ def make_icing_image(h5f, ice_lons, ice_lats, clvrx_str_time, satellite, domain, ...@@ -244,15 +235,17 @@ def make_icing_image(h5f, ice_lons, ice_lats, clvrx_str_time, satellite, domain,
ax.set_extent(extent, crs=geos) ax.set_extent(extent, crs=geos)
else: else:
ax.set_extent(extent, crs=ccrs.PlateCarree()) ax.set_extent(extent, crs=ccrs.PlateCarree())
ax.imshow(image, origin='upper', extent=(xmin, xmax, ymin, ymax), cmap='Greys', transform=geos) if bg_image is not None:
ax.imshow(bg_image, origin='upper', extent=(xmin, xmax, ymin, ymax), cmap='Greys', transform=geos)
if probs is not None:
ax.imshow(probs, cmap='Blues', origin='upper', extent=(xmin, xmax, ymin, ymax), vmin=0.52, vmax=1.0, transform=geos)
ax.coastlines(resolution='50m', color='green', linewidth=1.50) ax.coastlines(resolution='50m', color='green', linewidth=1.50)
# ax.add_feature(ccrs.cartopy.feature.STATES, linewidth=0.25) # ax.add_feature(ccrs.cartopy.feature.STATES, linewidth=0.25)
if ice_lons is not None: if ice_lons is not None:
ax.scatter(ice_lons, ice_lats, s=40.0, marker='o', color='blue', transform=ccrs.PlateCarree()) ax.scatter(ice_lons, ice_lats, s=40.0, marker='o', color='blue', transform=ccrs.PlateCarree())
if ice_lats_vld is not None: if ice_lats_vld is not None:
#ax.scatter(ice_lons_vld, ice_lats_vld, s=140.0, facecolors='none', marker='o', edgecolor='red', transform=ccrs.PlateCarree()) ax.scatter(ice_lons_vld, ice_lats_vld, s=180.0, marker='o', color='red', transform=ccrs.PlateCarree())
ax.scatter(ice_lons_vld, ice_lats_vld, s=140.0, marker='o', color='red', transform=ccrs.PlateCarree())
title = satellite+', '+clvrx_str_time+' >50% Probability Icing' title = satellite+', '+clvrx_str_time+' >50% Probability Icing'
plt.title(title, loc='left', fontweight='bold', fontsize=24) plt.title(title, loc='left', fontweight='bold', fontsize=24)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment