Jason Li wrote:
> Hi Jeff,
> 
> Thanks for your help in the past. Just wondering if I can ask another 
> question. This is with regard to plotting irregularly spaced geophysical 
> data.
> 
> I have been happy plotting gridded data away using matplotlib/basemap. 
> Now I want to try irregularly spaced satellite data (swath data), using 
> the confourf function.  Basically to replace our IDL program to make 
> plots like this:
> 
> http://aurapar2u.ecs.nasa.gov/airscal2/Aqua_AIRS_Level1/AIRIBRAD.005/2008/001/AIRS.2008.01.01.067.L1B.AIRS_Rad.v5.0.0.0.G08003111751.hdf.jpg
>  
> 
> 
> 
> I have not had much luck yet.  In the following example, lat and lon are 
> 2D arrays.
> 
> map = Basemap(projection='cyl', lon_0=0, ax=ax, llcrnrlon=minLon, 
> llcrnrlat=minLat, urcrnrlon=maxLon, urcrnrlat=maxLat)
> x, y = map(lon, lat)
> cs = map.contourf(x, y, obs, levels, cmap=myPrettyCmap)
> 
> The error message:
> 
> File 
> "/usr/local//lib/python2.5/site-packages/matplotlib/toolkits/basemap/basemap.py",
>  
> line 2442, in contourf
>    xl = xx.compress(condition).tolist()
> AttributeError: compress
> 
> 
> Do you have a good example as how to do this kind of thing?
> 
> thanks
> 

Jason:  contourf expects gridded data.  I think you need to use one of 
the approaches outlined in the cookbook entry

http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data

to grid your data, then plot it.

If you'd like to send me a sample of the data, I can show you what I mean.

-Jeff

-- 
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : [EMAIL PROTECTED]
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to