Re: [idvusers] Formula: vector field from direction

Hi Reinoud-

Reinoud Bokhorst wrote:
(second try, the first post became somehow attached to a previous post)

I am trying to make a vector plan view from (wave) directional data. The direction field contains values in radians. So I created the following new formula:

makeVector( sin(d*180/3.14159), cos(d*180/3.14159) )

When I apply this formula all goes well, i.e. I get to select the direction field from my data source and the vector view control is shown. It correctly shows that the vector values range from -1 to 1. However, no vectors are shown in the view.. What am I doing wrong? (IDV 2.7u2)

The problem is that the names of the derived fields end up the same which confuses the display mapping. Change the name of one of the fields using the newName procedure:

makeVector(newName( sin(d*180/3.14159),"U"),cos(d*180/3.14159) )

or for completeness, change them both:


Also, I found that setting the range in the control to -.1 to .1 makes a better display.

Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307