visad.data.mcidas
Class AREACoordinateSystem

java.lang.Object
  extended by visad.CoordinateSystem
      extended by visad.georef.NavigatedCoordinateSystem
          extended by visad.georef.MapProjection
              extended by visad.data.mcidas.AREACoordinateSystem
All Implemented Interfaces:
Serializable

public class AREACoordinateSystem
extends MapProjection

AREACoordinateSystem is the VisAD CoordinateSystem class for conversions to/from (Latitude, Longitude) and Cartesian (element,line), and with Latitude and Longitude in degrees.

See Also:
Serialized Form

Field Summary
protected  AREAnav anav
           
 
Constructor Summary
protected AREACoordinateSystem()
          create a AREA coordinate system with nothing initialized.
  AREACoordinateSystem(AreaFile af)
          create a AREA coordinate system from the Area file's directory and navigation blocks.
  AREACoordinateSystem(int[] dir, int[] nav)
          create a AREA coordinate system from the Area file's directory and navigation blocks.
  AREACoordinateSystem(int[] dir, int[] nav, int[] aux)
          create a AREA coordinate system from the Area file's directory and navigation blocks.
  AREACoordinateSystem(int[] dir, int[] nav, int[] aux, boolean useSpline)
          create a AREA coordinate system from the Area file's directory and navigation blocks.
  AREACoordinateSystem(RealTupleType ref, AreaFile af)
          create a AREA coordinate system from the Area file's directory and navigation blocks.
  AREACoordinateSystem(RealTupleType reference, int[] dir, int[] nav)
          create a AREA coordinate system from the Area file's directory and navigation blocks.
  AREACoordinateSystem(RealTupleType reference, int[] dir, int[] nav, int[] aux)
          create a AREA coordinate system from the Area file's directory and navigation blocks.
  AREACoordinateSystem(RealTupleType reference, int[] dir, int[] nav, int[] aux, boolean useSpline)
          create a AREA coordinate system from the Area file's directory and navigation blocks.
 
Method Summary
 boolean equals(Object obj)
          Determines whether or not the Object in question is the same as this AREACoordinateSystem.
 double[][] fromReference(double[][] tuples)
          convert from latitude,longitude to image element,line
 float[][] fromReference(float[][] tuples)
          convert from latitude,longitude to image element,line
protected  AREAnav getAreaNav()
          This is used by the methods that do the work and can be overwritten by a derived class to do a lazy instantiation of the coordinate system.
 int[] getAuxBlock()
          Get the navigation block used to initialize this AREACoordinateSystem
 Rectangle2D getDefaultMapArea()
          Get the bounds for this image
 int[] getDirBlock()
          Get the directory block used to initialize this AREACoordinateSystem
 int[] getNavBlock()
          Get the navigation block used to initialize this AREACoordinateSystem
 double[] getSubpoint()
          get the subpoint if available
 boolean getUseSpline()
          Get whether we are using a spline or not
protected  void init(int[] dir, int[] nav, int[] aux, boolean useSpline)
          Create and initialize the areanav.
 double[][] toReference(double[][] tuples)
          convert from image element,line to latitude,longitude
 float[][] toReference(float[][] tuples)
          convert from image element,line to latitude,longitude
 String toString()
          Return a String which tells some info about this navigation
 
Methods inherited from class visad.georef.MapProjection
getCenterLatLon, getLatLon, getXIndex, getYIndex, isLatLonOrder, isXYOrder
 
Methods inherited from class visad.georef.NavigatedCoordinateSystem
getLatitudeIndex, getLongitudeIndex
 
Methods inherited from class visad.CoordinateSystem
canConvert, fromReference, fromReference, getCoordinateSystemUnits, getDimension, getReference, getReferenceUnits, toReference, toReference, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinates, transformCoordinatesFreeUnits, transformCoordinatesFreeUnits
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

anav

protected AREAnav anav
Constructor Detail

AREACoordinateSystem

public AREACoordinateSystem(AreaFile af)
                     throws VisADException,
                            AreaFileException
create a AREA coordinate system from the Area file's directory and navigation blocks. This routine uses a flipped Y axis (first line of the image file is number 0)

Parameters:
af - is the associated AreaFile
Throws:
VisADException
AreaFileException

AREACoordinateSystem

public AREACoordinateSystem(RealTupleType ref,
                            AreaFile af)
                     throws VisADException,
                            AreaFileException
create a AREA coordinate system from the Area file's directory and navigation blocks. This routine uses a flipped Y axis (first line of the image file is number 0)

Parameters:
ref - the CoordinateSystem reference (must be equivalent to RealTupleType.LatitudeLongitudeTuple)
af - is the associated AreaFile
Throws:
VisADException
AreaFileException

AREACoordinateSystem

public AREACoordinateSystem(int[] dir,
                            int[] nav)
                     throws VisADException
create a AREA coordinate system from the Area file's directory and navigation blocks. This routine uses a flipped Y axis (first line of the image file is number 0)

Parameters:
dir - is the AREA file directory block
nav - is the AREA file navigation block
Throws:
VisADException

AREACoordinateSystem

public AREACoordinateSystem(int[] dir,
                            int[] nav,
                            int[] aux)
                     throws VisADException
create a AREA coordinate system from the Area file's directory and navigation blocks. This routine uses a flipped Y axis (first line of the image file is number 0)

Parameters:
dir - is the AREA file directory block
nav - is the AREA file navigation block
aux - is the AREA file auxillary block
Throws:
VisADException

AREACoordinateSystem

