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

[IDV #PWO-933032]: Wind shear problems



Hi Jim-

> Hello,
> First-off I just realized I was calculating the magnitude of shear the wrong 
> way.
> The formula I am using now is sqrt((Tu-Bu)*(Tu-Bu) + (Tv-Bv)*(Tv-Bv)).
> So I guess the answer to your question is yes, I am only interested in the 
> magnitude of wind shear.
> Is there something I could do so I could use this function?

You could modify the system formula slightly to do what you want.

- Use the Edit->Formulas->Jython Library menu to bring up the Jython editor.

- In the User's library pane, paste the following Jython procedure:

def windShearMag(u, v, top, bottom):
   udiff = layerDiff(u, top, bottom)
   vdiff = layerDiff(v, top, bottom)
   windDiff = sqrt(udiff*udiff + vdiff*vdiff)
   return windDiff

and then press the Save button.

- Right click on the windShearMag line in the editor and select the "Create 
Formula" option.
In the Formula Editor that pops up, change the formulat to:

windShearMag(u, v, user_top, user_bottom)

to allow you to pick the top and bottom layers.   If you want to hardcode
the levels, just put them in instead of user_top and user_bottom.

- Save the formula.  Load in your datasets and select the windShearMag formula.
Enter the top and bottom layers in the first dialog and then select your u and
v levels in the second dialog.  

Don Murray



Ticket Details
===================
Ticket ID: PWO-933032
Department: Support IDV
Priority: Normal
Status: Open