ucar.unidata.geoloc.projection
Class McIDASAreaProjection

java.lang.Object
  extended by ucar.unidata.geoloc.ProjectionImpl
      extended by ucar.unidata.geoloc.projection.McIDASAreaProjection
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Projection

public class McIDASAreaProjection
extends ProjectionImpl

McIDASAreaProjection is the ProjectionImpl for McIDAS Area navigation modules.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ucar.unidata.geoloc.ProjectionImpl
ATTR_NAME, atts, defaultMapArea, EARTH_RADIUS, INDEX_LAT, INDEX_LON, INDEX_X, INDEX_Y, isLatLon, name, PI, PI_OVER_2, PI_OVER_4, TOLERANCE, workL, workP
 
Constructor Summary
McIDASAreaProjection()
           
McIDASAreaProjection(edu.wisc.ssec.mcidas.AreaFile af)
          create a McIDAS AREA projection from the Area file's directory and navigation blocks.
McIDASAreaProjection(int[] dir, int[] nav)
          Create a AREA coordinate system from the Area file's directory and navigation blocks.
McIDASAreaProjection(int[] dir, int[] nav, int[] aux)
          Create a AREA coordinate system from the Area file's directory and navigation blocks.
 
Method Summary
 ProjectionImpl constructCopy()
          copy constructor - avoid clone !!
 boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2)
          This returns true when the line between pt1 and pt2 crosses the seam.
 boolean equals(java.lang.Object obj)
          Determines whether or not the Object in question is the same as this McIDASAreaProjection.
 ProjectionRect getDefaultMapArea()
          Get the bounds for this image
 int[] getDirBlock()
          Get the directory block used to initialize this McIDASAreaProjection
 int[] getNavBlock()
          Get the navigation block used to initialize this McIDASAreaProjection
 double[][] latLonToProj(double[][] from, double[][] to, int latIndex, int lonIndex)
          Convert lat/lon coordinates to projection coordinates.
 float[][] latLonToProj(float[][] from, float[][] to, int latIndex, int lonIndex)
          Convert lat/lon coordinates to projection coordinates.
 ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result)
          Convert a LatLonPoint to projection coordinates
static void main(java.lang.String[] args)
          Test routine
 java.lang.String paramsToString()
          Get the parameters as a String
 double[][] projToLatLon(double[][] from, double[][] to)
          Convert lat/lon coordinates to projection coordinates.
 float[][] projToLatLon(float[][] from, float[][] to)
          Convert lat/lon coordinates to projection coordinates.
 LatLonPoint projToLatLon(ProjectionPoint world, LatLonPointImpl result)
          Convert projection coordinates to a LatLonPoint Note: a new object is not created on each call for the return value.
 java.lang.String toString()
          Return a String which tells some info about this navigation
 
Methods inherited from class ucar.unidata.geoloc.ProjectionImpl
addParameter, addParameter, addParameter, clone, getClassName, getDefaultMapAreaLL, getHeader, getName, getProjectionParameters, getProjectionTypeLabel, isLatLon, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProjBB, projToLatLon, projToLatLon, projToLatLon, projToLatLon, projToLatLonBB, setDefaultMapArea, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

McIDASAreaProjection

public McIDASAreaProjection()

McIDASAreaProjection

public McIDASAreaProjection(edu.wisc.ssec.mcidas.AreaFile af)
create a McIDAS AREA projection 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

McIDASAreaProjection

public McIDASAreaProjection(int[] dir,
                            int[] nav)
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

McIDASAreaProjection

public McIDASAreaProjection(int[] dir,
                            int[] nav,
                            int[] aux)
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
Method Detail

constructCopy

public ProjectionImpl constructCopy()
copy constructor - avoid clone !!

Specified by:
constructCopy in class ProjectionImpl

getDirBlock

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

Returns:
the area directory

getNavBlock

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

Returns:
the navigation block

latLonToProj

public ProjectionPoint latLonToProj(LatLonPoint latLon,
                                    ProjectionPointImpl result)
Convert a LatLonPoint to projection coordinates

