Class OrientationAffineFactory

java.lang.Object
noaa.coastwatch.render.OrientationAffineFactory

public class OrientationAffineFactory extends Object
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:
  1. 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.
  2. Apply orientation affine.
  3. Translate back to center in data coordinate frame (+Cr, +Cc).
  4. Transform data coordinates to image coordinates as normal.
The image to data coordindate transform is the inverse.
Since:
3.3.1
Author:
Peter Hollemans
See Also:
  • Constructor Details

    • OrientationAffineFactory

      public OrientationAffineFactory()
  • Method Details

    • create

      public static AffineTransform create(EarthTransform2D trans)
      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

      public static void main(String[] argv) throws Exception
      Tests this class.
      Parameters:
      argv - the array of command line parameters.
      Throws:
      Exception