## edu.wisc.ssec.mcidas
Class GRIDnav

    java.lang.Object
      edu.wisc.ssec.mcidas.GRIDnav

All Implemented Interfaces:
  Serializable

public class GRIDnav
extends Object
implements Serializable

GRIDnav is the class for handling the navigation of McIDAS grids. It is basically a Java version of GRDDEF.FOR.

See Also:
  McIDAS Programmer's Manual, Serialized Form

Field Summary
`(package private) double` `EARTH_RADIUS`
`(package private) int` `EQUIDISTANT` Navigation type for equidistant grids
`int` `indexCol` "Column" index in row/column array
`int` `indexLat` "Latitude" index in latitude/longitude array
`int` `indexLon` "Longitude" index in latitude/longitude array
`int` `indexRow` "Row" index in row/column array
`(package private) int` `LAMBERT_CONFORMAL_TANGENT` Navigation type for lambert conformal tangent grids
`(package private) int` `NO_NAV`
`(package private) int` `PS_OR_LAMBERT_CONIC` Navigation type for polar stero or lambert conformal conic grids
`(package private) int` `PSEUDO_MERCATOR` Navigation type for pseudo-mercator grids
`(package private) int` `PSEUDO_MERCATOR_GENERAL` Navigation type for pseudo-mercator (general case) grids
`(package private) static long` `serialVersionUID`
`(package private) double` `xrad`

Constructor Summary
`GRIDnav(int[] gridDirBlock)` Construct a new GRIDnav from a grid directory block

Method Summary
`boolean` `equals(Object obj)` Determines whether or not the `Object` in question is the same as this `AREAnav`.
`int` `getColumnIndex()` Get the column index
`int` `getRowIndex()` Get the row index
`double` `getRowOffset()` Get the row offset for flipped coordinates
`boolean` `isFlippedRowCoordinates()` Determine if navigation is using flipped coordinates.
`void` `setFlipRowCoordinates(int row)` specify whether the row coordinates are inverted and the row offset.
`void` `setStart(int startRow, int startColumn)` define the starting row and column of another coordinate system -- for example (0,0)
`double[][]` `toLatLon(double[][] rowcol)` converts from grid coordinates (x,y) or (col, row) to latitude/longitude
`double[][]` `toRowCol(double[][] latlon)` toRowCol converts latitude/longitude to grid row/col

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### serialVersionUID

    static final long serialVersionUID

See Also:
  Constant Field Values

### PSEUDO_MERCATOR

    final int PSEUDO_MERCATOR

  Navigation type for pseudo-mercator grids

  See Also:
    Constant Field Values

### PS_OR_LAMBERT_CONIC

    final int PS_OR_LAMBERT_CONIC

  Navigation type for polar stero or lambert conformal conic grids

  See Also:
    Constant Field Values

### EQUIDISTANT

    final int EQUIDISTANT

  Navigation type for equidistant grids

  See Also:
    Constant Field Values

### PSEUDO_MERCATOR_GENERAL

    final int PSEUDO_MERCATOR_GENERAL

  Navigation type for pseudo-mercator (general case) grids

  See Also:
    Constant Field Values

### NO_NAV

    final int NO_NAV

See Also:
  Constant Field Values

### LAMBERT_CONFORMAL_TANGENT

    final int LAMBERT_CONFORMAL_TANGENT

  Navigation type for lambert conformal tangent grids

  See Also:
    Constant Field Values

### EARTH_RADIUS

    final double EARTH_RADIUS

See Also:
  Constant Field Values

### xrad

    final double xrad

See Also:
  Constant Field Values

### indexRow

    public final int indexRow

  "Row" index in row/column array

  See Also:
    Constant Field Values

### indexCol

    public final int indexCol

  "Column" index in row/column array

  See Also:
    Constant Field Values

### indexLat

    public final int indexLat

  "Latitude" index in latitude/longitude array

  See Also:
    Constant Field Values

### indexLon

    public final int indexLon

  "Longitude" index in latitude/longitude array

  See Also:
    Constant Field Values

Constructor Detail

### GRIDnav

    public GRIDnav(int[] gridDirBlock)
            throws McIDASException

  Construct a new GRIDnav from a grid directory block

Parameters:
  `gridDirBlock` - grid header block
Throws:
  `McIDASException` - illegal grid header

Method Detail

### toLatLon

    public double[][] toLatLon(double[][] rowcol)

  converts from grid coordinates (x,y) or (col, row) to latitude/longitude

  Returns:
    latlon[][] array of lat/long pairs. Output array is latlon[indexLat][] of latitudes and latlon[indexLon][] of longitudes.

### toRowCol

    public double[][] toRowCol(double[][] latlon)

  toRowCol converts latitude/longitude to grid row/col

  Returns:
    rowcol[][] array of row/col pairs. Where rowcol[indexRow][] is a row and rowcol[indexCol][] is an column. These are in 'grid' coordinates

### equals

    public boolean equals(Object obj)

  Determines whether or not the `Object` in question is the same as this `AREAnav`. Right now, this returns false until we can figure out when two navigations are equal. Subclasses could override if desired.

  Parameters:
    `obj` - the AREAnav in question

### setStart

    public void setStart(int startRow,
                         int startColumn)

  define the starting row and column of another coordinate system -- for example (0,0)

  Parameters:
    `startRow` - the starting row number in another coordinate system
    `startColumn` - the starting column number in another coordinate system

### setFlipRowCoordinates

    public void setFlipRowCoordinates(int row)

  specify whether the row coordinates are inverted and the row offset.

  Parameters:
    `row` - ending row number

### isFlippedRowCoordinates

    public boolean isFlippedRowCoordinates()

  Determine if navigation is using flipped coordinates. This would mean that the start of the coordinate system is in the lower left instead of the upper left.

  Returns:
    true if using flipped row coordinates, otherwise false

### getRowOffset

    public double getRowOffset()

  Get the row offset for flipped coordinates

  Returns:
    row offset

### getRowIndex

    public int getRowIndex()

  Get the row index

  Returns:
    the row index in the returned arrays

### getColumnIndex

    public int getColumnIndex()

  Get the column index

  Returns:
    the column index in the returned arrays