Specified by:
latLonToProj in interface Projection
Specified by:
latLonToProj in class ProjectionImpl
Parameters:
latLon - convert from these lat, lon coordinates
result - the object to write to
Returns:
the given result

projToLatLon

public LatLonPoint projToLatLon(ProjectionPoint world,
                                LatLonPointImpl result)
Convert projection coordinates to a LatLonPoint Note: a new object is not created on each call for the return value.

Specified by:
projToLatLon in interface Projection
Specified by:
projToLatLon in class ProjectionImpl
Parameters:
world - convert from these projection coordinates
result - the object to write to
Returns:
LatLonPoint convert to these lat/lon coordinates

latLonToProj

public float[][] latLonToProj(float[][] from,
                              float[][] to,
                              int latIndex,
                              int lonIndex)
Convert lat/lon coordinates to projection coordinates.

Overrides:
latLonToProj in class ProjectionImpl
Parameters:
from - array of lat/lon coordinates: from[2][n], where from[0][i], from[1][i] is the (lat,lon) coordinate of the ith point
to - resulting array of projection coordinates, where to[0][i], to[1][i] is the (x,y) coordinate of the ith point
latIndex - index of latitude in "from"
lonIndex - index of longitude in "from"
Returns:
the "to" array.

projToLatLon

public float[][] projToLatLon(float[][] from,
                              float[][] to)
Convert lat/lon coordinates to projection coordinates.

Overrides:
projToLatLon in class ProjectionImpl
Parameters:
from - array of lat/lon coordinates: from[2][n], where (from[0][i], from[1][i]) is the (lat,lon) coordinate of the ith point
to - resulting array of projection coordinates: to[2][n] where (to[0][i], to[1][i]) is the (x,y) coordinate of the ith point
Returns:
the "to" array

latLonToProj

public double[][] latLonToProj(double[][] from,
                               double[][] to,
                               int latIndex,
                               int lonIndex)
Convert lat/lon coordinates to projection coordinates.

Overrides:
latLonToProj in class ProjectionImpl
Parameters:
from - array of lat/lon coordinates: from[2][n], where from[0][i], from[1][i] is the (lat,lon) coordinate of the ith point
to - resulting array of projection coordinates, where to[0][i], to[1][i] is the (x,y) coordinate of the ith point
latIndex - index of latitude in "from"
lonIndex - index of longitude in "from"
Returns:
the "to" array.

projToLatLon

public double[][] projToLatLon(double[][] from,
                               double[][] to)
Convert lat/lon coordinates to projection coordinates.

Overrides:
projToLatLon in class ProjectionImpl
Parameters:
from - array of lat/lon coordinates: from[2][n], where (from[0][i], from[1][i]) is the (lat,lon) coordinate of the ith point
to - resulting array of projection coordinates: to[2][n] where (to[0][i], to[1][i]) is the (x,y) coordinate of the ith point
Returns:
the "to" array

getDefaultMapArea

public ProjectionRect getDefaultMapArea()
Get the bounds for this image

Specified by:
getDefaultMapArea in interface Projection
Overrides:
getDefaultMapArea in class ProjectionImpl
Returns:
the projection bounds

crossSeam

public boolean crossSeam(ProjectionPoint pt1,
                         ProjectionPoint pt2)
This returns true when the line between pt1 and pt2 crosses the seam. When the cone is flattened, the "seam" is lon0 +- 180.

Specified by:
crossSeam in interface Projection
Specified by:
crossSeam in class ProjectionImpl
Parameters:
pt1 - point 1
pt2 - point 2
Returns:
true when the line between pt1 and pt2 crosses the seam.

equals

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

Specified by:
equals in interface Projection
Specified by:
equals in class ProjectionImpl
Parameters:
obj - the Object in question
Returns:
true if they are equal

toString

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

Overrides:
toString in class ProjectionImpl
Returns:
wordy String

paramsToString

public java.lang.String paramsToString()
Get the parameters as a String

Specified by:
paramsToString in interface Projection
Specified by:
paramsToString in class ProjectionImpl
Returns:
the parameters as a String

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test routine

Parameters:
args - Area file name
Throws:
java.lang.Exception - problem reading data