public AREACoordinateSystem(int[] dir,
                            int[] nav,
                            int[] aux,
                            boolean useSpline)
                     throws VisADException
create a AREA coordinate system from the Area file's directory and navigation blocks. This routine uses a flipped Y axis (first line of the image file is number 0)

Parameters:
dir - is the AREA file directory block
nav - is the AREA file navigation block
aux - is the AREA file auxillary block
useSpline - use a spline approximation for speed
Throws:
VisADException

AREACoordinateSystem

public AREACoordinateSystem(RealTupleType reference,
                            int[] dir,
                            int[] nav)
                     throws VisADException
create a AREA coordinate system from the Area file's directory and navigation blocks. This routine uses a flipped Y axis (first line of the image file is number 0)

Parameters:
reference - the CoordinateSystem reference (must be equivalent to RealTupleType.LatitudeLongitudeTuple)
dir - is the AREA file directory block
nav - is the AREA file navigation block
Throws:
VisADException

AREACoordinateSystem

public AREACoordinateSystem(RealTupleType reference,
                            int[] dir,
                            int[] nav,
                            int[] aux)
                     throws VisADException
create a AREA coordinate system from the Area file's directory and navigation blocks. This routine uses a flipped Y axis (first line of the image file is number 0)

Parameters:
reference - the CoordinateSystem reference (must be equivalent to RealTupleType.LatitudeLongitudeTuple)
dir - is the AREA file directory block
nav - is the AREA file navigation block
aux - is the AREA file auxillary block
Throws:
VisADException

AREACoordinateSystem

protected AREACoordinateSystem()
                        throws VisADException
create a AREA coordinate system with nothing initialized. This allows for derived classes to do a lazy initialization of the coordinate system. To do this they must overwrite getAreaNav in order to create the nav.

Throws:
VisADException

AREACoordinateSystem

public AREACoordinateSystem(RealTupleType reference,
                            int[] dir,
                            int[] nav,
                            int[] aux,
                            boolean useSpline)
                     throws VisADException
create a AREA coordinate system from the Area file's directory and navigation blocks. This routine uses a flipped Y axis (first line of the image file is number 0)

Parameters:
reference - the CoordinateSystem reference (must be equivalent to RealTupleType.LatitudeLongitudeTuple)
dir - is the AREA file directory block
nav - is the AREA file navigation block
aux - is the AREA file auxillary block
useSpline - use a spline approximation for speed
Throws:
VisADException
Method Detail

getAreaNav

protected AREAnav getAreaNav()
This is used by the methods that do the work and can be overwritten by a derived class to do a lazy instantiation of the coordinate system.

Returns:
The area nav

init

protected void init(int[] dir,
                    int[] nav,
                    int[] aux,
                    boolean useSpline)
             throws VisADException
Create and initialize the areanav. This used to be in the constructor is snow its own method to enable derived classes to lazily create the areanav

Parameters:
dir - is the AREA file directory block
nav - is the AREA file navigation block
aux - is the AREA file auxillary block
useSpline - use a spline approximation for speed
Throws:
VisADException

getDirBlock

public int[] getDirBlock()
Get the directory block used to initialize this AREACoordinateSystem


getNavBlock

public int[] getNavBlock()
Get the navigation block used to initialize this AREACoordinateSystem


getAuxBlock

public int[] getAuxBlock()
Get the navigation block used to initialize this AREACoordinateSystem


getSubpoint

public double[] getSubpoint()
get the subpoint if available


getUseSpline

public boolean getUseSpline()
Get whether we are using a spline or not


toReference

public double[][] toReference(double[][] tuples)
                       throws VisADException
convert from image element,line to latitude,longitude

Specified by:
toReference in class CoordinateSystem
Parameters:
tuples - contains the element,line pairs to convert
Returns:
array of double values in reference coordinates and Units.
Throws:
VisADException - if problem with conversion.

fromReference

public double[][] fromReference(double[][] tuples)
                         throws VisADException
convert from latitude,longitude to image element,line

Specified by:
fromReference in class CoordinateSystem
Parameters:
tuples - contains the element,line pairs to convert
Returns:
array of double values in CoordinateSystem Units.
Throws:
VisADException - if problem with conversion.

toReference

public float[][] toReference(float[][] tuples)
                      throws VisADException
convert from image element,line to latitude,longitude

Overrides:
toReference in class CoordinateSystem
Parameters:
tuples - contains the element,line pairs to convert
Returns:
array of float values in reference coordinates and Units.
Throws:
VisADException - if problem with conversion.

fromReference

public float[][] fromReference(float[][] tuples)
                        throws VisADException
convert from latitude,longitude to image element,line

Overrides:
fromReference in class CoordinateSystem
Parameters:
tuples - contains the element,line pairs to convert
Returns:
array of float values in this CoordinateSystem Units.
Throws:
VisADException - if problem with conversion.

getDefaultMapArea

public Rectangle2D getDefaultMapArea()
Get the bounds for this image

Specified by:
getDefaultMapArea in class MapProjection
Returns:
the bounding box of the MapProjection

equals

public boolean equals(Object obj)
Determines whether or not the Object in question is the same as this AREACoordinateSystem. The specified Object is equal to this AREACoordinateSystem if it is an instance of AREACoordinateSystem and it has the same navigation module and default map area as this one.

Specified by:
equals in class CoordinateSystem
Parameters:
obj - the Object in question
Returns:
true if and only if this instance equals cs.

toString

public String toString()
Return a String which tells some info about this navigation

Overrides:
toString in class MapProjection
Returns:
wordy String