public abstract class AREAnav extends Object implements Serializable
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);
......................
By convention, latitudes are positive North (negative South), and
longitudes are positive East (negative West).Modifier and Type | Field and Description |
---|---|
static int |
ABIN
AREA file value that corresponds to ABIN.
|
static int |
ABIS
Code value in AREA files used to designate ABIS
|
static double |
DEGREES_TO_RADIANS
Constant for degrees to radians conversion
|
static int |
DMSP
Code value in AREA files used to designate DMSP navigation
|
static int |
GEOS
Code value in AREA files used to designate GEOS navigation
|
static int |
GMSX
Code value in AREA files used to designate GMSX (GMS) navigation
|
static int |
GOES
Code value in AREA files used to designate GOES (GOES D-H) navigation
|
static int |
GVAR
Code value in AREA files used to designate GVAR (GOES I-M) navigation
|
int |
indexEle
"Element" index in line/element array
|
int |
indexLat
"Latitude" index in latitude/longitude array
|
int |
indexLine
"Line" index in line/element array
|
int |
indexLon
"Longitude" index in latitude/longitude array
|
static int |
KALP
Code value in AREA files used to designate Lat/Lon
|
static int |
LALO
Code value in AREA files used to designate Lat/Lon
|
static int |
LAMB
Code value in AREA files used to designate LAMB (lambert conformal)
navigation
|
static int |
LL
Code value for specifying Latitude/Longitude transformations
|
static int |
MERC
Code value in AREA files used to designate MERC (mercator) navigation
|
static int |
MOLL
Code value in AREA files used to designate MOLL (Mollweide)
navigation
|
static int |
MSAT
Code value in AREA files used to designate MSAT (Meteosat)
navigation
|
static int |
MSG
Code value in AREA files used to designate MSG navigation
|
static int |
MSGT
Code value in AREA files used to designate MSGT navigation
|
static int |
POES
Code value in AREA files used to designate POES navigation
|
static int |
PS
Code value in AREA files used to designate PS (polar stereographic)
navigation
|
static double |
RADIANS_TO_DEGREES
Constant for radians to degrees conversion
|
static int |
RADR
Code value in AREA files used to designate RADR (radar) navigation
|
static int |
RECT
Code value in AREA files used to designate RECT (rectilinear)
navigation
|
static int |
SIN
Code value in AREA files used to designate SIN (sinusoidal cone)
navigation
|
static int |
TANC
Code value in AREA files used to designate TANC (tangent cone)
navigation
|
static int |
XY
Code value for specifying Cartesian (X/Y) transformations
|
Constructor and Description |
---|
AREAnav() |
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.
|
boolean |
canApproximateWithSpline()
See if we can approximate by a spline.
|
static float[][] |
doubleToFloat(double[][] value)
Convert arrays of doubles to floats
|
boolean |
equals(Object obj)
Determines whether or not the
Object in question is
the same as this AREAnav . |
static double[][] |
floatToDouble(float[][] value)
Convert arrays of floats to doubles
|
double |
getLineOffset()
Get the line offset for flipped coordinates
|
double[] |
getSubpoint()
Get the lat,lon of the subpoint if available
|
double[][] |
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.
|
boolean |
isFlippedLineCoordinates()
Determine if navigation is using flipped coordinates
|
static AREAnav |
makeAreaNav(int[] navBlock)
Return an AREAnav based on the input nav block.
|
static AREAnav |
makeAreaNav(int[] navBlock,
int[] auxBlock) |
void |
setFlipLineCoordinates(int line)
specify whether the line coordinates are inverted and the line
offset.
|
void |
setImageStart(int startImageLine,
int startImageElement)
define the coordinate in the [0][0] position of the image.
|
void |
setMag(float magLine,
float magElement)
define the magnification factor (in case an image
was blown up when displayed).
|
void |
setMag(int magLine,
int magElement)
define the magnification factor (in case an image
was blown up when displayed).
|
void |
setRes(float resLine,
float resElement)
Define the resolution of the image.
|
void |
setRes(int resLine,
int resElement)
Define the resolution of the image.
|
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).
|
abstract double[][] |
toLatLon(double[][] linele)
converts from satellite coordinates to latitude/longitude
|
float[][] |
toLatLon(float[][] linele)
converts from satellite coordinates to latitude/longitude.
|
abstract double[][] |
toLinEle(double[][] latlon)
toLinEle converts lat/long to satellite line/element
|
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 of
toLinEle(double[][]) . |
String |
toString()
Return a
String representation of this nav module |
public static final double RADIANS_TO_DEGREES
public static final double DEGREES_TO_RADIANS
public static final int DMSP
public static final int GMSX
public static final int GOES
public static final int GEOS
public static final int GVAR
public static final int MOLL
public static final int MSAT
public static final int MSGT
public static final int MSG
public static final int POES
public static final int RADR
public static final int RECT
public static final int PS
public static final int MERC
public static final int TANC
public static final int SIN
public static final int LAMB
public static final int LALO
public static final int KALP
public static final int ABIS
public static final int ABIN
public static final int LL
public static final int XY
public final int indexLine
public final int indexEle
public final int indexLat
public final int indexLon
public abstract double[][] toLatLon(double[][] linele)
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.)public abstract double[][] toLinEle(double[][] latlon)
latlon
- array of lat/long pairs. Where latlon[indexLat][]
are latitudes and latlon[indexLon][] are longitudes.public float[][] toLatLon(float[][] linele)
toLatLon(double[][])
.
Subclasses should implement a real float version for better
performance.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.)public float[][] toLinEle(float[][] latlon)
toLinEle(double[][])
.
Subclasses should implement a real float version for better
performance.latlon
- array of lat/long pairs. Where latlon[indexLat][]
are latitudes and latlon[indexLon][] are longitudes.public void setRes(int resLine, int resElement)
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.public void setRes(float resLine, float resElement)
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.public void setMag(int magLine, int magElement)
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.public void setMag(float magLine, float magElement)
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.public void setStart(int startLine, int startElement)
startLine
- the starting line number in another
coordinate systemstartElement
- the starting element number in another
coordinate systempublic void setImageStart(int startImageLine, int startImageElement)
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)public void setFlipLineCoordinates(int line)
line
- ending line numberpublic boolean isFlippedLineCoordinates()
public double[] getSubpoint()
public double getLineOffset()
public double[][] areaCoordToImageCoord(double[][] linele)
linele
- input line/element array in AREA coordinatespublic double[][] areaCoordToImageCoord(double[][] linele, double[][] newvals)
linele
- input line/element array in AREA coordinatesnewvals
- return array - create a new array if nullpublic double[][] imageCoordToAreaCoord(double[][] linele)
linele
- input line/element array Image coordinatespublic double[][] imageCoordToAreaCoord(double[][] linele, double[][] newvals)
linele
- input line/element array Image coordinatesnewvals
- return array - create a new array if nullpublic float[][] areaCoordToImageCoord(float[][] linele)
linele
- input line/element array in AREA coordinatespublic float[][] areaCoordToImageCoord(float[][] linele, float[][] newvals)
linele
- input line/element array in AREA coordinatesnewvals
- return array - create a new array if nullpublic float[][] imageCoordToAreaCoord(float[][] linele)
linele
- input line/element array Image coordinatespublic float[][] imageCoordToAreaCoord(float[][] linele, float[][] newvals)
linele
- input line/element array Image coordinatesnewvals
- return array - create a new array if nullpublic static AREAnav makeAreaNav(int[] navBlock) throws McIDASException
navBlock
- block to useMcIDASException
public static AREAnav makeAreaNav(int[] navBlock, int[] auxBlock) throws McIDASException
McIDASException
public boolean equals(Object obj)
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.public String toString()
String
representation of this nav modulepublic boolean canApproximateWithSpline()
public static double[][] floatToDouble(float[][] value)
value
- arrays of floatspublic static float[][] doubleToFloat(double[][] value)
value
- arrays of doublesCopyright © 1996–2023 The SSEC Visualization Project. All rights reserved.