How to access right lon, lat information of curvilinear grids?

From: Mario Krapp <mario.krapp_at_nyahnyahspammersnyahnyah>
Date: Wed, 10 Jun 2009 16:44:59 +0200

Hi,

I could not find out, how to make a contour_map/vector_map plot with data on a curvilinear grid.
The data I wanted to plot is the scalar temp(time,lev,lon,lat)
I read the data as follows:
---cut---
ncfile_sst = Nio.open_file("sst.elnino3.nc","r")
temp = ncfile_sst.variables["var2"]
lon = ncfile_vel.variables["lon"]
lat = ncfile_vel.variables["lat"]
---cut---
while lon = lon(x,y) and lat = lat(x,y) are 2D arrays

I tried using
---cut---
tempres.sfXArray = lon[:,:]
tempres.sfYArray = lat[:,:]
...
co = Ngl.contour_map(wks,temp[0,0,:,:],tempres)
---cut---

but I get this error message:
warning:ScalarFieldInitialize: 2d coordinate array sfXArray has an incorrect dimension size: defaulting sfXArray
warning:ScalarFieldInitialize: 2d coordinate array sfYArray has an incorrect dimension size: defaulting sfYArray

This data is plotted on the map, but the locations correspond to the x-y coordinates temp(x,y) instead of temp(lon,lat).

Cheers Mario
_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Wed Jun 10 2009 - 08:44:59 MDT

This archive was generated by hypermail 2.2.0 : Tue Jun 16 2009 - 10:06:42 MDT