Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

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

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690