## edu.wisc.ssec.mcidas
Class AreaFile

    java.lang.Object
      edu.wisc.ssec.mcidas.AreaFile

All Implemented Interfaces:
  Serializable

public class AreaFile
extends Object
implements Serializable

AreaFile interface with McIDAS 'area' file format image data. This will allow 'area' format data to be read from disk; the navigation block is made available (see GVARnav for example). This implementation does not do calibration (other than accounting for its presence in the data). Also, the 'valcode' is not checked on each line.

See Also:
  Serialized Form

Field Summary
`static int` `AD_AUXOFFSET` AD_AUXOFFSET - byte offset to start of auxilliary data section
`static int` `AD_AVGSMPFLAG` AD_AVGSMPFLAG - data is averaged (1), or sampled (0)
`static int` `AD_BANDMAP` AD_BANDMAP - spectral band map, bit set for each of 32 bands present
`static int` `AD_CALLENGTH` AD_CALLENGTH - length in bytes of line prefix calibration information
`static int` `AD_CALOFFSET` AD_CALOFFSET - byte offset to start of calibration section
`static int` `AD_CALTYPE` AD_CALTYPE - McIDAS calibration type (ascii, satellite specific)
`static int` `AD_CALTYPESCALE` AD_CALTYPESCALE - calibration scaling factor
`static int` `AD_CALTYPEUNIT` AD_CALTYPEUNIT - calibration unit
`static int` `AD_CRDATE` AD_CRDATE - year and day image was created, CCYYDDD format
`static int` `AD_CRTIME` AD_CRTIME - time image was created, HHMMSS format
`static int` `AD_DATAOFFSET` AD_DATAOFFSET - byte offset to start of data block
`static int` `AD_DATAWIDTH` AD_DATAWIDTH - number of bytes per data point
`static int` `AD_DIRSIZE` AD_DIRSIZE - size in 4 byte words of an image directory block
`static int` `AD_DOCLENGTH` AD_DOCLENGTH - length in bytes of line prefix documentation
`static int` `AD_ELEMRES` AD_ELEMRES - data resolution in element direction
`static int` `AD_IMGDATE` AD_IMGDATE - nominal year and day of the image, YYYDDD format
`static int` `AD_IMGTIME` AD_IMGTIME - nominal time of the image, HHMMSS format
`static int` `AD_LEVLENGTH` AD_LEVLENGTH - length in bytes of line prefix level section
`static int` `AD_LINERES` AD_LINERES - data resolution in line direction
`static int` `AD_NAVOFFSET` AD_NAVOFFSET - byte offset to start of navigation block
`static int` `AD_NUMBANDS` AD_NUMBANDS - number of spectral bands, or channels, in image
`static int` `AD_NUMELEMS` AD_NUMELEMS - number of data points per line
`static int` `AD_NUMLINES` AD_NUMLINES - number of lines in the image
`static int` `AD_PFXSIZE` AD_PFXSIZE - length in bytes of line prefix section
`static int` `AD_PROJNUM` AD_PROJNUM - SSEC project number used in creating image
`static int` `AD_SENSORID` AD_SENSORID - McIDAS sensor identifier
`static int` `AD_SRCTYPE` AD_SRCTYPE - McIDAS source type (ascii, satellite specific)
`static int` `AD_SRCTYPEORIG` AD_SRCTYPEORIG - original source type (ascii, satellite specific)
`static int` `AD_STARTDATE` AD_STARTDATE - actual image start year and Julian day, yyyddd format
`static int` `AD_STARTSCAN` AD_STARTSCAN - starting scan number (sensor based) of image
`static int` `AD_STARTTIME` AD_STARTTIME - actual image start time, hhmmss; in milliseconds for POES data
`static int` `AD_STATUS` AD_STATUS - old status field, now used as position num in ADDE
`static int` `AD_STELEM` AD_STELEM - upper left image element coordinate
`static int` `AD_STLINE` AD_STLINE - upper left image line coordinate
`static int` `AD_VALCODE` AD_VALCODE - validity code
`static int` `AD_VERSION` AD_VERSION - McIDAS area file format version number
`(package private) int[]` `aux`
`(package private) int[]` `cal`
`(package private) int[][][]` `data`
`(package private) int[]` `dir`
`(package private) int[]` `nav`
`(package private) static long` `serialVersionUID`
`static int` `VERSION_NUMBER` VERSION_NUMBER - version number for a valid AREA file (since 1985)

