On 1/20/12 3:12 AM, Mathew Topper wrote:
Hi Jeff,

Sorry, an XYZ file is simply an ASCII file which can have either LON,LAT,HEIGHT entries or Cartesian X,Y,HEIGHT entries. I think I have confused myself a little here, as all I need to do is print the LON,LAT,HEIGHT data to a file and I've finished, and basemap is not required for this. The original question was whether once a basemap had been defined is there an easy way to extract the Cartesian coordinates to produce an XYZ file containing the Cartesian coordinates for the chosen projection rather than the geographic ones?

Thanks

Mat

PS. This is in all in the context of converting data for use in a software package called MIKE. It sadly lacks the ability to deal with NetCDF files directly.

Mat: If you have the longitudes and latitudes in numpy arrays lons, lats, and m is a Basemap instance,

x,y = m(lons,lats)

gives you the projection coordinates.

-Jeff

On 19/01/12 16:54, Jeff Whitaker wrote:
On 1/19/12 5:55 AM, Mathew Topper wrote:
Hi,

I was wondering how hard it would be to generate xyz format files from netcdf files using python-netcdf4 and basemap? It seems that basemap has the capabilities to do those sort of conversions, but I am a bit of a novice to map data and I'm not sure what would be the correct approach to this.

Many Thanks

Mat
Mat:

What's an xyz file?

-Jeff
--
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  :jeffrey.s.whita...@noaa.gov
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    :http://tinyurl.com/5telg

--
Dr. Mathew Topper
Institute for Energy Systems
School of Engineering
The University of Edinburgh
Faraday Building
The King’s Buildings
Edinburgh EH9 3JL
Tel: +44 (0)131 650 5570
School fax: +44 (0)131 650 6554
mathew.top...@ed.ac.uk <mailto:mathew.top...@ed.ac.uk>
http://www.see.ed.ac.uk <http://www.see.ed.ac.uk/>


The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to