Class McIDASAreaProjection

  • All Implemented Interfaces:
    Serializable, ucar.unidata.geoloc.Projection

    public class McIDASAreaProjection
    extends ucar.unidata.geoloc.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 Directory
      static String ATTR_AUXBLOCK
      Attribute for the Navigation Block
      static String ATTR_NAVBLOCK
      Attribute for the Navigation Block
      static 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 constructor
      McIDASAreaProjection​(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
      ucar.unidata.geoloc.ProjectionImpl constructCopy()
      copy constructor - avoid clone !!
      boolean crossSeam​(ucar.unidata.geoloc.ProjectionPoint pt1, ucar.unidata.geoloc.ProjectionPoint pt2)
      This returns true when the line between pt1 and pt2 crosses the seam.
      boolean equals​(Object o)  
      int[] getAuxBlock()
      Get the auxilliary block used to initialize this McIDASAreaProjection
      ucar.unidata.geoloc.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
      int 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.
      ucar.unidata.geoloc.ProjectionPoint latLonToProj​(ucar.unidata.geoloc.LatLonPoint latLon, ucar.unidata.geoloc.ProjectionPointImpl result)
      Convert a LatLonPoint to projection coordinates
      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.
      ucar.unidata.geoloc.LatLonPoint projToLatLon​(ucar.unidata.geoloc.ProjectionPoint world, ucar.unidata.geoloc.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 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 block
        nav - is the AREA file navigation block
        aux - is the AREA file auxillary block
    • Method Detail

      • constructCopy

        public ucar.unidata.geoloc.ProjectionImpl constructCopy()
        copy constructor - avoid clone !!
        Specified by:
        constructCopy in class ucar.unidata.geoloc.ProjectionImpl
        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 ucar.unidata.geoloc.ProjectionPoint latLonToProj​(ucar.unidata.geoloc.LatLonPoint latLon,
                                                                ucar.unidata.geoloc.ProjectionPointImpl result)
        Convert a LatLonPoint to projection coordinates
        Specified by:
        latLonToProj in interface ucar.unidata.geoloc.Projection
        Specified by:
        latLonToProj in class ucar.unidata.geoloc.ProjectionImpl
        Parameters:
        latLon - convert from these lat, lon coordinates
        result - the object to write to
        Returns:
        the given result
      • projToLatLon

        public ucar.unidata.geoloc.LatLonPoint projToLatLon​(ucar.unidata.geoloc.ProjectionPoint world,
                                                            ucar.unidata.geoloc.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 ucar.unidata.geoloc.Projection
        Specified by:
        projToLatLon in class ucar.unidata.geoloc.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 ucar.unidata.geoloc.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 ucar.unidata.geoloc.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 ucar.unidata.geoloc.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 ucar.unidata.geoloc.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 ucar.unidata.geoloc.ProjectionRect getDefaultMapArea()
        Get the bounds for this image
        Specified by:
        getDefaultMapArea in interface ucar.unidata.geoloc.Projection
        Overrides:
        getDefaultMapArea in class ucar.unidata.geoloc.ProjectionImpl
        Returns:
        the projection bounds
      • crossSeam

        public boolean crossSeam​(ucar.unidata.geoloc.ProjectionPoint pt1,
                                 ucar.unidata.geoloc.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 ucar.unidata.geoloc.Projection
        Specified by:
        crossSeam in class ucar.unidata.geoloc.ProjectionImpl
        Parameters:
        pt1 - point 1
        pt2 - point 2
        Returns:
        true when the line between pt1 and pt2 crosses the seam.
      • equals

        public boolean equals​(Object o)
        Specified by:
        equals in interface ucar.unidata.geoloc.Projection
        Specified by:
        equals in class ucar.unidata.geoloc.ProjectionImpl
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • toString

        public String toString()
        Return a String which tells some info about this navigation
        Overrides:
        toString in class ucar.unidata.geoloc.ProjectionImpl
        Returns:
        wordy String
      • paramsToString

        public String paramsToString()
        Get the parameters as a String
        Specified by:
        paramsToString in interface ucar.unidata.geoloc.Projection
        Specified by:
        paramsToString in class ucar.unidata.geoloc.ProjectionImpl
        Returns:
        the parameters as a String