from IPython.core.display import Image from owslib.wms import WebMapService from mpl_toolkits.basemap import Basemap # Mercator Basemap for Baja California lon_min = -118.8 lon_max = -108.6 lat_min = 22.15 lat_max = 32.34 m = Basemap(llcrnrlon=lon_min, urcrnrlat=lat_max, urcrnrlon=lon_max, llcrnrlat=lat_min, resolution='l', projection='merc') urlbase='http://motherlode.ucar.edu:8080/thredds/wms/fmrc/NCEP/NAM/CONUS_12km/NCEP-NAM-CONUS_12km-noaaport_best.ncd?' wms = WebMapService(urlbase) img = wms.getmap(layers=['Temperature_height_above_ground'],styles=['boxfill/rainbow'],time='2012-10-16T00:00:00.000Z',transparent=True, srs='EPSG:4326',bbox=(lon_min,lat_min,lon_max,lat_max),size=(256,256),format='image/png',elevation='2') # add on the additional custom WMS arguments supported by ncWMS to define color range, colorbands and scale type url = img.url + '&COLORSCALERANGE=271.2%2C308&NUMCOLORBANDS=20&LOGSCALE=false' Image(url=url,format=u'png') # What's wrong with my syntax on warpimage? m.warpimage(url) m.drawcoastlines(linewidth=0.25)