Re: Problem with vector plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 4 Aug 2008 09:47:54 -0600 (MDT)

Hi Nikolay,

I'm afraid you can't generate vectors from random data yet like you
can with contours. You need to regrid your vector data onto a 2D grid
and generate the vectors from that.

We have one such routine for doing the regridding. See:

You can also go to:

and scroll down to "Ngl.natgrid" to see which of our examples
call this particular function.

The error message you're getting below is not a good one. I think we've
fixed this in the new release, because all I got was:

   vector_map - arrays must be 2D


On Sat, 2 Aug 2008, Nikolay Koldunov wrote:

> Dear all,

I am trying to create a vector plot using data in polar coordinates,
but getting the error, which is below. The script is in attachment and
the data file is located here:

Can you please help me with this, I have no idea where to look to get
rid of this problem :(
Thanks in advance

In [1]: run
<type 'exceptions.IndexError'> Traceback (most recent call last)

/home/magik/Рабочий стол/WORK/ART_CALC/SIC/TRANSPORT/ in <module>()
      38 resources.tiMainString = "Currents"
---> 40 plot = Ngl.vector_map(wks,U_ang,V_mag,resources)

/usr/lib/python2.5/site-packages/PyNGL/ in vector_map(wks,
uarray, varray, rlistc)
    5229 #
    5230 ivct = vector_map_wrap(wks,uarray,varray,"double","double", \
-> 5231 uarray.shape[0],uarray.shape[1],0, \
    5232 pvoid(),"",0,pvoid(),"", 0, 0, pvoid(), pvoid(), \
    5233 rlist1,rlist2,rlist3,pvoid())

<type 'exceptions.IndexError'>: tuple index out of range
WARNING: Failure executing file: <>

Nikolay Koldunov
International Max Planck Research School on Earth System Modelling,
Institut für Meereskunde der Universität Hamburg,
Zentrum für Meeres- und Klimaforschung
ph. +49 40 428385430
Bundesstr. 53, room 146,
20146 Hamburg, Germany

pyngl-talk mailing list
Received on Mon Aug 04 2008 - 09:47:54 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 21 2008 - 22:13:03 MDT