NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: problem

Hi Igor,

>     I have to display some date against time in real-time. Unit of time is a 
> milisecond. We use a long to represent time (since the epoch
> (1970-01-01 00:00:00Z) as the temporal reference) in ms. I cannot use VisAD's 
> DateTime class Since it uses seconds as units.
> 
> If I convert longs to doubles of seconds, VisAD has trouble displaying it. 
> For example, it looks like it doesn't make a difference between
> 9.98928586999E11 and  9.98928592627E11.
> 
> Does the FlatField only support float precision? What could be the problem?

You can do this if you use RealType.Time as the domain of
your Field, for example MathType:

  (Time -> ...)

As Don says, use a Gridded1DDoubleSet for your domain Set.
Also, your Units only have to be convertable with the default
Units of Seconds. So you can construct a Unit of ms with
something like:

  Unit ms = CommonUnit.second.scale(0.001);

Then construct your Gridded1DDoubleSet domain Set for your
Field something like:

  Set set = new Gridded1DDoubleSet(type, samples, lengthX, null,
                                   new Unit[] {ms}, null);

Note the samples array is double[1][lengthX] and its values
should be in ms.

Good luck,
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


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