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

[IDV #JHR-169833]: Cannot create display from formula



Hi Al,

I think I see the issue. Your fields are in Celsius, which is no big deal. 
Then, we use sub(a,b)
or (a-b) to compute a temperature difference. Again, this is ok. 

So now we have a delta T in Celsius...and a 1 delta T in Celsius is also 1 
delta T in Kelvin.
It appears that the IDV computes the difference as a difference in Kelvin, then 
converts that 
value back to Celsius, since that is the unit of your original temperature 
field.

I am pretty sure there is a way in the IDV to handle Temperature differences, 
but in this case,
you can  modify the formula and get it correct:

sub(a,b)+273.15

This will ensure the values you get back from the formula are in Celsius. The 
values range 
between 19 C and 33 C, which is consistent with the values in the example grids 
you sent.

Let me know if this works for you.

Cheers!

Sean

> Thanks Sean,
> I've got a display using the "sub" command, however the output values don't 
> appear to be correct. I'm getting values between -259.6 and -236.1 when i'm 
> expecting between -135 and 135. I get the same result when I use the preset 
> formula a-b. Any idea what might be going wrong here?
> Cheers Al
> 
> ________________________________________
> From: Unidata IDV Support [address@hidden]
> Sent: Tuesday, 15 January 2013 7:22 AM
> To: Mr Alister Hawksford
> Cc: address@hidden
> Subject: [IDV #JHR-169833]: Cannot create display from formula
> 
> Greetings!
> 
> Try using this for your formula:
> 
> sub(a,b) / 350
> 
> I think because the grids are on two different vertical levels, you need to 
> use the
> sub(a,b) routine to do the subtraction.
> 
> Cheers!
> 
> Sean
> 
> > No problem Sean.
> > I've uploaded the two datasets onto motherlode in two separate uploads 
> > addressed to you. The variables are:
> > (a) temperature at the 850mb level (850temp.nc)
> > (b) temperature at the 500mb level (500temp.nc)
> > which relate to
> > (a-b)/350
> > The domain and times are identical.
> > Thanks for your time.
> >
> > ________________________________________
> > From: Unidata IDV Support [address@hidden]
> > Sent: Tuesday, 15 January 2013 3:38 AM
> > To: Mr Alister Hawksford
> > Cc: address@hidden
> > Subject: [IDV #JHR-169833]: Cannot create display from formula
> >
> > Greetings Alister,
> >
> > Is there any way we could get a sample of your data to see exactly what is 
> > going on? Also,
> > could you tell us which variables you are subtracting? If you don't mind 
> > sending some
> > example data, please upload it here:
> >
> > http://motherlode.ucar.edu/repository/alias/idvupload
> >
> > Thanks!
> >
> > Sean
> >
> > > Full Name: Alister Hawksford
> > > Email Address: address@hidden
> > > Organization: Bureau of Meteorology
> > > Package Version: 3.1u1 build date:2012-11-30 17:36 UTC
> > > Operating System: Windows Vista
> > > Hardware: Java: home: C:\Program Files\IDV_3.1u1\jre version: 1.6.0_31 
> > > j3d:1.5.2 fcs (build4)
> > > Description of problem: Creating display: Color-Filled Contour Plan View
> > > visad.SetException: visad.SetException: Gridded3DSet.valueToGrid: 
> > > ManifoldDimension must be 3
> > > Gridded3DSet.valueToGrid: ManifoldDimension must be 3
> > >
> > > To whom it may concern,
> > > I have been following the Unidata instructions for formula creation 
> > > (http://www.unidata.ucar.edu/software/idv/docs/workshop/formulas/SimpleFormulas.html)
> > >  and I have not been able to display my formula as follows:
> > > (a-b)/(850-500)
> > > Could you please explain what the above error code means and how I might 
> > > solve it?
> > > Thank you for your help.
> > >
> > > ******************
> > > Stack trace:
> > > visad.SetException: Gridded3DSet.valueToGrid: ManifoldDimension must be 3
> > > at visad.Gridded3DSet.valueToGrid(Gridded3DSet.java:1070)
> > > at visad.Gridded3DSet.valueToIndex(Gridded3DSet.java:418)
> > > at visad.FlatField.resample(FlatField.java:4737)
> > > at visad.FlatField.binary(FlatField.java:2085)
> > > at visad.FieldImpl.binary(FieldImpl.java:836)
> > > at visad.DataImpl.binary(DataImpl.java:139)
> > > at visad.DataImpl.subtract(DataImpl.java:192)
> > > at visad.DataImpl.__sub__(DataImpl.java:1400)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > > at java.lang.reflect.Method.invoke(Unknown Source)
> > > at 
> > > org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
> > > at 
> > > org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
> > > at org.python.core.PyObject.__call__(PyObject.java:404)
> > > at org.python.core.PyObject.__call__(PyObject.java:408)
> > > at org.python.core.PyMethod.__call__(PyMethod.java:124)
> > > at org.python.core.PyMethod.__call__(PyMethod.java:115)
> > > at org.python.core.PyObjectDerived.__sub__(PyObjectDerived.java:187)
> > > at org.python.core.PyObject._basic_sub(PyObject.java:2119)
> > > at org.python.core.PyObject._sub(PyObject.java:2105)
> > > at org.python.pycode._pyx109.f$0(<string>:1)
> > > at org.python.pycode._pyx109.call_function(<string>)
> > > at org.python.core.PyTableCode.call(PyTableCode.java:165)
> > > at org.python.core.PyCode.call(PyCode.java:18)
> > > at org.python.core.Py.runCode(Py.java:1261)
> > > at org.python.core.__builtin__.eval(__builtin__.java:484)
> > > at org.python.core.__builtin__.eval(__builtin__.java:488)
> > > at org.python.util.PythonInterpreter.eval(PythonInterpreter.java:190)
> > > at ucar.unidata.data.DerivedDataChoice.getData(DerivedDataChoice.java:782)
> > > 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.DisplayControlImpl.initializeDataInstance(DisplayControlImpl.java:3176)
> > > at 
> > > ucar.unidata.idv.control.DisplayControlImpl.setData(DisplayControlImpl.java:3158)
> > > at 
> > > ucar.unidata.idv.control.PlanViewControl.setData(PlanViewControl.java:641)
> > > at 
> > > ucar.unidata.idv.control.ContourPlanViewControl.setData(ContourPlanViewControl.java:194)
> > > at ucar.unidata.idv.control.PlanViewControl.init(PlanViewControl.java:471)
> > > at 
> > > ucar.unidata.idv.control.DisplayControlImpl.init(DisplayControlImpl.java:1419)
> > > at 
> > > ucar.unidata.idv.control.DisplayControlImpl.init(DisplayControlImpl.java:1102)
> > > 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: JHR-169833
> > Department: Support IDV
> > Priority: Normal
> > Status: Open
> >
> >
> >
> >
> 
> Ticket Details
> ===================
> Ticket ID: JHR-169833
> Department: Support IDV
> Priority: Normal
> Status: Open
> 
> 
> 
> 

Ticket Details
===================
Ticket ID: JHR-169833
Department: Support IDV
Priority: Normal
Status: Open