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:

   http://www.pyngl.ucar.edu/Functions/Ngl.natgrid.shtml

You can also go to:

   http://www.pyngl.ucar.edu/Examples/functions.shtml

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

--Mary

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:
http://www.oceanographers.ru/mypict/S09_CO15_shorter_VELOS_1980-1999_10_more.txt

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

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

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

/usr/lib/python2.5/site-packages/PyNGL/Ngl.py 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: <test.py>

-- 
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
koldunovn_at_gmail.com
nikolay.koldunov_at_zmaw.de
ph. +49 40 428385430
Bundesstr. 53, room 146,
20146 Hamburg, Germany

_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
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