CoCalc Shared Filesatms391geodata / Week 13 / Week 13 Homework (answer key).ipynbOpen in CoCalc with one click!
Author: Steve Nesbitt
Views : 5

ATMS 391 Geophysical Data Analysis

Homework 13: Image manipulation and analysis


(1) Open the satellite data file, and plot it on a basemap.

In [27]:
%pylab inline import xray import scipy.ndimage #missing/bad data in the dataset are set to 330.0 #these are NOAA Climate Prediction Center merged IR brightness temperatures (4 km resolution) #the data are Parallax-corrected, meaning that in the shadows of clouds, there is missing data #also, the Geostationary satellites don't scan the whole disk every hour, so there are missing regions data=xray.open_dataset('2015-11-29T1130_merg4km.nc') data im=data['brightness_temperature'].isel(time=0) #reduce the resolution of the image to make it use less memory/cpu im=im[::4,::4]
Populating the interactive namespace from numpy and matplotlib

(2) Filter out the missing pixels near cloud shields due to the geostationary parallax correction.

In [28]:
plt.figure(figsize=(15,11)) plt.imshow(im.values,origin='lower') #plt.colorbar()
<matplotlib.image.AxesImage at 0x7f99cd5f5f90>
In [32]:
masked=im.values.copy() masked[masked>325]=0. im_closed=scipy.ndimage.grey_closing(masked, size=(3,3)) im_closed[im_closed==0]=330. plt.figure(figsize=(15,11)) plt.imshow(im_closed,origin='lower')
<matplotlib.image.AxesImage at 0x7f9a42e77950>