Skip to content
Snippets Groups Projects
Commit 1938276d authored by tomrink's avatar tomrink
Browse files

minor...

parent 8ba40d93
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import tensorflow as tf
import matplotlib
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import xarray as xr
import os
from util.setup import home_dir
......@@ -196,4 +197,23 @@ def plot_image2(image, cmap='Greys'):
# Wrap up
fig.clf() # Otherwise fig stays open every time
plt.close() # Close current figure
\ No newline at end of file
plt.close() # Close current figure
# Example GOES file to retrieve GEOS parameters in MetPy form (CONUS)
exmp_file = '/Users/tomrink/data/OR_ABI-L1b-RadC-M6C14_G16_s20193140811215_e20193140813588_c20193140814070.nc'
def plot_image3(image, cmap='Greys'):
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
fig = plt.figure(figsize=(15, 12))
ax = fig.add_subplot(1, 1, 1, projection=geos)
ax.imshow(image, origin='upper', extent=(x.min(), x.max(), y.min(), y.max()), transform=geos)
ax.coastlines(resolution='50m', color='black', linewidth=0.25)
ax.add_feature(ccrs.cartopy.feature.STATES, linewidth=0.25)
plt.title('GOES-16', loc='left', fontweight='bold', fontsize=15)
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