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.
Paul, I tried your formula and was able to make it work in my scenario so we are going to have to find out a bit more about what you are trying to achieve. Where is the data coming from? What fields are you trying to add? You can upload a data file for us to examine at http://motherlode.ucar.edu/repository/alias/idvupload. Best Wishes, Unidata IDV Support > Full Name: Paul Graham > Email Address: address@hidden > Organization: Weathersim > Package Version: 4.0u1 build date:2013-03-29 18:10 UTC > Operating System: Mac OS X > Hardware: Java: home: > /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home version: > 1.6.0_51 j3d:1.5.2 fcs (build4) > Description of problem: > > When attempting to add two different fields in IDV using the following > simple Jython method: > > def simpleAdd(F1,F2): > res = add(noUnit(F1),noUnit(F2)) > return res > > The following error occurs: > > "Making the widget component > java.lang.NullPointerException" > > > > ****************** > Stack trace: > java.lang.NullPointerException > at > ucar.unidata.idv.control.GridDisplayControl.getDataRangeInColorUnits(GridDisplayControl.java:264) > at > ucar.unidata.idv.control.GridDisplayControl.getInitialRange(GridDisplayControl.java:233) > at > ucar.unidata.idv.control.DisplayControlImpl.getRange(DisplayControlImpl.java:10001) > at > ucar.unidata.idv.control.DisplayControlImpl.getRangeForColorTable(DisplayControlImpl.java:10029) > at > ucar.unidata.idv.control.DisplayControlImpl.getControlWidgets(DisplayControlImpl.java:7588) > at > ucar.unidata.idv.control.PlanViewControl.getControlWidgets(PlanViewControl.java:1543) > at > ucar.unidata.idv.control.ContourPlanViewControl.getControlWidgets(ContourPlanViewControl.java:218) > at > ucar.unidata.idv.control.DisplayControlImpl.doMakeWidgetComponent(DisplayControlImpl.java:7483) > at > ucar.unidata.idv.control.PlanViewControl.doMakeContents(PlanViewControl.java:1498) > at > ucar.unidata.idv.control.DisplayControlImpl.doMakeWindow(DisplayControlImpl.java:4266) > at > ucar.unidata.idv.control.DisplayControlImpl.init(DisplayControlImpl.java:1141) > at ucar.unidata.idv.ControlDescriptor.initControl(ControlDescriptor.java:986) > at ucar.unidata.idv.ControlDescriptor$1.run(ControlDescriptor.java:911) > at ucar.unidata.util.Misc$3.run(Misc.java:1249) > > > Ticket Details =================== Ticket ID: DIZ-849299 Department: Support IDV Priority: Normal Status: Open