Time values as floats

Hello,

I am attempting to construct a FlatField with a FunctionType that is
(Time -> (Latitude, Longitude, <other stuff> )).  I have been using an
IrregularSet as the domain.  I chose IrregularSet because the data will
not necessarily be in any fixed time sequence.

My problem is that the Time values get rounded to intervals of 32
seconds.  This is because the IrregularSet is initialised with
float[][], and java floats (which are IEEE floats) have only 24 bits of
precision.  The measure of seconds from 1970-01-01 to now (2001-06-22)
takes 29 bits.  I would like to retain one second precision.

One way around this that I have investigated is to start with an empty
IrregularSet and then fill in the FlatField values with setSample(),
which is actually FieldImpl.setSample(RealTuple domain,Data range). This
would allow the Time values to remain as doubles and not go through the
float array step. But this results in an UnimplementedException, which
originates from IrregularSet.valueToIndex().  (On the other hand,
IrregularSet appears to store floats internally, so this may not make
any difference.)

Have I missed something here? Is there some better way to implement the
domain in this case?

Is IrregularSet.valueToIndex() meant to remain unimplemented, given that
its "samples do not form any ordered pattern" (from the javadoc)?

Thanks,

-- 
Russell Steicke


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: