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

[IDV #GZD-145979]: Sum of base reflectivity

> Full Name: Adam Smith
> Email Address: address@hidden
> Organization: University of Rhode Island
> Package Version: 3.1 build date:2012-08-31 20:26 UTC
> Operating System: Windows 7
> Hardware: Java: home: C:\Program Files (x86)\Java\jre7 version: 1.7.0_05 
> j3d:1.5.2 fcs (build4)
> Description of problem: Creating display: Radar Sweep View in 2D
> No data selected
> Hello,
> I'm not sure if what I'm trying to do will make any sense, but I'd like to 
> write a Jython formula that sums the total base reflectivity of a given 
> NEXRAD III radar image.  The purpose is to relate changes in total 
> reflectivity over time to migratory bird and bat activity.  I have no 
> experience with Python.  Thanks very much for any assistance you can offer.
> Adam Smith

Hi Adam,
      Sorry for the delay reply.
      The suggestion is to write the summation out, you can add  a Jython 
formula like the following and write the summation.

def sumRadar(data):
    c=', '
    print " output file is: ", ofile
    output = open(ofile,'w')
    output.write('(index) -> (Time, Sum)'+'\n')
    newData = data.clone();
    for t in range(newData.getDomainSet().getLength()):
        timeStep = newData.getSample(t)
        rvalues = timeStep.getValues()
        sum = 0
        for x in rvalues[0]:
            if(str(x) != ('nan')):           
                 sum = sum + x;     
        print sum
        output.write(str(t)+c+'0 '+'\n'); 

This is not fully tested, you may need to tweak a little.

> ******************
> Stack trace:
> java.lang.IllegalStateException: No data selected
> at ucar.unidata.idv.ui.IdvUIManager.selectDataChoices(IdvUIManager.java:5599)
> at 
> ucar.unidata.idv.IntegratedDataViewer.selectDataChoices(IntegratedDataViewer.java:1016)
> at 
> ucar.unidata.data.DerivedDataChoice.collectOperands(DerivedDataChoice.java:558)
> at ucar.unidata.data.DerivedDataChoice.getData(DerivedDataChoice.java:733)
> at ucar.unidata.data.DataChoice.getData(DataChoice.java:637)
> at ucar.unidata.data.DataInstance.getData(DataInstance.java:243)
> at ucar.unidata.data.DataInstance.getData(DataInstance.java:207)
> at ucar.unidata.data.grid.GridDataInstance.init(GridDataInstance.java:205)
> at ucar.unidata.data.grid.GridDataInstance.<init>(GridDataInstance.java:162)
> at ucar.unidata.data.grid.GridDataInstance.<init>(GridDataInstance.java:143)
> at 
> ucar.unidata.idv.control.GridDisplayControl.doMakeDataInstance(GridDisplayControl.java:284)
> at 
> ucar.unidata.idv.control.RadarSweepControl.doMakeDataInstance(RadarSweepControl.java:288)
> at 
> ucar.unidata.idv.control.DisplayControlImpl.initializeDataInstance(DisplayControlImpl.java:3201)
> at 
> ucar.unidata.idv.control.DisplayControlImpl.setData(DisplayControlImpl.java:3183)
> at ucar.unidata.idv.control.PlanViewControl.setData(PlanViewControl.java:643)
> at 
> ucar.unidata.idv.control.RadarSweepControl.setData(RadarSweepControl.java:106)
> at ucar.unidata.idv.control.PlanViewControl.init(PlanViewControl.java:473)
> at ucar.unidata.idv.control.RadarSweepControl.init(RadarSweepControl.java:150)
> at 
> ucar.unidata.idv.control.DisplayControlImpl.init(DisplayControlImpl.java:1450)
> at 
> ucar.unidata.idv.control.DisplayControlImpl.init(DisplayControlImpl.java:1131)
> 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:1250)

Ticket Details
Ticket ID: GZD-145979
Department: Support IDV
Priority: High
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.