Constructor Summary
`AreaFile(String source)` creates an AreaFile object that allows reading of McIDAS 'area' file format image data.
`AreaFile(String filename, Applet parent)` creates an AreaFile object that allows reading of McIDAS 'area' file format image data from an applet
`AreaFile(URL url)` creates an AreaFile object that allows reading of McIDAS 'area' file format image data from a URL

Method Summary
`AreaDirectory` `getAreaDirectory()` Returns the AreaDirectory object for this AreaFile
`int[]` `getAux()` Returns AUX block
`int[]` `getCal()` Returns calibration block
`int[][][]` `getData()` Read the AREA file and return the entire contents
`int[][]` `getData(int lineNumber, int eleNumber, int numLines, int numEles)` Read the specified 2-dimensional array of data values from the AREA file.
`int[][]` `getData(int lineNumber, int eleNumber, int numLines, int numEles, int bandNumber)` Read the specified 2-dimensional array of data values from the AREA file.
`int[]` `getDir()` Returns the directory block
`String` `getImageSource()` returns the string of the image source location
`int[]` `getNav()` Returns the navigation block
`AREAnav` `getNavigation()` Get the navigation, and pre-set it for the ImageStart and Res (from Directory block), and the file start (0,0), and Mag (1,1).
`static boolean` `isURLHandlerLoaded()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### serialVersionUID

    static final long serialVersionUID

See Also:
  Constant Field Values

### AD_STATUS

    public static final int AD_STATUS

  AD_STATUS - old status field, now used as position num in ADDE

  See Also:
    Constant Field Values

### AD_VERSION

    public static final int AD_VERSION

  AD_VERSION - McIDAS area file format version number

  See Also:
    Constant Field Values

### AD_SENSORID

    public static final int AD_SENSORID

  AD_SENSORID - McIDAS sensor identifier

  See Also:
    Constant Field Values

### AD_IMGDATE

    public static final int AD_IMGDATE

  AD_IMGDATE - nominal year and day of the image, YYYDDD format

  See Also:
    Constant Field Values

### AD_IMGTIME

    public static final int AD_IMGTIME

  AD_IMGTIME - nominal time of the image, HHMMSS format

  See Also:
    Constant Field Values

### AD_STLINE

    public static final int AD_STLINE

  AD_STLINE - upper left image line coordinate

  See Also:
    Constant Field Values

### AD_STELEM

    public static final int AD_STELEM

  AD_STELEM - upper left image element coordinate

  See Also:
    Constant Field Values

### AD_NUMLINES

    public static final int AD_NUMLINES

  AD_NUMLINES - number of lines in the image

  See Also:
    Constant Field Values

### AD_NUMELEMS

    public static final int AD_NUMELEMS

  AD_NUMELEMS - number of data points per line

  See Also:
    Constant Field Values

### AD_DATAWIDTH

    public static final int AD_DATAWIDTH

  AD_DATAWIDTH - number of bytes per data point

  See Also:
    Constant Field Values

### AD_LINERES

    public static final int AD_LINERES

  AD_LINERES - data resolution in line direction

  See Also:
    Constant Field Values

### AD_ELEMRES

    public static final int AD_ELEMRES

  AD_ELEMRES - data resolution in element direction

  See Also:
    Constant Field Values

### AD_NUMBANDS

    public static final int AD_NUMBANDS

  AD_NUMBANDS - number of spectral bands, or channels, in image

  See Also:
    Constant Field Values

### AD_PFXSIZE

    public static final int AD_PFXSIZE

  AD_PFXSIZE - length in bytes of line prefix section

  See Also:
    Constant Field Values

### AD_PROJNUM

    public static final int AD_PROJNUM

  AD_PROJNUM - SSEC project number used in creating image

  See Also:
    Constant Field Values

### AD_CRDATE

    public static final int AD_CRDATE

  AD_CRDATE - year and day image was created, CCYYDDD format

  See Also:
    Constant Field Values

### AD_CRTIME

    public static final int AD_CRTIME

  AD_CRTIME - time image was created, HHMMSS format

  See Also:
    Constant Field Values

### AD_BANDMAP

    public static final int AD_BANDMAP

  AD_BANDMAP - spectral band map, bit set for each of 32 bands present

  See Also:
    Constant Field Values

### AD_DATAOFFSET

    public static final int AD_DATAOFFSET

  AD_DATAOFFSET - byte offset to start of data block

  See Also:
    Constant Field Values

### AD_NAVOFFSET

    public static final int AD_NAVOFFSET

  AD_NAVOFFSET - byte offset to start of navigation block

  See Also:
    Constant Field Values

### AD_VALCODE

    public static final int AD_VALCODE

  AD_VALCODE - validity code

  See Also:
    Constant Field Values

### AD_STARTDATE

    public static final int AD_STARTDATE

  AD_STARTDATE - actual image start year and Julian day, yyyddd format

  See Also:
    Constant Field Values

### AD_STARTTIME

    public static final int AD_STARTTIME

  AD_STARTTIME - actual image start time, hhmmss; in milliseconds for POES data

  See Also:
    Constant Field Values

### AD_STARTSCAN

    public static final int AD_STARTSCAN

  AD_STARTSCAN - starting scan number (sensor based) of image

  See Also:
    Constant Field Values

### AD_DOCLENGTH

    public static final int AD_DOCLENGTH

  AD_DOCLENGTH - length in bytes of line prefix documentation

  See Also:
    Constant Field Values

### AD_CALLENGTH

    public static final int AD_CALLENGTH

  AD_CALLENGTH - length in bytes of line prefix calibration information

  See Also:
    Constant Field Values

### AD_LEVLENGTH

    public static final int AD_LEVLENGTH

  AD_LEVLENGTH - length in bytes of line prefix level section

  See Also:
    Constant Field Values

### AD_SRCTYPE

    public static final int AD_SRCTYPE

  AD_SRCTYPE - McIDAS source type (ascii, satellite specific)

  See Also:
    Constant Field Values

### AD_CALTYPE

    public static final int AD_CALTYPE

  AD_CALTYPE - McIDAS calibration type (ascii, satellite specific)

  See Also:
    Constant Field Values

### AD_AVGSMPFLAG

    public static final int AD_AVGSMPFLAG

  AD_AVGSMPFLAG - data is averaged (1), or sampled (0)

  See Also:
    Constant Field Values

### AD_SRCTYPEORIG

    public static final int AD_SRCTYPEORIG

  AD_SRCTYPEORIG - original source type (ascii, satellite specific)

  See Also:
    Constant Field Values

### AD_CALTYPEUNIT

    public static final int AD_CALTYPEUNIT

  AD_CALTYPEUNIT - calibration unit

  See Also:
    Constant Field Values

### AD_CALTYPESCALE

    public static final int AD_CALTYPESCALE

  AD_CALTYPESCALE - calibration scaling factor

  See Also:
    Constant Field Values

### AD_AUXOFFSET

    public static final int AD_AUXOFFSET

  AD_AUXOFFSET - byte offset to start of auxilliary data section

  See Also:
    Constant Field Values

### AD_CALOFFSET

    public static final int AD_CALOFFSET

  AD_CALOFFSET - byte offset to start of calibration section

  See Also:
    Constant Field Values

### AD_DIRSIZE

    public static final int AD_DIRSIZE

  AD_DIRSIZE - size in 4 byte words of an image directory block

  See Also:
    Constant Field Values

### VERSION_NUMBER

    public static final int VERSION_NUMBER

  VERSION_NUMBER - version number for a valid AREA file (since 1985)

  See Also:
    Constant Field Values

### dir

    int[] dir

### nav

    int[] nav

### cal

    int[] cal

### aux

    int[] aux

### data

    int[][][] data

Constructor Detail

### AreaFile

    public AreaFile(String source)
             throws AreaFileException

  creates an AreaFile object that allows reading of McIDAS 'area' file format image data. allows reading either from a disk file, or a server via ADDE.

Throws:
  `AreaFileException` - if file cannot be opened

### AreaFile

    public AreaFile(String filename,
                    Applet parent)
             throws AreaFileException

  creates an AreaFile object that allows reading of McIDAS 'area' file format image data from an applet

Parameters:
  `filename` - the disk filename (incl path) to read from
  `parent` - the parent applet
Throws:
  `AreaFileException` - if file cannot be opened

### AreaFile

    public AreaFile(URL url)
             throws AreaFileException

  creates an AreaFile object that allows reading of McIDAS 'area' file format image data from a URL

Throws:
  `AreaFileException` - if file cannot be opened

Method Detail

### isURLHandlerLoaded

    public static boolean isURLHandlerLoaded()

### getImageSource

    public String getImageSource()

  returns the string of the image source location

  Returns:
    name of image source

### getDir

    public int[] getDir()

  Returns the directory block

  Returns:
    an integer array containing the area directory

### getAreaDirectory

    public AreaDirectory getAreaDirectory()

  Returns the AreaDirectory object for this AreaFile

  Returns:
    AreaDirectory

### getNav

    public int[] getNav()

  Returns the navigation block

  Returns:
    an integer array containing the nav block data

### getNavigation

    public AREAnav getNavigation()
                          throws AreaFileException

  Get the navigation, and pre-set it for the ImageStart and Res (from Directory block), and the file start (0,0), and Mag (1,1).

  Returns:
    AREAnav for this image (may be null)
  Throws:
    `AreaFileException`

### getCal

    public int[] getCal()

  Returns calibration block

  Returns:
    an integer array containing the nav block data

### getAux

    public int[] getAux()

  Returns AUX block

  Returns:
    an integer array containing the aux block data

### getData

    public int[][][] getData()
                      throws AreaFileException

  Read the AREA file and return the entire contents

  Returns:
    int array[band][lines][elements]
  Throws:
    `AreaFileException` - if there is a problem

### getData

    public int[][] getData(int lineNumber,
                           int eleNumber,
                           int numLines,
                           int numEles)
                    throws AreaFileException

  Read the specified 2-dimensional array of data values from the AREA file. Values will always be returned as int regardless of whether they are 1, 2, or 4 byte values.

  Parameters:
    `lineNumber` - the file-relative image line number that will be put in array[0][j]
    `eleNumber` - the file-relative image element number that will be put into array[i][0]
    `numLines` - the number of lines to return
    `numEles` - the number of elements to return for each line
  Returns:
    int array[lines][elements] with data values.
  Throws:
    `AreaFileException` - if the is a problem reading the file

### getData

    public int[][] getData(int lineNumber,
                           int eleNumber,
                           int numLines,
                           int numEles,
                           int bandNumber)
                    throws AreaFileException

  Read the specified 2-dimensional array of data values from the AREA file. Values will always be returned as int regardless of whether they are 1, 2, or 4 byte values.

  Parameters:
    `lineNumber` - the file-relative image line number that will be put in array[0][j]
    `eleNumber` - the file-relative image element number that will be put into array[i][0]
    `numLines` - the number of lines to return
    `numEles` - the number of elements to return for each line
    `bandNumber` - the spectral band to return
  Returns:
    int array[lines][elements] with data values.
  Throws:
    `AreaFileException` - if the is a problem reading the file