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

[IDV #SGE-620460]: error in jython formula



Hi HP-

I think we have a partial solution for this.  Could you try replacing the 
local-visad.jar in your IDV code directory (eg ~/IDV2_8a1) with the attached 
version?  You should probably copy the old version to a backup first. This is a 
change to some low level stuff in VisAD, so I'm reluctant to put it into the 
nightly build without you testing it first.

Let me know if this solves your problem.  There is some further work that we 
are going to look at which might have some effect on the actual values, but the 
current change should just eliminate the error.  When we have the other code, 
I'll have you test that also.

Thanks.

Don 
> >> Earlier on today I promised a new go on this problem. Here it is.
> >>
> >> The attached formula tries to raise images to the power of g=1/gamma,
> >> where gamma has typically values from 0.5 to 3, say. As you can see
> >> there is a type conflict when the power is applied. I tried several
> >> things like applying float() to no avail. The only thing I found out
> >> that it works when explicitly setting g=2. I have power used in other
> >> formulas and there it is working as expected. However, there the channel
> >> arguments ch0x are in Kelvin units (i.e. floating-point) whereas here
> >> ch0x are reflectivity (i.e. integer values?). Any idea?
> >>
> >
> > I think this is the same issue you ran into a while back with raising 
> > something to an exponent.
> Actually, it is the same problem. I have made further progress in
> identifying the root cause. It appears that all boils down to what units
> I am using for the pixel values when raising it to a certain power:
> RAW, RADIANCE and BRIGHTNESS all work as expected but REFLECTIVITY (that
> I would like to use) does not. I can manipulate REFLECTIVITY values with
> all 4 arithmetic operation but now with ** or pow(). Must be some other
> type?
> 
> HP
> 
> >   I'll look into this next week.  I'll be out of town until Tuesday.
> >
> > Don
> >
> >
> >> Unidata IDV Support wrote:
> >>
> >>> address@hidden,
> >>>
> >>> Your Ticket has been received, and a Unidata staff member will review it 
> >>> and reply accordingly. Listed below are details of this new Ticket. 
> >>> Please make sure the Ticket ID remains in the Subject: line on all 
> >>> correspondence related to this Ticket.
> >>>
> >>>     Ticket ID: SGE-620460
> >>>     Subject: error in jython formula
> >>>     Department: Support IDV
> >>>     Priority: Normal
> >>>     Status: Open
> >>>
> >>>
> >>>
> >>> Please let us know how we can assist you any further.
> >>>
> >>> Unidata User Support
> >>>
> >>>
> >>>
> >>>
> >> # SEVIRI RGB compositing
> >>
> >> # VisAD import
> >>
> >> from visad import *
> >> from visad.python.JPythonMethods import *
> >> import sys
> >> sys.add_extdir(".")
> >> sys.add_package('visad.data.mcidas')
> >>
> >>
> >> # Natural colours
> >> # units: % Refl
> >> #R:        03              0..100%
> >> #G:        02              0..100%
> >> #B 01              0..100%
> >>
> >> def NCOG_RGB(ch01,ch02,ch03,gamma):
> >> g = 1/float(gamma)
> >> img1 = 255*max_data(min_data(ch03/100,1),0)**g
> >> img2 = 255*max_data(min_data(ch02/100,1),0)**g
> >> img3 = 255*max_data(min_data(ch01/100,1),0)**g
> >> return combineRGB(img1,img2,img3)
> >>
> >>
> >> --------------
> >>
> >>
> >> Traceback (innermost last):
> >> File "<string>", line 1, in ?
> >> File "<string>", line 21, in NCOG_RGB
> >> at visad.FlatField.<init>(FlatField.java:412)
> >>
> >> at visad.FlatField.cloneFloat(FlatField.java:5606)
> >>
> >> at visad.FlatField.binary(FlatField.java:3140)
> >>
> >> at visad.FieldImpl.binary(FieldImpl.java:849)
> >>
> >> at visad.DataImpl.binary(DataImpl.java:139)
> >>
> >> at visad.DataImpl.pow(DataImpl.java:231)
> >>
> >> at visad.DataImpl.__pow__(DataImpl.java:1505)
> >>
> >> at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
> >>
> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >>
> >> at java.lang.reflect.Method.invoke(Unknown Source)
> >>
> >>
> >> visad.UnitException: visad.UnitException: FlatField: RangeUnits must be 
> >> convertable with RangeType default Units
> >>
> >>
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: SGE-620460
> > Department: Support IDV
> > Priority: Normal
> > Status: Open
> >
> >
> >
> 
> 


Ticket Details
===================
Ticket ID: SGE-620460
Department: Support IDV
Priority: Emergency
Status: Open

Attachment: local-visad.jar
Description: application/java-archive