Class SkyviewProjection

  • All Implemented Interfaces:
    Projection
    Direct Known Subclasses:
    SinProjection

    public class SkyviewProjection
    extends java.lang.Object
    implements Projection
    Projection implementation based on classes from the Skyview package.
    Since:
    21 Feb 2013
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      SkyviewProjection​(skyview.geometry.Projecter projecter, java.awt.Shape shape, boolean isContinuous)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SkyAspect createAspect​(boolean reflect, double[] r3, double radiusRad, Range[] ranges)
      Creates a SkyAspect from configuration information.
      static SkyviewProjection createProjection​(skyview.geometry.Projecter projecter, boolean isContinuous)
      Factory method that knows shapes for some projections.
      double[] cursorRotate​(double[] rotmat, java.awt.geom.Point2D.Double pos0, java.awt.geom.Point2D.Double pos1)
      Returns null - rotation not implemented.
      SkyFov getFov​(SkySurface surf)
      Returns the field of view represented by this aspect.
      java.lang.String getProjectionDescription()
      Returns a short description of the projection.
      java.lang.String getProjectionName()
      Returns the projection name.
      java.awt.Shape getProjectionShape()
      Returns the shape which encloses all the plane positions to which legal sky coordinates can be projected.
      skyview.geometry.Projecter getSkyviewProjecter()
      Returns the projecter object used by this SkyviewProjection.
      boolean isContinuous()
      Indicates whether this projection is known to be continous over its whole range.
      boolean project​(double rx, double ry, double rz, java.awt.geom.Point2D.Double pos)
      Transforms a sky position to a plane position.
      double[] projRotate​(double[] rotmat, java.awt.geom.Point2D.Double pos0, java.awt.geom.Point2D.Double pos1)
      Returns null - rotation not implemented.
      boolean unproject​(java.awt.geom.Point2D.Double pos, double[] r3)
      Transforms a plane position to a sky position.
      boolean useRanges​(boolean reflect, double[] r3, double radiusRad)
      Returns false - ranging not used.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SkyviewProjection

        public SkyviewProjection​(skyview.geometry.Projecter projecter,
                                 java.awt.Shape shape,
                                 boolean isContinuous)
        Constructor. You have to tell it whether the projection is known to be continuous. In more recent SkyView releases, I think this can be determined programmatically from the Projecter instance by using the function !projecter.straddleable().
        Parameters:
        projecter - projecter object
        shape - shape of the sky in this projection
        isContinuous - whether projection is known to be continuous
    • Method Detail

      • getProjectionName

        public java.lang.String getProjectionName()
        Description copied from interface: Projection
        Returns the projection name.
        Specified by:
        getProjectionName in interface Projection
        Returns:
        user-directed projection name
      • getProjectionDescription

        public java.lang.String getProjectionDescription()
        Description copied from interface: Projection
        Returns a short description of the projection. return projection description
        Specified by:
        getProjectionDescription in interface Projection
      • getProjectionShape

        public java.awt.Shape getProjectionShape()
        Description copied from interface: Projection
        Returns the shape which encloses all the plane positions to which legal sky coordinates can be projected. Typically this has linear dimensions of the order of PI.
        Specified by:
        getProjectionShape in interface Projection
        Returns:
        projected sky shape
      • isContinuous

        public boolean isContinuous()
        Description copied from interface: Projection
        Indicates whether this projection is known to be continous over its whole range. Returns false if there may be any cases for which small changes in the 3-vector leads to large changes in the plane position (such as near lon=180 in an Aitoff, but not a Sinus, projection).
        Specified by:
        isContinuous in interface Projection
        Returns:
        true iff this projection is known to be continuous
      • project

        public boolean project​(double rx,
                               double ry,
                               double rz,
                               java.awt.geom.Point2D.Double pos)
        Description copied from interface: Projection
        Transforms a sky position to a plane position.
        Specified by:
        project in interface Projection
        Parameters:
        rx - normalised 3D X coordinate
        ry - normalised 3D Y coordinate
        rz - normalised 3D Z coordinate
        pos - point object into which projected dimensionless X,Y coordinates will be written on success
        Returns:
        true if transformation succeeded
      • unproject

        public boolean unproject​(java.awt.geom.Point2D.Double pos,
                                 double[] r3)
        Description copied from interface: Projection
        Transforms a plane position to a sky position.
        Specified by:
        unproject in interface Projection
        Parameters:
        pos - contains dimensionless X,Y coordinates of plane position
        r3 - 3-element array into which normalised X,Y,Z sky coordinates will be written on success
        Returns:
        true if transformation succeeded
      • cursorRotate

        public double[] cursorRotate​(double[] rotmat,
                                     java.awt.geom.Point2D.Double pos0,
                                     java.awt.geom.Point2D.Double pos1)
        Returns null - rotation not implemented.
        Specified by:
        cursorRotate in interface Projection
        Parameters:
        rotmat - initial rotation matrix
        pos0 - initial cursor position
        pos1 - destination cursor position
        Returns:
        destination rotation matrix, or null
      • projRotate

        public double[] projRotate​(double[] rotmat,
                                   java.awt.geom.Point2D.Double pos0,
                                   java.awt.geom.Point2D.Double pos1)
        Returns null - rotation not implemented.
        Specified by:
        projRotate in interface Projection
        Parameters:
        rotmat - initial rotation matrix
        pos0 - initial projected position
        pos1 - destination projected position
        Returns:
        destination rotation matrix, or null
      • getFov

        public SkyFov getFov​(SkySurface surf)
        Description copied from interface: Projection
        Returns the field of view represented by this aspect. This is a best estimate, it may be approximate depending on the projection geometry. If the field of view is the default for this projection, then null should be returned. Null may also be returned if for some reason no field of view can be determined.
        Specified by:
        getFov in interface Projection
        Parameters:
        surf - sky surface, which must be set up using this projection
        Returns:
        field of view, or null
      • getSkyviewProjecter

        public skyview.geometry.Projecter getSkyviewProjecter()
        Returns the projecter object used by this SkyviewProjection.
        Returns:
        projecter
      • createProjection

        public static SkyviewProjection createProjection​(skyview.geometry.Projecter projecter,
                                                         boolean isContinuous)
        Factory method that knows shapes for some projections. Name and description are taken from the skyview metadata.
        Parameters:
        projecter - skyview projecter
        isContinuous - whether projection is known to be continuous
        Throws:
        java.lang.IllegalArgumentException - if the shape is not known