Re: Vector Angles

From: Dave Brown (dbrown@XXXXXX)
Date: Thu Dec 12 2002 - 17:44:54 MST

  • Next message: sgillies@frii.com: "HDF support in LINUX RH7.2 binary distribution?"

    Hi Kevin,

    After looking at the code you sent me, I have concluded the
    problem is that you need to add the following call somewhere
    after the VVRSET and before the VVINIT calls:

            CALL VVSETI('TRT', 0)

    This sets the 'transformation type' parameter so that the vector direction
    is *not* mapped into the coordinate space defined by the X and Y
    coordinate axes. This setting is commonly required for vertical plots
    such as yours, where the units of the X and Y axes are different, and
    do not represent literal geographic coordinates. In your plot space,
    up is positive height in km, and right is positive time in hours, but
    for the vectors, up should mean north and right should mean east. Setting
    TRT to 0 disassociates the vector direction from the plot space.

    The reason the right-angled arrows appeared correct is that they have
    only a single component (u or v), and thus are not affected by the
    incompatible scaling of the two axes.

    See http://ngwww.ucar.edu/ngdoc/ng4.3/supplements/vectors/#HEADING1-649
    for more information.
     -dave
     dbrown@ucar.edu

    On Thu, 12 Dec 2002, Kevin Rosser wrote:

    > I have been using the vvinit/vvectr combo to produce vector maps of NOAA
    > wind data sets. The data set has vector speed (m/s) and angles
    > (degrees). I made a dummy data set that provided vectors in a constant
    > change of direction from 000-360 and the results are not 000-360. For
    > instance the portion from 000-035 looks more like 000-090 degrees. A 5
    > degree change looks like 30 degrees in change on the plot.
    >
    > Odd thing about it the 0-90-180-270 arrows are in the right directions
    > but the amounts in-between are greatly exaggerated.
    >
    > I have set PLR to 1 prior to making the vvinit call. In all other
    > aspects the plot looks correct.
    >
    > Below is an excerpt of my call to vector plot.
    >
    > c********Set up vectors
    > c CALL VVRSET
    > CALL SET (.1,.95,.20,.90,00.,25.,0.0,wtop,1)
    > CALL VVSETI ('SET - DO-SET-CALL-FLAG',0)
    > CALL VVSETR ('XC1 - X COORDINATE AT INDEX 1',1.)
    > CALL VVSETR ('XCM - X COORDINATE AT INDEX M',24.)
    > CALL VVSETR ('YC1 - Y COORDINATE AT INDEX 1',wbot)
    > CALL VVSETR ('YCN - Y COORDINATE AT INDEX N',wtop)
    > c********PLR 1= U ARRAY IN VECTOR MAG, V ARRAY IN < DEGREES
    > CALL VVSETI ('PLR - POLAR INPUT MODE',1)
    > CALL VVSETI ('AST - ARROW STYLE',1)
    > CALL VVSETI ('SVF - SPECIAL VALUE FLAG',3)
    > CALL VVSETR ('USV - SPECIAL VALUE',999.9)
    > CALL VVSETR ('VSV - SPECIAL VALUE',999.)
    > CALL VVINIT (ms,LX,angle,LX,ZDAT,LX,LX,23,WRK,0)
    > CALL VVSETR ('VRM - VECT REF MAG',20.)
    > CALL VVSETC ('MNT - MIN VECT REF','Reference Low Vector')
    > CALL VVSETC ('MXT - MAX VECT REF','Reference High Vector')
    > c********call to move the min-max text for wind barbs
    > CAll VVSETR ('MNX - MIN VECTOR TEXT BLOCK X CORD',.4)
    > CALL VVSETR ('MNY - MIN VECTOR TEXT BLOCK Y CORD',-.06)
    > CALL VVSETR ('MXX - MAX VECTOR TEXT BLOCK X CORD',.5)
    > CALL VVSETR ('MXY - MAX VECTOR TEXT BLOCK Y CORD',-.06)
    > CALL VVECTR (ms,angle,IDM,IDM,IDM,IDM)
    > CALL LABMOD ('(F5.0)','(F5.3)',0,0,0,0,0,0,0)
    > CALL GRIDAL (5,0,37,0,1,1,5,10.,0.)
    > CALL SET (0.,1.,0.,1.,0.,1.,0.,1.,1)
    > CALL WTSTR (.4,.95,station,2,0.,0.)
    > CALL WTSTR (.5,.95,date(I,J-2),2,0.,0.)
    > CALL PLCHHQ (.03,.6,'HEIGHT IN KILOMETERS',.012,90.,0.)
    > CALL PLCHHQ (.5,.1,'TIME OF DAY (PST) HOUR 1-24',.012,0.,0.)
    >
    > CALL FRAME
    >
    > --
    > Kevin Rosser
    > Environmental Planner
    > Tehama County, CA
    >
    >
    > _______________________________________________
    > ncarg-talk mailing list
    > ncarg-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncarg-talk
    >

    _______________________________________________
    ncarg-talk mailing list
    ncarg-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncarg-talk



    This archive was generated by hypermail 2b29 : Fri Dec 13 2002 - 09:34:01 MST