In [1]:
import matplotlib.pyplot as plt
import iris
import iris.plot as iplt
import iris.quickplot as qplt
## netCDF via IRIS example
## Live 8.5 * darkblue-b
##
In [2]:
## Convert a DEM GeoTIFF to netCDF with gdal
!rm 'SanMateo_CA.cf'
!gdal_translate -of netcdf SanMateo_CA.tif SanMateo_CA.cf
## previously extracted from a large USGS DEM via
## gdal_translate -projwin -122.44 37.7 -122.2 37.4 -of GTiff imgn38w123_1.img SanMateo_CA.tif
In [3]:
## Open the netCDF with IRIS
res = iris.load('SanMateo_CA.cf')
print ' TYPE: ', type(res)
print 'CUBES: ', res
print ' REPR: ', res[0]
In [17]:
## color visualization of elevation data using IRIS Quickplot
iplt.pcolormesh(res[0], cmap=plt.get_cmap('gist_earth'))
iplt.show()
In [18]:
contour = qplt.contour(res[0])
## use the center point for a quick demo
lon = -122.3200000
lat = 37.5500000
plt.scatter(lon, lat, marker=(5, 1), color='red', s=200)
plt.title("Welcome to San Mateo")
plt.show()
In [ ]: