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 > > Thank you very much for the advice. I have edited the portion what gave the > error by adding "make2D(item)"& i now get a result. The unit is also correct > (m²/s²) > > Now I would like to ask you one last question on this jython code. perhaps > you can help me with this one too. > > The original formula calculates the Storm relative helicity of a normal storm > motion > umotion = 0.75 * umean > vmotion = 0.75 * vmean > > I would now like to do the same jython, but applied to the deviant storm > motion of a right moving supercel. > the formula to calculate the deviant storm motion (u & v component) is this > one: > > umotion=((umean+(7.5/(shear))*vshear)) > vmotion=((vmean-(7.5/(shear))*ushear)) > > so plugged in the full jython it looks like this: > > def srh3km(u, v, top, bottom, unit=None): > u1000=getSliceAtLevel(u, 100000) > u950=getSliceAtLevel(u, 95000) > u900=getSliceAtLevel(u, 90000) > u850=getSliceAtLevel(u, 85000) > u800=getSliceAtLevel(u, 80000) > u750=getSliceAtLevel(u, 75000) > u700=getSliceAtLevel(u, 70000) > v1000=getSliceAtLevel(v, 100000) > v950=getSliceAtLevel(v, 95000) > v900=getSliceAtLevel(v, 90000) > v850=getSliceAtLevel(v, 85000) > v800=getSliceAtLevel(v, 80000) > v750=getSliceAtLevel(v, 75000) > v700=getSliceAtLevel(v, 70000) > > umean=layerAverage(u, bottom, top, unit) > vmean=layerAverage(v, bottom, top, unit) > > ushear=layerDiff(u, 50000, 100000, unit) > vshear=layerDiff(v, 50000, 100000, unit) > > shear=sqrt(ushear*ushear+vshear*vshear) > > ****************************************************** > umotion=((umean+(7.5/(shear))*vshear)) <= Problem resides here: "unit > exception" > vmotion=((vmean-(7.5/(shear))*ushear)) <= Problem resides here: "unit > exception" > ****************************************************** > > srh1=((make2D(u950)-make2D(umotion))*(make2D(v1000)-make2D(vmotion))-(make2D(u1000)-make2D(umotion))*(make2D(v950)-make2D(vmotion))) > srh2=((make2D(u900)-make2D(umotion))*(make2D(v950)-make2D(vmotion))-(make2D(u950)-make2D(umotion))*(make2D(v900)-make2D(vmotion))) > srh3=((make2D(u850)-make2D(umotion))*(make2D(v900)-make2D(vmotion))-(make2D(u900)-make2D(umotion))*(make2D(v850)-make2D(vmotion))) > srh4=((make2D(u800)-make2D(umotion))*(make2D(v850)-make2D(vmotion))-(make2D(u850)-make2D(umotion))*(make2D(v800)-make2D(vmotion))) > srh5=((make2D(u750)-make2D(umotion))*(make2D(v800)-make2D(vmotion))-(make2D(u800)-make2D(umotion))*(make2D(v750)-make2D(vmotion))) > srh6=((make2D(u700)-make2D(umotion))*(make2D(v750)-make2D(vmotion))-(make2D(u750)-make2D(umotion))*(make2D(v700)-make2D(vmotion))) > > sreh = srh1 + srh2 + srh3 + srh4 + srh5 + srh6 > > return sreh > > When I run this jython code, the IDV gives me a "unit exception" error (no > further information). > > I tried to insert a "noUnit(shear)" or "noUnit(vshear)" but none of these > options work because when plugging in a noUnit() the IDV gives me the error > message "FlatField: RangeUnits must be convertable with RangeType default > Units". > Have you tried to insert noUnit on both shear and vshear? Yuan > As you have helped me with the first question, can you provide an explanation > as to why this piece of jython doesn't work? or maybe edit the 2 lines or > point me in the right direction? > > The whole purpose of these 2 forumulas (helicity of normal storm motion & > helicity of deviant storm motion) is to compare the 2 quantitatively for a > talk about supercels & severe weather. I would like to create the 2 maps & > lay them next to eachother for comparison purposes. > > Any help is much appreciated. > > Dzengiz > Ticket Details =================== Ticket ID: XXB-920520 Department: Support IDV Priority: High Status: Open