visad.data.hrit
Class HRITAdapter

java.lang.Object
  extended by visad.data.hrit.HRITAdapter

public class HRITAdapter
extends Object

This is an adapter for HRIT format data files At present, it will only work on MSG2 data, but with some work should be able to handle most HRIT data.


Constructor Summary
HRITAdapter(String[] filenames, int magFactor)
          Create a VisAD FlatField from local HRIT file(s).
HRITAdapter(String[] filenames, int magFactor, int calType, int bandNum)
          Create a VisAD FlatField from local HRIT file(s).
 
Method Summary
static int bytesToInt(byte[] data, int offset)
          Converts a set of four consecutive bytes into a single int.
static long bytesToLong(byte[] data, int offset)
          Converts a set of four consecutive bytes into a single long.
static int bytesToShort(byte[] data, int offset)
          Converts a set of two consecutive bytes into a single int.
 FlatField getData()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HRITAdapter

public HRITAdapter(String[] filenames,
                   int magFactor)
            throws IOException,
                   VisADException
Create a VisAD FlatField from local HRIT file(s). This constructor is included for backward compatibility but should not be used and should be phased out in future revisions since it does not make a valid band number determination.

Parameters:
filenames - array of file names
magFactor - magnification factor
Throws:
IOException - if there was a problem reading the file(s).
VisADException - if an unexpected problem occurs.

HRITAdapter

public HRITAdapter(String[] filenames,
                   int magFactor,
                   int calType,
                   int bandNum)
            throws IOException,
                   VisADException
Create a VisAD FlatField from local HRIT file(s).

Parameters:
filenames - names of local files.
magFactor - magnification factor
calType - calibration type
bandNum - band number
Throws:
IOException - if there was a problem reading the file(s).
VisADException - if an unexpected problem occurs.
Method Detail

getData

public FlatField getData()

bytesToLong

public static long bytesToLong(byte[] data,
                               int offset)
Converts a set of four consecutive bytes into a single long.

Parameters:
data - An array of bytes
offset - The array index to begin with
Returns:
The resulting int

bytesToInt

public static int bytesToInt(byte[] data,
                             int offset)
Converts a set of four consecutive bytes into a single int.

Parameters:
data - An array of bytes
offset - The array index to begin with
Returns:
The resulting int

bytesToShort

public static int bytesToShort(byte[] data,
                               int offset)
Converts a set of two consecutive bytes into a single int.

Parameters:
data - An array of bytes
offset - The array index to begin with
Returns:
The resulting int