visad.data.mcidas
Class AreaAdapter

java.lang.Object
  extended by visad.data.mcidas.AreaAdapter

public class AreaAdapter
extends Object

this is an adapter for McIDAS AREA images


Constructor Summary
AreaAdapter(String imageSource)
          Create a VisAD FlatField from a local McIDAS AREA file or a URL.
AreaAdapter(String imageSource, boolean pack)
          Create a VisAD FlatField from a local McIDAS AREA file or a URL.
AreaAdapter(String imageSource, int cal)
          Create a VisAD FlatField from a local McIDAS AREA file or a URL.
AreaAdapter(String imageSource, int startLine, int startEle, int numLines, int numEles)
          Create a VisAD FlatField from a local McIDAS AREA file using the subsecting information
AreaAdapter(String imageSource, int startLine, int startEle, int numLines, int numEles, int band)
          Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters
AreaAdapter(String imageSource, int startLine, int startEle, int numLines, int numEles, int band, boolean pack)
          Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters
AreaAdapter(String imageSource, int startLine, int startEle, int numLines, int numEles, int lineMag, int eleMag, int band)
          Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters
AreaAdapter(String imageSource, int startLine, int startEle, int numLines, int numEles, int lineMag, int eleMag, int band, boolean pack)
          Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters
AreaAdapter(String imageSource, int startLine, int startEle, int numLines, int numEles, int lineMag, int eleMag, int cal, int band)
          Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters
AreaAdapter(String imageSource, int startLine, int startEle, int numLines, int numEles, int lineMag, int eleMag, int cal, int band, boolean pack)
          Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters
 
Method Summary
 AreaDirectory getAreaDirectory()
          get the AreaDirectory of the image
 AreaFile getAreaFile()
          Get the instance of the AreaFile used herein.
 CoordinateSystem getCoordinateSystem()
          get the CoordinateSystem of the image
 FlatField getData()
          Return a FlatField representing the image.
 int[] getDimensions()
          get the dimensions of the image
 SingleBandedImage getImage()
          Retrieves the first (and/or only) band in an image as a SingleBandedImage
 DateTime getImageStartTime()
          Retrieves the time of the start of the image scan as a VisAD DateTime.
 DateTime getNominalTime()
          Retrieves the "nominal" time of the image as a VisAD DateTime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AreaAdapter

public AreaAdapter(String imageSource)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA file or a URL.

Parameters:
imageSource - name of local file or a URL to locate file.
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   int cal)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA file or a URL.

Parameters:
imageSource - name of local file or a URL to locate file.
cal - type of calibration to perform on retrieved data; ignored if 'unit' is specified in imageSource.
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   boolean pack)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA file or a URL.

Parameters:
imageSource - name of local file or a URL to locate file.
pack - pack data if possible. If calibration is BRIT, images are packed into bytes
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   int startLine,
                   int startEle,
                   int numLines,
                   int numEles)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA file using the subsecting information

Parameters:
imageSource - name of local file or a URL to locate file.
startLine - starting line from the file (AREA coordinates)
startEle - starting element from the file (AREA coordinates)
numLines - number of lines to read
numEles - number of elements to read
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   int startLine,
                   int startEle,
                   int numLines,
                   int numEles,
                   int band)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters

Parameters:
imageSource - name of local file or a URL to locate file.
startLine - starting line from the file (AREA coordinates)
startEle - starting element from the file (AREA coordinates)
numLines - number of lines to read
numEles - number of elements to read
band - band number to get
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   int startLine,
                   int startEle,
                   int numLines,
                   int numEles,
                   int band,
                   boolean pack)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters

Parameters:
imageSource - name of local file or a URL to locate file.
startLine - starting line from the file (AREA coordinates)
startEle - starting element from the file (AREA coordinates)
numLines - number of lines to read
numEles - number of elements to read
band - band number to get
pack - pack data if possible. If calibration is BRIT, images are packed into bytes
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   int startLine,
                   int startEle,
                   int numLines,
                   int numEles,
                   int lineMag,
                   int eleMag,
                   int band)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters

Parameters:
imageSource - name of local file or a URL to locate file.
startLine - starting line from the file (AREA coordinates)
startEle - starting element from the file (AREA coordinates)
numLines - number of lines to read
numEles - number of elements to read
band - band number to get
lineMag - magnification for lines
eleMag - magnification for elements
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   int startLine,
                   int startEle,
                   int numLines,
                   int numEles,
                   int lineMag,
                   int eleMag,
                   int cal,
                   int band)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters

Parameters:
imageSource - name of local file or a URL to locate file.
startLine - starting line from the file (AREA coordinates)
startEle - starting element from the file (AREA coordinates)
numLines - number of lines to read
numEles - number of elements to read
lineMag - magnification for lines
eleMag - magnification for elements
cal - type of calibration to perform on retrieved data; ignored if 'unit' is specified in imageSource.
band - band number to get
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   int startLine,
                   int startEle,
                   int numLines,
                   int numEles,
                   int lineMag,
                   int eleMag,
                   int band,
                   boolean pack)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters

Parameters:
imageSource - name of local file or a URL to locate file.
startLine - starting line from the file (AREA coordinates)
startEle - starting element from the file (AREA coordinates)
numLines - number of lines to read
numEles - number of elements to read
band - band number to get
lineMag - magnification for lines
eleMag - magnification for elements
pack - pack data if possible. If calibration is BRIT, images are packed into bytes
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.

AreaAdapter

public AreaAdapter(String imageSource,
                   int startLine,
                   int startEle,
                   int numLines,
                   int numEles,
                   int lineMag,
                   int eleMag,
                   int cal,
                   int band,
                   boolean pack)
            throws IOException,
                   VisADException
Create a VisAD FlatField from a local McIDAS AREA subsected according to the parameters

Parameters:
imageSource - name of local file or a URL to locate file.
startLine - starting line from the file (AREA coordinates)
startEle - starting element from the file (AREA coordinates)
numLines - number of lines to read
numEles - number of elements to read
lineMag - magnification for lines
eleMag - magnification for elements
cal - type of calibration to perform on retrieved data; ignored if 'unit' is specified in imageSource.
band - band number to get
pack - pack data if possible. If calibration is BRIT, images are packed into bytes
Throws:
IOException - if there was a problem reading the file.
VisADException - if an unexpected problem occurs.
Method Detail

getAreaFile

public AreaFile getAreaFile()
Get the instance of the AreaFile used herein. Do NOT attempt to then use the AreaFile.getData() method!! Use this AreaAdapter's getData() method to fetch the FlatField containing the data values.

Returns:
the instance of the AreaFile

getDimensions

public int[] getDimensions()
get the dimensions of the image

Returns:
dim[0]=number of bands, dim[1] = number of elements, dim[2] = number of lines

getCoordinateSystem

public CoordinateSystem getCoordinateSystem()
get the CoordinateSystem of the image

Returns:
the CoordinateSystem object

getAreaDirectory

public AreaDirectory getAreaDirectory()
get the AreaDirectory of the image

Returns:
the AreaDirectory object

getData

public FlatField getData()
Return a FlatField representing the image. The field will look like the following:

Returns:
image as a FlatField

getNominalTime

public DateTime getNominalTime()
                        throws VisADException
Retrieves the "nominal" time of the image as a VisAD DateTime. This may or may not be the start of the image scan. Values are derived from the 4th and 5th words in the AREA file directory.

Returns:
nominal image time
Throws:
VisADException
See Also:
McIDAS Programmer's Manual, getImageStartTime()

getImageStartTime

public DateTime getImageStartTime()
                           throws VisADException
Retrieves the time of the start of the image scan as a VisAD DateTime. Values are derived from the 46th and 47th words in the AREA file directory.

Returns:
time of the start of the image scan
Throws:
VisADException
See Also:
McIDAS Programmer's Manual, getNominalTime()

getImage

public SingleBandedImage getImage()
                           throws VisADException
Retrieves the first (and/or only) band in an image as a SingleBandedImage

Returns:
SingleBandedImage representation of the FlatField from getData(). If there is navigation associated with the image, the returned image is a NavigatedImage.
Throws:
VisADException