Thanks for the quick reply.
I may not have been totally clear on
what I’m trying to save (or I totally misunderstood what you were
trying to say - which is certainly possible).
I’m not wanting to
save the lat, lon pairs from the map projection. I’m trying to save
the lat, lon pairs of the contour. Using my original example, if I’m
plotting winds every 5 m/s, I’m wanting to pull off the lat, lon pairs
for the 5 m/s contours.
I’ll check out the website and see if I find anything there.
On Sat, Aug 2, 2008 at 6:13 PM, Jeff Whitaker <jswhit@…146…> wrote:
Patrick Marsh wrote:
First email here…
I am plotting meteorological data using matplotlib and basemap - and can do this just fine. However, I would like to backout the coordinates being used for the contours that are plotted.
For example, if I were to contour windspeed every 5 m/s and plot this (which I can do just fine), I would like to save a copy of the lat, lon pairs as a text file. However, I cannot for the life of me figure out how to do this. I have a feeling it is pretty simple and I’m just over looking something that can do this. Any help would be appreciated.
School of Meteorology
University of Oklahoma
Patrick: contour and contourf return a ContourSet object. ContourSet.collections is a matplotlib LineCollection (for contour) or a PolyCollection (for contourf). You can retrieve the x,y (map projection) coordinates from these, and transfer them back to lat/lon coordinates using the Basemap instance via
lons,lats = map(x,y,inverse=True) # map is a Basemap instance.
See http://matplotlib.sourceforge.net/doc/html/api/collections_api.html for more info on matplotlib collection objects.
This SF.Net email is sponsored by the Moblin Your Move Developer’s challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Matplotlib-users mailing list
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328