Package noaa.coastwatch.render
Class OrientationAffineFactory
java.lang.Object
noaa.coastwatch.render.OrientationAffineFactory
The OrientationAffineFactory constructs affine transform objects to
correctly orient an EarthTransform so that it appears in the on-screen image
the way a data user would naturally expect to see it. For example,
data users tend to expect north to be at the top of the image, and
east to be at the right, as if looking at a rectangular 2D area of the
globe. In that case, the normal coordinate system would be one such
that N_hat x E_hat (the north-pointing unit vector crossed with the
east-pointing unit vector), under a right-handed coordinate system,
would point into the screen. The affine constructed will be such
that the image coordinate system's basis vectors will be rotated if
needed such that the cross product N_hat x E_hat points into the screen,
_and_ in the case of scan projections (for example a pushbroom scanner)
will be oriented with N_hat pointing towards the top of the image.
To use the affine to transform data coordinates to image coordinates
and vice-versa, apply the orientation at the center of the data coordiantes
in the data coordinate frame:
Data coordinates to image coordinates:
- Translate center of data coordinates to origin in data coordinate frame (-Cr, -Cc) where Cr is the center row and Cc is the center column coordinate.
- Apply orientation affine.
- Translate back to center in data coordinate frame (+Cr, +Cc).
- Transform data coordinates to image coordinates as normal.
- Since:
- 3.3.1
- Author:
- Peter Hollemans
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AffineTransform
create
(EarthTransform2D trans) Creates an affine transform that orients a data coordinate system for viewing.static void
Tests this class.
-
Constructor Details
-
OrientationAffineFactory
public OrientationAffineFactory()
-
-
Method Details
-
create
Creates an affine transform that orients a data coordinate system for viewing.- Parameters:
trans
- the transform to create an orientation for.- Returns:
- an orientation affine, or null if one could not be determined.
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-