[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IDV #XIW-870909]: U and V components to Wind Direction

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [IDV #XIW-870909]: U and V components to Wind Direction
  • Date: Mon, 23 Nov 2009 06:36:16 -0700

Hi Simon-

> Full Name: Simon Metcalf
> Email Address: address@hidden
> Organization: NSW Rural Fire Service
> Package Version: 2.7u2 build date:2009-08-26 16:33 UTC
> Operating System: Windows XP
> Hardware: Java: home: C:\Program Files\IDV_2.7u2\jre version: 1.6.0_13 
> j3d:1.5.2 fcs (build4)
> Description of problem: Dear Team,
> 
> Does anyone have a working function for U & V to Wind Direction?  I've tried 
> to build the function myself but have run into problems, particularly its 
> inability to recognise pi and also how to build IF statements into a 1-line 
> function.  The closest I got was as follows, which (if pi worked) would 
> return values between -180 and 180 degrees.  Is it possible to add this 
> function to the default (derived functions) in future versions so the 
> multi-coloured Flow Vectors from WSpd and WDir work using U and V?
> 
> atan2(-1*U,-1*V)*180/pi

Use either the dirn()(north direction) or dirr()(grid relative) function.
If you have a lat/lon grid, just use dirr(vecr(u,v)).  Otherwise, 
use dirn(vecr(u,v)).  See the griddiag section of this page:

http://www.unidata.ucar.edu/software/IDV/docs/userguide/tools/JythonLib.html

Don Murray  


Ticket Details
===================
Ticket ID: XIW-870909
Department: Support IDV
Priority: Normal
Status: Open