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.
Hi Dave- > On Jul 22, 2008, at 1:35 PM, Unidata IDV Support wrote: > > > >> Dave Dempsey wrote: > > >> I've attached a sample bundle to illustrate. > > > > The formula you created ends up creating the Geostrophic wind at all > > levels and then picking out the specified levels and doing the > > subtraction. For version 2.5, that's really the only way to do it. > > For the latest nightly build, we've done a little better with > > GridMath so you can subtract slices without having to read the > > entire volume. So with the latest build, you could do: > > > > sub(top,bottom) > > > > and select the appropriate layer of the Geostrophic Wind Vector for > > top and bottom. That also ends up with a slider for the vertical > > position. > > Don, > > Here's where I need help with context--where would "sub" be invoked? You can either do it in the formula. I tend to use the Grids->Grid Diagnostic formula so I can type in a formula on the fly. > In a Jython library function invoked by a formula, or directly in a > formula? It looks to me like "sub" can handle scalar input only, which > suggests that it would have to be invoked on the components of the > geostrophic wind rather than the geostrophic wind vector, which > suggests that more than one line of code would be needed to calculate > the thermal wind, which suggests that an alternative version of "thrm" > would need to be created that invokes "sub". Actually, in this case, the components are subtracted correctly. The vectors are (u1,v1) and (u2,v2) and when you call sub, it ends up being (u1-u2, v2-v2). Actually, I should have told you to use vsub(top,bottom) which then just calls sub(top,bottom). > I'm probably missing something badly here, which is no surprise! Nah, that was just a bit of behind the scenes trickery. Don Ticket Details =================== Ticket ID: KWG-597166 Department: Support IDV Priority: Normal Status: Open