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

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



Hi HP-

> 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.  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