CoCalc Shared Filesatms391geodata / Week 13 / Week 13 Homework (answer key).ipynb
Author: Steve Nesbitt
Views : 5

# 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()