# [IDV #VIH-663165]: plotting wave direction vectors

• Subject: [IDV #VIH-663165]: plotting wave direction vectors
• Date: Fri, 15 Apr 2011 10:10:22 -0600

```> Hi Yuan,
> Still no luck.
> I created some value plots to see what's up with the data.
> Data are indeed in degrees. I saw no negative values.
> A value plot of cos(d*0.1745), which converts degrees to radians, just
> gives 1's everywhere. No surprise there as cos(0)=1.
> A value plot of cos(d), where d is degrees, gives expected values (based
> on the value plot of original directions).
> So, I retried my vector plot.
> Ranges are -1 to 1 for the vectors (but really, every one of them ought
> to be 1). I also tried a range of 0-2, just for fun. I varied vector
> size, vertical position, line width...no luck.
> But I see that you got a plot, so maybe you can tell me, explicitly,
> what steps you took?
> thanks,
> alan

Alan,
I still have no luck to reproduce the image I sent you.
It is better to use a formula, I have this formula tested:

def flowVectors(field):
a=newName(sin(field),"a")
b=newName(cos(field),"b")
return makeVector(a,b)

Let me know if you have trouble adding this formula, I will going to add this
to the py library too.

Yuan

>
> On 4/14/2011 1:44 PM, Unidata IDV Support wrote:
> >> Full Name: Alan Bol
> >> Organization: COMET
> >> Package Version: 2.9u2 build date:2010-10-04 19:14 UTC
> >> Operating System: Windows 7
> >> Hardware: Java: home: C:\Program Files (x86)\IDV_2.9u2\jre version:
> >> 1.6.0_20 j3d:1.5.2 fcs (build4)
> >> Description of problem: Hi guys,
> >> I've got a gridded file of ocean wave directions (degrees) that I'd like
> >> to plot as vectors. I made a stab at it but nothing shows up on the
> >> display.
> >> Here's what I did:
> >> 1. chose the file.
> >> 2. field sector/formulas/make flow vector from u and v
> >> 3. for u and v, I chose Misc/define a formula
> >> 4. for u, I entered sin(d), the selected my data file for d.
> >> 5. for v, I entered cos(d), and again chose my data file for d.
> >> 6. then, when I create display, nothing shows. But it doesn't show any
> >> errors, either.
> >> Any ideas?
> >>
> >> attached bundle and data file.
> >> thanks,
> >> alan
> >>
> >>
> > Alan,
> >       I think your data is between +/-360 degree, you need to convert to
> > radian. Also, in the vector display control, change the range to -1 to 1.
> > See the attached.
> >
> >
> > Yuan
> >
> > Ticket Details
> > ===================
> > Ticket ID: VIH-663165
> > Department: Support IDV
> > Priority: Normal
> > Status: Closed
>
> --
> Alan Bol
> Project Lead | Scientist | Instructional Designer
> The COMET Program | www.comet.ucar.edu
> 303.497.8334 voice | 8491 fax
>
>

Ticket Details
===================
Ticket ID: VIH-663165
Department: Support IDV
Priority: Normal
Status: Closed

```