Another way of getting contour co-ordinates [SEC=UNCLASSIFIED]

Hi Patrick,
I had to deal with this as well as I used Matplotlib’s contourer to return position of features (eg certain levels of vorticity or MSLP)

instead of basemapping it I just made a contour from the lat lons (ie cs=countour(lats, lons, field, levels=linspace(min,max,nl))

–code—code–
def generate_contour(lat,lon,data,level):
#This program uses the matplotlib contouring program to generate a list of
#verticies at a constant contour level
f=figure()
C=contour(lon,lat,data, [level])
col=C.collections
vertex_list=col[0].get_verts()
close(f)
return vertex_list
–code–code–code–

Dr Scott Collis
Postdoctoral Researcher
Centre for Australian Weather and Climate Research (CAWCR)
Atmosphere and Land Observation and Assessment Group
Australian Bureau of Meteorology Room 9.57 Level 9 700 Collins Street Docklands 3008
Desk: (+613) 96694766
MB: 0412177550
http://www.bom.gov.au/bmrc/wefor/staff/scollis/

Message: 1

···

Date: Sat, 2 Aug 2008 16:53:40 -0500
From: “Patrick Marsh” <marsh.patrick+matplotlib@…287…>
Subject: [Matplotlib-users] Retrieve Coordinates from Contour
To: matplotlib-users <matplotlib-users@…642…ts.sourceforge.net>
Message-ID:
<ea0d12780808021453y6c2c9296w39f226554ef3f16e@…288…>
Content-Type: text/plain; charset=“iso-8859-1”

Hi Everyone,

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.

Thanks,

-Patrick Marsh
Graduate Student
School of Meteorology
University of Oklahoma