edu.wisc.ssec.mcidas
Class AREAnav
- java.lang.Object
-
- edu.wisc.ssec.mcidas.AREAnav
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ABINnav, ABISnav, GEOSnav, GMSXnav, GOESnav, GVARnav, KALPnav, LALOnav, LAMBnav, MERCnav, MOLLnav, MSATnav, MSGnav, MSGTnav, PSnav, RADRnav, RECTnav, SINUnav, TANCnav
public abstract class AREAnav extends java.lang.Object implements java.io.SerializableThe AREAnav is the superclass for AREA file navigation modules. When used with AreaFile class, set up like this:
By convention, latitudes are positive North (negative South), and longitudes are positive East (negative West).AreaFile af; try { af = new AreaFile("/home/user/mcidas/data/AREA0001"); } catch (AreaFileException e) { System.out.println(e); return; } int[] dir; try { dir=af.getDir(); } catch (AreaFileException e){ System.out.println(e); return; } int[] nav; try { nav=af.getNav(); } catch (AreaFileException e){ System.out.println(e); return; } try { AREAnav ng = new XXXXnav(nav); // XXXXnav is the specific implementation } catch (IllegalArgumentException excp) { System.out.println(excp); return; } ng.setImageStart(dir[5], dir[6]); ng.setRes(dir[11], dir[12]); ng.setStart(0,0); ng.setMag(1,1); ......................- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static intABINAREA file value that corresponds to ABIN.static intABISCode value in AREA files used to designate ABISstatic doubleDEGREES_TO_RADIANSConstant for degrees to radians conversionstatic intDMSPCode value in AREA files used to designate DMSP navigationstatic intGEOSCode value in AREA files used to designate GEOS navigationstatic intGMSXCode value in AREA files used to designate GMSX (GMS) navigationstatic intGOESCode value in AREA files used to designate GOES (GOES D-H) navigationstatic intGVARCode value in AREA files used to designate GVAR (GOES I-M) navigationintindexEle"Element" index in line/element arrayintindexLat"Latitude" index in latitude/longitude arrayintindexLine"Line" index in line/element arrayintindexLon"Longitude" index in latitude/longitude arraystatic intKALPCode value in AREA files used to designate Lat/Lonstatic intLALOCode value in AREA files used to designate Lat/Lonstatic intLAMBCode value in AREA files used to designate LAMB (lambert conformal) navigationstatic intLLCode value for specifying Latitude/Longitude transformationsstatic intMERCCode value in AREA files used to designate MERC (mercator) navigationstatic intMOLLCode value in AREA files used to designate MOLL (Mollweide) navigationstatic intMSATCode value in AREA files used to designate MSAT (Meteosat) navigationstatic intMSGCode value in AREA files used to designate MSG navigationstatic intMSGTCode value in AREA files used to designate MSGT navigationstatic intPOESCode value in AREA files used to designate POES navigationstatic intPSCode value in AREA files used to designate PS (polar stereographic) navigationstatic doubleRADIANS_TO_DEGREESConstant for radians to degrees conversionstatic intRADRCode value in AREA files used to designate RADR (radar) navigationstatic intRECTCode value in AREA files used to designate RECT (rectilinear) navigationstatic intSINCode value in AREA files used to designate SIN (sinusoidal cone) navigationstatic intTANCCode value in AREA files used to designate TANC (tangent cone) navigationstatic intXYCode value for specifying Cartesian (X/Y) transformations
-
Constructor Summary
Constructors Constructor and Description AREAnav()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description double[][]areaCoordToImageCoord(double[][] linele)Converts line/element array values from AREA (file) to Image coordinates.double[][]areaCoordToImageCoord(double[][] linele, double[][] newvals)Converts line/element array values from AREA (file) to Image coordinates.float[][]areaCoordToImageCoord(float[][] linele)Converts line/element array values from AREA (file) to Image coordinates.float[][]areaCoordToImageCoord(float[][] linele, float[][] newvals)Converts line/element array values from AREA (file) to Image coordinates.booleancanApproximateWithSpline()See if we can approximate by a spline.static float[][]doubleToFloat(double[][] value)Convert arrays of doubles to floatsbooleanequals(java.lang.Object obj)Determines whether or not theObjectin question is the same as thisAREAnav.static double[][]floatToDouble(float[][] value)Convert arrays of floats to doublesdoublegetLineOffset()Get the line offset for flipped coordinatesdouble[]getSubpoint()Get the lat,lon of the subpoint if availabledouble[][]imageCoordToAreaCoord(double[][] linele)Converts line/element array values from Image to AREA (File) coordinates.double[][]imageCoordToAreaCoord(double[][] linele, double[][] newvals)Converts line/element array values from Image to AREA (File) coordinates.float[][]imageCoordToAreaCoord(float[][] linele)Converts line/element array values from Image to AREA (File) coordinates.float[][]imageCoordToAreaCoord(float[][] linele, float[][] newvals)Converts line/element array values from Image to AREA (File) coordinates.booleanisFlippedLineCoordinates()Determine if navigation is using flipped coordinatesstatic AREAnavmakeAreaNav(int[] navBlock)Return an AREAnav based on the input nav block.static AREAnavmakeAreaNav(int[] navBlock, int[] auxBlock)voidsetFlipLineCoordinates(int line)specify whether the line coordinates are inverted and the line offset.voidsetImageStart(int startImageLine, int startImageElement)define the coordinate in the [0][0] position of the image.voidsetMag(float magLine, float magElement)define the magnification factor (in case an image was blown up when displayed).voidsetMag(int magLine, int magElement)define the magnification factor (in case an image was blown up when displayed).voidsetRes(float resLine, float resElement)Define the resolution of the image.voidsetRes(int resLine, int resElement)Define the resolution of the image.voidsetStart(int startLine, int startElement)define the starting line and element of another coordinate system -- usually a TV (note that the TV coordinates start at (1,1).abstract double[][]toLatLon(double[][] linele)converts from satellite coordinates to latitude/longitudefloat[][]toLatLon(float[][] linele)converts from satellite coordinates to latitude/longitude.abstract double[][]toLinEle(double[][] latlon)toLinEle converts lat/long to satellite line/elementfloat[][]toLinEle(float[][] latlon)toLinEle converts lat/long to satellite line/element This implementation converts the input array to doubles and calls the double signature oftoLinEle(double[][]).java.lang.StringtoString()Return aStringrepresentation of this nav module
-
-
-
Field Detail
-
RADIANS_TO_DEGREES
public static final double RADIANS_TO_DEGREES
Constant for radians to degrees conversion- See Also:
- Constant Field Values
-
DEGREES_TO_RADIANS
public static final double DEGREES_TO_RADIANS
Constant for degrees to radians conversion- See Also:
- Constant Field Values
-
DMSP
public static final int DMSP
Code value in AREA files used to designate DMSP navigation- See Also:
- Constant Field Values
-
GMSX
public static final int GMSX
Code value in AREA files used to designate GMSX (GMS) navigation- See Also:
- Constant Field Values
-
GOES
public static final int GOES
Code value in AREA files used to designate GOES (GOES D-H) navigation- See Also:
- Constant Field Values
-
GEOS
public static final int GEOS
Code value in AREA files used to designate GEOS navigation- See Also:
- Constant Field Values
-
GVAR
public static final int GVAR
Code value in AREA files used to designate GVAR (GOES I-M) navigation- See Also:
- Constant Field Values
-
MOLL
public static final int MOLL
Code value in AREA files used to designate MOLL (Mollweide) navigation- See Also:
- Constant Field Values
-
MSAT
public static final int MSAT
Code value in AREA files used to designate MSAT (Meteosat) navigation- See Also:
- Constant Field Values
-
MSGT
public static final int MSGT
Code value in AREA files used to designate MSGT navigation- See Also:
- Constant Field Values
-
MSG
public static final int MSG
Code value in AREA files used to designate MSG navigation- See Also:
- Constant Field Values
-
POES
public static final int POES
Code value in AREA files used to designate POES navigation- See Also:
- Constant Field Values
-
RADR
public static final int RADR
Code value in AREA files used to designate RADR (radar) navigation- See Also:
- Constant Field Values
-
RECT
public static final int RECT
Code value in AREA files used to designate RECT (rectilinear) navigation- See Also:
- Constant Field Values
-
PS
public static final int PS
Code value in AREA files used to designate PS (polar stereographic) navigation- See Also:
- Constant Field Values
-
MERC
public static final int MERC
Code value in AREA files used to designate MERC (mercator) navigation- See Also:
- Constant Field Values
-
TANC
public static final int TANC
Code value in AREA files used to designate TANC (tangent cone) navigation- See Also:
- Constant Field Values
-
SIN
public static final int SIN
Code value in AREA files used to designate SIN (sinusoidal cone) navigation- See Also:
- Constant Field Values
-
LAMB
public static final int LAMB
Code value in AREA files used to designate LAMB (lambert conformal) navigation- See Also:
- Constant Field Values
-
LALO
public static final int LALO
Code value in AREA files used to designate Lat/Lon- See Also:
- Constant Field Values
-
KALP
public static final int KALP
Code value in AREA files used to designate Lat/Lon- See Also:
- Constant Field Values
-
ABIS
public static final int ABIS
Code value in AREA files used to designate ABIS- See Also:
- Constant Field Values
-
ABIN
public static final int ABIN
AREA file value that corresponds to ABIN.- See Also:
- Constant Field Values
-
LL
public static final int LL
Code value for specifying Latitude/Longitude transformations- See Also:
- Constant Field Values
-
XY
public static final int XY
Code value for specifying Cartesian (X/Y) transformations- See Also:
- Constant Field Values
-
indexLine
public final int indexLine
"Line" index in line/element array- See Also:
- Constant Field Values
-
indexEle
public final int indexEle
"Element" index in line/element 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
-
-
Method Detail
-
toLatLon
public abstract double[][] toLatLon(double[][] linele)
converts from satellite coordinates to latitude/longitude- Parameters:
linele- array of line/element pairs. Where linele[indexLine][] is a 'line' and linele[indexEle][] is an element. These are in 'file' coordinates (not "image" coordinates.)- Returns:
- latlon[][] array of lat/long pairs. Output array is latlon[indexLat][] of latitudes and latlon[indexLon][] of longitudes.
-
toLinEle
public abstract double[][] toLinEle(double[][] latlon)
toLinEle converts lat/long to satellite line/element- Parameters:
latlon- array of lat/long pairs. Where latlon[indexLat][] are latitudes and latlon[indexLon][] are longitudes.- Returns:
- linele[][] array of line/element pairs. Where linele[indexLine][] is a line and linele[indexEle][] is an element. These are in 'file' coordinates (not "image" coordinates);
-
toLatLon
public float[][] toLatLon(float[][] linele)
converts from satellite coordinates to latitude/longitude. This implementation converts the input array to doubles and calls the double signature oftoLatLon(double[][]). Subclasses should implement a real float version for better performance.- Parameters:
linele- array of line/element pairs. Where linele[indexLine][] is a 'line' and linele[indexEle][] is an element. These are in 'file' coordinates (not "image" coordinates.)- Returns:
- latlon[][] array of lat/long pairs. Output array is latlon[indexLat][] of latitudes and latlon[indexLon][] of longitudes.
-
toLinEle
public float[][] toLinEle(float[][] latlon)
toLinEle converts lat/long to satellite line/element This implementation converts the input array to doubles and calls the double signature oftoLinEle(double[][]). Subclasses should implement a real float version for better performance.- Parameters:
latlon- array of lat/long pairs. Where latlon[indexLat][] are latitudes and latlon[indexLon][] are longitudes.- Returns:
- linele[][] array of line/element pairs. Where linele[indexLine][] is a line and linele[indexEle][] is an element. These are in 'file' coordinates (not "image" coordinates);
-
setRes
public void setRes(int resLine, int resElement)Define the resolution of the image. values range from 1 (highest) to n (lowest). Note that when an image is blown down during display, this value is changed in the frame object to reflect this (rather than changing the magnification).- Parameters:
resLine- is the resolution in the 'line' direction. This value is always > 0.resElement- is the resolution in the 'element' direction. The value is always >0.
-
setRes
public void setRes(float resLine, float resElement)Define the resolution of the image. values range from 1 (highest) to n (lowest). Note that when an image is blown down during display, this value is changed in the frame object to reflect this (rather than changing the magnification).- Parameters:
resLine- is the resolution in the 'line' direction. This value is always > 0.resElement- is the resolution in the 'element' direction. The value is always >0.
-
setMag
public void setMag(int magLine, int magElement)define the magnification factor (in case an image was blown up when displayed). This value is always > 0.- Parameters:
magLine- is the (line) magnification factor that might have been used when the image was displayed.magElement- is the (element) magnification factor that might have been used when the image was displayed.
-
setMag
public void setMag(float magLine, float magElement)define the magnification factor (in case an image was blown up when displayed). This value is always > 0.- Parameters:
magLine- is the (line) magnification factor that might have been used when the image was displayed.magElement- is the (element) magnification factor that might have been used when the image was displayed.
-
setStart
public void setStart(int startLine, int startElement)define the starting line and element of another coordinate system -- usually a TV (note that the TV coordinates start at (1,1).- Parameters:
startLine- the starting line number in another coordinate systemstartElement- the starting element number in another coordinate system
-
setImageStart
public void setImageStart(int startImageLine, int startImageElement)define the coordinate in the [0][0] position of the image.- Parameters:
startImageLine- redefines the starting image line number (may be different than the signal indicated)startImageElement- redefines the starting image element number (may be different than the signal indicated)
-
setFlipLineCoordinates
public void setFlipLineCoordinates(int line)
specify whether the line coordinates are inverted and the line offset.- Parameters:
line- ending line number
-
isFlippedLineCoordinates
public boolean isFlippedLineCoordinates()
Determine if navigation is using flipped coordinates- Returns:
- true if using flipped line coordinates, otherwise false
-
getSubpoint
public double[] getSubpoint()
Get the lat,lon of the subpoint if available- Returns:
- double[2] {lat, lon}
-
getLineOffset
public double getLineOffset()
Get the line offset for flipped coordinates- Returns:
- line offset
-
areaCoordToImageCoord
public double[][] areaCoordToImageCoord(double[][] linele)
Converts line/element array values from AREA (file) to Image coordinates. Creates new array instead of mucking with input.- Parameters:
linele- input line/element array in AREA coordinates- Returns:
- array in Image coordinates
-
areaCoordToImageCoord
public double[][] areaCoordToImageCoord(double[][] linele, double[][] newvals)Converts line/element array values from AREA (file) to Image coordinates. Creates new array if newvals is null.- Parameters:
linele- input line/element array in AREA coordinatesnewvals- return array - create a new array if null- Returns:
- array in Image coordinates
-
imageCoordToAreaCoord
public double[][] imageCoordToAreaCoord(double[][] linele)
Converts line/element array values from Image to AREA (File) coordinates. Creates new array instead of mucking with input.- Parameters:
linele- input line/element array Image coordinates- Returns:
- array in AREA coordinates
-
imageCoordToAreaCoord
public double[][] imageCoordToAreaCoord(double[][] linele, double[][] newvals)Converts line/element array values from Image to AREA (File) coordinates. Creates new array if newvals is null.- Parameters:
linele- input line/element array Image coordinatesnewvals- return array - create a new array if null- Returns:
- array in AREA coordinates
-
areaCoordToImageCoord
public float[][] areaCoordToImageCoord(float[][] linele)
Converts line/element array values from AREA (file) to Image coordinates. Creates new array instead of mucking with input.- Parameters:
linele- input line/element array in AREA coordinates- Returns:
- array in Image coordinates
-
areaCoordToImageCoord
public float[][] areaCoordToImageCoord(float[][] linele, float[][] newvals)Converts line/element array values from AREA (file) to Image coordinates. Creates new array if newvals is null.- Parameters:
linele- input line/element array in AREA coordinatesnewvals- return array - create a new array if null- Returns:
- array in Image coordinates
-
imageCoordToAreaCoord
public float[][] imageCoordToAreaCoord(float[][] linele)
Converts line/element array values from Image to AREA (File) coordinates. Creates new array instead of mucking with input.- Parameters:
linele- input line/element array Image coordinates- Returns:
- array in AREA coordinates
-
imageCoordToAreaCoord
public float[][] imageCoordToAreaCoord(float[][] linele, float[][] newvals)Converts line/element array values from Image to AREA (File) coordinates. Creates new array if newvals is null.- Parameters:
linele- input line/element array Image coordinatesnewvals- return array - create a new array if null- Returns:
- array in AREA coordinates
-
makeAreaNav
public static AREAnav makeAreaNav(int[] navBlock) throws McIDASException
Return an AREAnav based on the input nav block.- Parameters:
navBlock- block to use- Returns:
- corresponding navigation routine.
- Throws:
McIDASException
-
makeAreaNav
public static AREAnav makeAreaNav(int[] navBlock, int[] auxBlock) throws McIDASException
- Throws:
McIDASException
-
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
-
toString
public java.lang.String toString()
Return aStringrepresentation of this nav module- Overrides:
toStringin classjava.lang.Object- Returns:
- wordy string.
-
canApproximateWithSpline
public boolean canApproximateWithSpline()
See if we can approximate by a spline. Subclasses can override- Returns:
- true
-
floatToDouble
public static double[][] floatToDouble(float[][] value)
Convert arrays of floats to doubles- Parameters:
value- arrays of floats- Returns:
- value converted to arrays of doubles
-
doubleToFloat
public static float[][] doubleToFloat(double[][] value)
Convert arrays of doubles to floats- Parameters:
value- arrays of doubles- Returns:
- value converted to arrays of floats
-
-
DMelt 3.0 © DataMelt by jWork.ORG