edu.wisc.ssec.mcidas
Class GRIDnav
- java.lang.Object
-
- edu.wisc.ssec.mcidas.GRIDnav
-
- All Implemented Interfaces:
- java.io.Serializable
public class GRIDnav extends java.lang.Object implements java.io.SerializableGRIDnav 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
Fields Modifier and Type Field and Description intindexCol"Column" index in row/column arrayintindexLat"Latitude" index in latitude/longitude arrayintindexLon"Longitude" index in latitude/longitude arrayintindexRow"Row" index in row/column array
-
Constructor Summary
Constructors Constructor and Description GRIDnav(int[] gridDirBlock)Construct a new GRIDnav from a grid directory block
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)Determines whether or not theObjectin question is the same as thisAREAnav.intgetColumnIndex()Get the column indexintgetRowIndex()Get the row indexdoublegetRowOffset()Get the row offset for flipped coordinatesbooleanisFlippedRowCoordinates()Determine if navigation is using flipped coordinates.voidsetFlipRowCoordinates(int row)specify whether the row coordinates are inverted and the row offset.voidsetStart(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/longitudedouble[][]toRowCol(double[][] latlon)toRowCol converts latitude/longitude to grid row/col
-
-
-
Field Detail
-
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 McIDASExceptionConstruct 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- Parameters:
rowcol- array of row/col pairs. Where rowcol[indexRow][] is a row and rowcol[indexCol][] is a column.- 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- Parameters:
latlon- array of lat/long pairs. Where latlon[indexLat][] are latitudes and latlon[indexLon][] are longitudes.- 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(java.lang.Object obj)
Determines whether or not theObjectin question is the same as thisAREAnav. Right now, this returns false until we can figure out when two navigations are equal. Subclasses could override if desired.- Overrides:
equalsin classjava.lang.Object- 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 systemstartColumn- 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
-
-
DMelt 3.0 © DataMelt by jWork.ORG