Package ucar.nc2.iosp.mcidas
Class McIDASAreaProjection
- java.lang.Object
-
- ucar.unidata.geoloc.ProjectionImpl
-
- ucar.nc2.iosp.mcidas.McIDASAreaProjection
-
- All Implemented Interfaces:
Serializable
,Projection
public class McIDASAreaProjection extends ProjectionImpl
McIDASAreaProjection is the ProjectionImpl for McIDAS Area navigation modules.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_AREADIR
Attribute for the Area Directorystatic String
ATTR_AUXBLOCK
Attribute for the Navigation Blockstatic String
ATTR_NAVBLOCK
Attribute for the Navigation Blockstatic String
GRID_MAPPING_NAME
Attribute for the Navigation Block-
Fields inherited from class ucar.unidata.geoloc.ProjectionImpl
atts, defaultMapArea, defaultUnits, EARTH_RADIUS, INDEX_LAT, INDEX_LON, INDEX_X, INDEX_Y, isLatLon, name, PI, PI_OVER_2, PI_OVER_4, TOLERANCE
-
-
Constructor Summary
Constructors Constructor Description McIDASAreaProjection()
Default bean constructorMcIDASAreaProjection(int[] dir, int[] nav, int[] aux)
Create a AREA coordinate system from the Area file's directory and navigation blocks.McIDASAreaProjection(ucar.mcidas.AreaFile af)
create a McIDAS AREA projection from the Area file's directory and navigation blocks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(Object o)
Returns true if this represents the same Projection as proj.int[]
getAuxBlock()
Get the auxilliary block used to initialize this McIDASAreaProjectionProjectionRect
getDefaultMapArea()
Get the bounds for this imageint[]
getDirBlock()
Get the directory block used to initialize this McIDASAreaProjectionint[]
getNavBlock()
Get the navigation block used to initialize this McIDASAreaProjectionint
hashCode()
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 coordinatesString
paramsToString()
Get the parameters as a Stringdouble[][]
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.String
toString()
Return a String which tells some info about this navigation-
Methods inherited from class ucar.unidata.geoloc.ProjectionImpl
addParameter, addParameter, addParameter, findProjectionParameter, getClassName, getDefaultMapAreaLL, getDefaultUnits, getHeader, getName, getProjectionParameters, getProjectionTypeLabel, isLatLon, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProj, latLonToProjBB, projToLatLon, projToLatLon, projToLatLon, projToLatLonBB, projToLatLonBBold, setDefaultMapArea, setName
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ucar.unidata.geoloc.Projection
latLonToProj, projToLatLon
-
-
-
-
Field Detail
-
ATTR_AREADIR
public static String ATTR_AREADIR
Attribute for the Area Directory
-
ATTR_NAVBLOCK
public static String ATTR_NAVBLOCK
Attribute for the Navigation Block
-
ATTR_AUXBLOCK
public static String ATTR_AUXBLOCK
Attribute for the Navigation Block
-
GRID_MAPPING_NAME
public static String GRID_MAPPING_NAME
Attribute for the Navigation Block
-
-
Constructor Detail
-
McIDASAreaProjection
public McIDASAreaProjection()
Default bean constructor
-
McIDASAreaProjection
public McIDASAreaProjection(ucar.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, 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 blocknav
- is the AREA file navigation blockaux
- is the AREA file auxillary block
-
-
Method Detail
-
constructCopy
public ProjectionImpl constructCopy()
copy constructor - avoid clone !!- Specified by:
constructCopy
in classProjectionImpl
- Returns:
- construct a copy of this
-
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
-
getAuxBlock
public int[] getAuxBlock()
Get the auxilliary block used to initialize this McIDASAreaProjection- Returns:
- the auxilliary block (may be null)
-
latLonToProj
public ProjectionPoint latLonToProj(LatLonPoint latLon, ProjectionPointImpl result)
Convert a LatLonPoint to projection coordinates- Specified by:
latLonToProj
in interfaceProjection
- Specified by:
latLonToProj
in classProjectionImpl
- Parameters:
latLon
- convert from these lat, lon coordinatesresult
- 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 interfaceProjection
- Specified by:
projToLatLon
in classProjectionImpl
- Parameters:
world
- convert from these projection coordinatesresult
- 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 classProjectionImpl
- 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 pointto
- resulting array of projection coordinates, where to[0][i], to[1][i] is the (x,y) coordinate of the ith pointlatIndex
- 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 classProjectionImpl
- 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 pointto
- 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 classProjectionImpl
- 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 pointto
- resulting array of projection coordinates, where to[0][i], to[1][i] is the (x,y) coordinate of the ith pointlatIndex
- 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 classProjectionImpl
- 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 pointto
- 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 interfaceProjection
- Overrides:
getDefaultMapArea
in classProjectionImpl
- 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 interfaceProjection
- Specified by:
crossSeam
in classProjectionImpl
- Parameters:
pt1
- point 1pt2
- point 2- Returns:
- true when the line between pt1 and pt2 crosses the seam.
-
equals
public boolean equals(Object o)
Description copied from class:ProjectionImpl
Returns true if this represents the same Projection as proj.- Specified by:
equals
in interfaceProjection
- Specified by:
equals
in classProjectionImpl
- Parameters:
o
- projection in question- Returns:
- true if this represents the same Projection as proj.
-
toString
public String toString()
Return a String which tells some info about this navigation- Overrides:
toString
in classProjectionImpl
- Returns:
- wordy String
-
paramsToString
public String paramsToString()
Get the parameters as a String- Specified by:
paramsToString
in interfaceProjection
- Specified by:
paramsToString
in classProjectionImpl
- Returns:
- the parameters as a String
-
-