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

[IDV #ZJC-641381]: IDV - VGEE IDV



Hi Valentijn-

This is Don.

> Sample.getvalue() gives an attribute error. Turns out that that
> str(smaple) returns "(VALUE)" with the brackets meaning this cannot be
> resolved into a float or double.

Sample is a VisAD RealTuple instead of a Real.  

> This line:
> print str(sample)
> Gives:
> (22.899999618530273)

The parentheses are the result of the toString method of
the RealTuple.  If there were multiple components (e.g.
u and v wind components), then it would have them separated 
by commas within the parens.

Try Sample[0].getValue()= or Sample.getComponent(0).getValue(),
or Sample.getRealComponents()[0].  If the brackets ([]) don't
work, try replacing them with parens (I'm no jython expert).

In general, you should check on the type of the object
that is being return and do the appropriate call to
get the actual value.  These probes will always return
VisAD Data objects, not numbers.  Depending on the
probe, you could get back a FieldImpl, a FlatField, 
a RealTuple or a Real.

> Can you remove the brackets Jeff?

That would require changing the toString method on all VisAD Data objects
(which we can't do), so try the methods above.

Don

Ticket Details
===================
Ticket ID: ZJC-641381
Department: Support IDV
Priority: High
Status: Open