Re: Work with Bytes.

Hi Olver,

> I work with Satellite Images and the data are in bytes.
> When I use a FlatField, it work with Float, Can a FlatField  working with
> bytes. How?

You need to put your images in FlatFields that you explicitly
construct, using the constructor signature:

  public FlatField(FunctionType type, Set domain_set,
                   CoordinateSystem range_coord_sys,
                   CoordinateSystem[] range_coord_syses,
                   Set[] range_sets, Unit[] units)

There is an element of the "Set[] range_sets" array argument
for each range RealType in the FlatField. If range_sets[i]
is a Set with no more than 255 samples, then values for the
i-th range RealType will be packed into bytes. For example,
you could use Integer1DSet(rtype, 255) and then make sure
all values for rtype passed to setSamples() are in the
range 0 - 254. Values outside this range will be marked as
'missing' (the Set can only have 255 value, so the 256-th
value is free to indicate missing). Or you can use a more
complex 1-D Set with 255 values. For example, a Linear1DSet
for any arithmetical progression of 255 real number values,
or Gridded1DSet for an arbitrary set of 255 real number
values.

None of the standard VisAD file format adapters do this (to
the best of my knowledge). So if you use one of them, you'll
need to copy your data into FlatFields that you explicitly
construct with appropriate range Sets.

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


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