Use the new Cartopy WMTS capabilities to plot some MODIS data


In [1]:
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from owslib.wmts import WebMapTileService

In [2]:
url = 'http://map1c.vis.earthdata.nasa.gov/wmts-geo/wmts.cgi'
wmts = WebMapTileService(url)

In [3]:
modis_layers = [s for s in sorted(list(wmts.contents)) if 'MODIS' in s  ]

In [4]:
modis_layers


Out[4]:
['MODIS_Aqua_Aerosol',
 'MODIS_Aqua_Brightness_Temp_Band31_Day',
 'MODIS_Aqua_Brightness_Temp_Band31_Night',
 'MODIS_Aqua_Chlorophyll_A',
 'MODIS_Aqua_Cloud_Top_Pressure_Day',
 'MODIS_Aqua_Cloud_Top_Pressure_Night',
 'MODIS_Aqua_Cloud_Top_Temp_Day',
 'MODIS_Aqua_Cloud_Top_Temp_Night',
 'MODIS_Aqua_CorrectedReflectance_Bands721',
 'MODIS_Aqua_CorrectedReflectance_TrueColor',
 'MODIS_Aqua_Data_No_Data',
 'MODIS_Aqua_Land_Surface_Temp_Day',
 'MODIS_Aqua_Land_Surface_Temp_Night',
 'MODIS_Aqua_Sea_Ice',
 'MODIS_Aqua_Snow_Cover',
 'MODIS_Aqua_SurfaceReflectance_Bands121',
 'MODIS_Aqua_SurfaceReflectance_Bands143',
 'MODIS_Aqua_SurfaceReflectance_Bands721',
 'MODIS_Aqua_Water_Vapor_5km_Day',
 'MODIS_Aqua_Water_Vapor_5km_Night',
 'MODIS_Combined_Value_Added_AOD',
 'MODIS_Terra_Aerosol',
 'MODIS_Terra_Brightness_Temp_Band31_Day',
 'MODIS_Terra_Brightness_Temp_Band31_Night',
 'MODIS_Terra_Chlorophyll_A',
 'MODIS_Terra_Cloud_Top_Pressure_Day',
 'MODIS_Terra_Cloud_Top_Pressure_Night',
 'MODIS_Terra_Cloud_Top_Temp_Day',
 'MODIS_Terra_Cloud_Top_Temp_Night',
 'MODIS_Terra_CorrectedReflectance_Bands367',
 'MODIS_Terra_CorrectedReflectance_Bands721',
 'MODIS_Terra_CorrectedReflectance_TrueColor',
 'MODIS_Terra_Data_No_Data',
 'MODIS_Terra_Land_Surface_Temp_Day',
 'MODIS_Terra_Land_Surface_Temp_Night',
 'MODIS_Terra_Sea_Ice',
 'MODIS_Terra_Snow_Cover',
 'MODIS_Terra_SurfaceReflectance_Bands121',
 'MODIS_Terra_SurfaceReflectance_Bands143',
 'MODIS_Terra_SurfaceReflectance_Bands721',
 'MODIS_Terra_Water_Vapor_5km_Day',
 'MODIS_Terra_Water_Vapor_5km_Night',
 'MODIS_Water_Mask']

In [5]:
layer = 'MODIS_Terra_CorrectedReflectance_TrueColor'

In [6]:
plt.figure(figsize=(12,8))
ax = plt.axes(projection=ccrs.PlateCarree())
ax.add_wmts(url, layer)
#ax.set_extent((-15, 25, 35, 60))
ax.set_extent((10, 40, 35, 50))
plt.title(layer)
plt.show()



In [6]:


In [6]: