Revision: 8982 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8982&view=rev Author: jswhit Date: 2011-02-12 16:10:15 +0000 (Sat, 12 Feb 2011)
Log Message: ----------- add comments. Modified Paths: -------------- trunk/toolkits/basemap/examples/lic_demo.py Modified: trunk/toolkits/basemap/examples/lic_demo.py =================================================================== --- trunk/toolkits/basemap/examples/lic_demo.py 2011-02-12 16:08:44 UTC (rev 8981) +++ trunk/toolkits/basemap/examples/lic_demo.py 2011-02-12 16:10:15 UTC (rev 8982) @@ -8,7 +8,7 @@ try: from scikits.vectorplot import lic_internal except ImportError: - raise ImportError('need vectorplot scikit for this example') + raise ImportError('need vectorplot scikit for this example') # H*wind data from http://www.aoml.noaa.gov/hrd/data_sub/wind.html ncfile = NetCDFFile('rita.nc') @@ -20,7 +20,7 @@ lons, lats = np.meshgrid(lons1,lats1) ncfile.close() -# downsample to finer grid. +# downsample to finer grid for nicer looking plot. nlats = 2*udat.shape[0]; nlons = 2*udat.shape[1] lons = np.linspace(lons1[0],lons1[-1],nlons) lats = np.linspace(lats1[0],lats1[-1],nlats) @@ -31,11 +31,13 @@ fig = plt.figure(figsize=(8,8)) m = Basemap(projection='cyl',llcrnrlat=lats1[0],llcrnrlon=lons1[0],urcrnrlat=lats1[-1],urcrnrlon=lons1[-1],resolution='i') +# pass texture, kernel and data to LIC function from vectorplot. kernellen=31 texture = np.random.rand(udat.shape[0],udat.shape[1]).astype(np.float32) kernel = np.sin(np.arange(kernellen)*np.pi/kernellen).astype(np.float32) image = lic_internal.line_integral_convolution(udat.astype(np.float32),\ vdat.astype(np.float32), texture, kernel) +# plot the resulting image. im = m.imshow(image,plt.cm.gist_stern) m.drawcoastlines() m.drawmeridians(np.arange(-120,-60,2),labels=[0,0,0,1]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins