Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

CONUS Water Vapor #2

Closed
WxmanJ opened this issue Oct 9, 2018 · 2 comments
Closed

CONUS Water Vapor #2

WxmanJ opened this issue Oct 9, 2018 · 2 comments

Comments

@WxmanJ
Copy link

WxmanJ commented Oct 9, 2018

I tried your CONUS water vapor (mapping_GOES_16_data_CONUS_WaterVapor.py) almost verbatim. The only difference was I used an infrared channel instead of the wv channel. It displayed correctly for the initial GEOS figure, but I received a blank image for the LCC. I had the vmin=170 and vmax=370. I also used the 'Greys_r' cmap.

from netCDF4 import Dataset
import numpy as np
from datetime import datetime, timedelta
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from pyproj import Proj

p = Proj(proj='geos', h='35786023.0', lon_0='-89.5', sweep='x')

C_file = '/home/awips/scripts/Data/raw/CH13/OR_ABI-L2-CMIPF- M3C13_G16_s20182691245351_e20182691256129_c20182691256207.nc'
C = Dataset(C_file, 'r')

#from matplotlib.colors import LinearSegmentedColormap

#cmap_WV = LinearSegmentedColormap.from_list('this', ['darkgreen', 'green', 'lightgreen', 'white',   'blue', 'yellow', 'red', 'k'])

# Channel 13 Data
WV10 = C.variables['CMI']

h = C.variables['goes_imager_projection'].perspective_point_height
X = C.variables['x'][:] * h
Y = C.variables['y'][:] * h

# GOES-16 image on geostationary projection
m = Basemap(projection='geos', lon_0='-89.5',
            resolution='i', area_thresh=1500,
            llcrnrx=X.min(),llcrnry=Y.min(),
            urcrnrx=X.max(),urcrnry=Y.max())

# Long-Wave IR GEOS
plt.figure(1)
m.imshow(np.flipud(WV10), cmap='Greys_r', vmax=378, vmin=170)
m.drawcoastlines()
m.drawcountries()
m.drawstates()

plt.title('GOES-16 ABI Channel 10: Low-Level Troposphere WV Band' % ())
cb = plt.colorbar(orientation='horizontal', pad=.01, shrink=.75)
cb.set_label('Brightness Temperature (K)')

# Convert map points to lats/lons
Xs, Ys = np.meshgrid(X, Y)
lons, lats = p(Xs, Ys, inverse=True)

## Plot GOES-16 on HRRR Map:
Hm = Basemap(resolution='i', projection='lcc', area_thresh=1000, \
         width=1800*3000, height=1060*3000, \
         lat_1=38.5, lat_2=38.5, \
         lat_0=38.5, lon_0=-97.5)

Hx, Hy = Hm(lons, lats)

 #Long-Wave IR
 plt.figure(4)
 m = Hm.pcolormesh(Hx, Hy, WV10, cmap='Greys_r', vmax=378, vmin=170)
 Hm.drawstates()
 Hm.drawcountries()
 Hm.drawcoastlines()
 plt.title('GOES-16 ABI Channel 10: Low-Level Troposphere WV Band' % ())
 cb = plt.colorbar(orientation='horizontal', pad=.01, shrink=.75)
 cb.set_label('Brightness Temperature (K)')

 plt.show()

figure_4

@blaylockbk
Copy link
Owner

blaylockbk commented Oct 10, 2018

Interesting. Look at the values and variable properties for the channel you are using and make sure they look right.

Also, try adding the latlon=True argument in the line where you have m = Hm.pcolormesh(Hx, Hy, WV10, cmap='Greys_r', vmax=378, vmin=170) . Since you say the plt.imshow image worked, I'm pretty sure that missing argument is the problem for the LCC map projected image.

@blaylockbk
Copy link
Owner

blaylockbk commented Oct 10, 2018

FYI: That script was a little half-baked, and I never finished it because I didn't need it in my own research. You can look at these two resources that show similar methods for showing GOES16 on a map (in Python 3)...https://github.com/blaylockbk/pyBKB_v3/blob/master/BB_GOES/mapping_GOES16_TrueColor.ipynb

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants