Re: Why?

Hi Eugene,

> OK...we're trying to create a Gridded1DSet with the units "seconds" for
> time. I don't know why it keeps creating units of Kelvin for the set.
> Below is the line we use to create validSet:
> 
> Gridded1DSet validSet = new Gridded1DSet(wantedMathType, validTimeSet,
>                                          validTimeSet[0].length);
> 
> wantedMathType is a MathType of the data we want ie. MaxTemp whose units
> are Celsius. Am I right in this respect? Do we want wantedMathType to be
> "Time" instead of "MaxTemp"? When I did a getSetUnits(), we got "Cel"
> which I assume is short for Celsius.

Yes, the MathType of the Gridded1DSet should be "Time" rather
than "MaxTemp", since the Gridded1DSet is a set of time values
rather than a set of temperature values.  The domain set of this
field is a time index into a set of temperatures, rather than a
set of temperatures itself.

Also, for time values use Gridded1DDoubleSet rather than
Gridded1DSet and pass time values as double[][] arrays rather
than float[][] arrays.  When you extract time values out of a
Linear1DSet or a Gridded1DDoubleSet, use the
'double[][] getDoubles()' method rather than 'getFloats'.

VisAD encodes both date and time information as a single real
number (after all, time is modeled as a real line) and 32 bits
are just not enough.  With IEEE doubles, you get 10^-5 second
resolution over a time span of 2000 years.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html

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