public class SwathProjection extends EarthTransform2D implements Encodable
SwathProjection
class implements earth transform
calculations for satellite swath (also called sensor scan) 2D
projections. Swaths may be created by supplying a field of
latitude and longitude values -- one for each data value location.
The swath projection uses polynomial estimator objects for
estimating the latitude and longitude values in order to perform an
accurate reverse lookup (ie: computing the data location for a
given latitude and longitude).Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DESCRIPTION
Projection description string.
|
static int |
MAX_ITERATIONS
The
transform(EarthLocation) maximum iterations. |
static double |
TOLERANCE_FACTOR
The default tolerance distance as a fraction of the resolution.
|
dims
AIRY, AUS_NAT, BESSEL, CLARKE1866, CLARKE1880, EVEREST, GRS1980, HOUGH, INT1909, INT1967, KRASS, MAX_SPHEROIDS, MERCURY1960, MOD_AIRY, MOD_EVEREST, MOD_MER1968, SE_ASIA, SPHERE, SPHEROID_INV_FLAT, SPHEROID_NAMES, SPHEROID_SEMI_MAJOR, SPHEROID_SEMI_MINOR, STD_RADIUS, WGS66, WGS72
Constructor and Description |
---|
SwathProjection(DataVariable lat,
DataVariable lon,
double maxSize,
int[] maxDims)
Constructs a swath projection from the specified latitude and
longitude data and desired polynomial size.
|
SwathProjection(java.lang.Object obj)
Constructs a swath projection from the specified encoding.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
describe()
Gets a string describing the earth transform type.
|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this swath projection for
equality.
|
EarthTransform |
getDataTransform()
Gets the data projection used to create the lat/lon estimators.
|
java.lang.Object |
getEncoding()
Gets an encoded representation of this swath projection.
|
boolean |
getNorthIsUp()
Returns true if north is at the top of the data.
|
double |
getTolerance()
Gets the tolerance distance for earth location transformations.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
void |
resetTolerance()
Resets the tolerance based on the resolution at the center
of the swath.
|
static void |
setNullMode(boolean flag)
Sets the null operation mode for newly constructed swath
transforms.
|
static void |
setTestMode(boolean flag)
Sets the test operation mode for newly constructed swath
transforms.
|
void |
setTolerance(double tolerance)
Sets the tolerance distance for earth location transformations.
|
static java.util.BitSet |
toBits(byte[] byteArray)
Converts an array of bytes to a bit set.
|
static byte[] |
toBytes(java.util.BitSet bits)
Converts a bit set to a byte array.
|
protected void |
transformImpl(DataLocation dataLoc,
EarthLocation earthLoc)
Implements the data to geographic transform.
|
protected void |
transformImpl(EarthLocation earthLoc,
DataLocation dataLoc)
Implements the geographic to data transform.
|
void |
useEncoding(java.lang.Object obj)
Constructs a swath projection from the specified encoding.
|
get2DVersion, getBoundingBox, getWorldAxes, isOrientable, setPointTransform, transformToPoint
clone, distance, getDatum, getDimensions, getResolution, getSpheroid, getSpheroid, getSubset, transform, transform, transform, transform
getMetadataMap
public static final double TOLERANCE_FACTOR
public static final int MAX_ITERATIONS
transform(EarthLocation)
maximum iterations.public static final java.lang.String DESCRIPTION
public SwathProjection(DataVariable lat, DataVariable lon, double maxSize, int[] maxDims)
lat
- a data variable containing latitude data.lon
- a data variable containing longitude data.maxSize
- the maximum polynomial partition size in
kilometres.maxDims
- the maximum partition size in any dimension
in terms of data locations.VariableEstimator
,
EarthPartition
public SwathProjection(java.lang.Object obj)
getEncoding
.obj
- the object encoding.getEncoding()
public static void setNullMode(boolean flag)
describe()
and getNorthIsUp()
methods. This mode is useful for informational routines that
create swath transforms but want to avoid the time spent setting
up the swath transform polynomials. But default, null mode is
off.flag
- the null mode flag, true for null mode.public static void setTestMode(boolean flag)
flag
- the test mode flag, true for test mode.public boolean getNorthIsUp()
public void resetTolerance()
public EarthTransform getDataTransform()
public java.lang.String describe()
EarthTransform
describe
in class EarthTransform
protected void transformImpl(DataLocation dataLoc, EarthLocation earthLoc)
EarthTransform
transformImpl
in class EarthTransform
EarthTransform.transform(DataLocation,EarthLocation)
public void setTolerance(double tolerance)
transform(EarthLocation)
returns an approximate data
location that is within the tolerance distance of the actual data
location.tolerance
- the tolerance distance in kilometres.public double getTolerance()
setTolerance(double)
protected void transformImpl(EarthLocation earthLoc, DataLocation dataLoc)
EarthTransform
transformImpl
in class EarthTransform
EarthTransform.transform(EarthLocation,DataLocation)
public java.lang.Object getEncoding()
getEncoding
in interface Encodable
Object[5]
array containing:
BitSet
object used for encoding swath partition
structure informationList
of double[]
coordinates
specifying swath partition boundaries as min and max (2 arrays per
partition)List
of double[]
arrays specifying
latitude estimator coefficientsList
of double[]
arrays specifying
longitude estimator coefficientsint[2]
array specifying swath dimensionsuseEncoding(java.lang.Object)
public void useEncoding(java.lang.Object obj)
getEncoding
.useEncoding
in interface Encodable
obj
- the object encoding.getEncoding()
public static byte[] toBytes(java.util.BitSet bits)
bits
- the bits to convert.getEncoding()
public static java.util.BitSet toBits(byte[] byteArray)
byteArray
- the bytes to convert.useEncoding(java.lang.Object)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to be compared for equality.public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception