uk.ac.starlink.ttools.plot2.geom
Class SkyviewProjection

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.geom.SkyviewProjection
All Implemented Interfaces:
Projection
Direct Known Subclasses:
SinProjection

public class SkyviewProjection
extends Object
implements Projection

Projection implementation based on classes from the Skyview package.

Since:
21 Feb 2013
Author:
Mark Taylor

Field Summary
static SkyviewProjection AIT
          Aitoff projection.
static SkyviewProjection CAR1
          Cartesian projection.
static SkyviewProjection TAN
          Gnomonic projection.
 
Constructor Summary
SkyviewProjection(skyview.geometry.Projecter projecter, Shape shape)
          Constructor.
 
Method Summary
 SkyAspect createAspect(boolean reflect, double[] r3, double radiusRad, Range[] ranges)
          Creates a SkyAspect from configuration information.
static SkyviewProjection createProjection(skyview.geometry.Projecter projecter)
          Factory method that knows shapes for some projections.
 double[] cursorRotate(double[] rotmat, Point2D.Double pos0, Point2D.Double pos1)
          Returns null - rotation not implemented.
 String getProjectionDescription()
          Returns a short description of the projection.
 String getProjectionName()
          Returns the projection name.
 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 project(double rx, double ry, double rz, Point2D.Double pos)
          Transforms a sky position to a plane position.
 double[] projRotate(double[] rotmat, Point2D.Double pos0, Point2D.Double pos1)
          Returns null - rotation not implemented.
 boolean unproject(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
 

Field Detail

AIT

public static final SkyviewProjection AIT
Aitoff projection.


CAR1

public static final SkyviewProjection CAR1
Cartesian projection.


TAN

public static final SkyviewProjection TAN
Gnomonic projection.

Constructor Detail

SkyviewProjection

public SkyviewProjection(skyview.geometry.Projecter projecter,
                         Shape shape)
Constructor.

Parameters:
projecter - projecter object
shape - shape of the sky in this projection
Method Detail

getProjectionName

public String getProjectionName()
Description copied from interface: Projection
Returns the projection name.

Specified by:
getProjectionName in interface Projection
Returns:
user-directed projection name

getProjectionDescription

public 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 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

project

public boolean project(double rx,
                       double ry,
                       double rz,
                       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(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,
                             Point2D.Double pos0,
                             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,
                           Point2D.Double pos0,
                           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

useRanges

public boolean useRanges(boolean reflect,
                         double[] r3,
                         double radiusRad)
Returns false - ranging not used.

Specified by:
useRanges in interface Projection
Parameters:
reflect - whether requested aspect will be reflected
r3 - central position of field of view (may be null)
radiusRad - radius of field of view (may be NaN)
Returns:
true if ranges would be useful given the other arguments
See Also:
SurfaceFactory.readRanges(P, uk.ac.starlink.ttools.plot2.PlotLayer[], uk.ac.starlink.ttools.plot2.data.DataStore)

createAspect

public SkyAspect createAspect(boolean reflect,
                              double[] r3,
                              double radiusRad,
                              Range[] ranges)
Description copied from interface: Projection
Creates a SkyAspect from configuration information. Either the supplied field of view or data ranges may be used, or neither.

Specified by:
createAspect in interface Projection
Parameters:
reflect - whether requested aspect will be reflected
r3 - central position of field of view (may be null)
radiusRad - radius of field of view (may be NaN)
ranges - definite ranges for normalised X,Y,Z coordinates acquired from data
Returns:
new sky aspect
See Also:
SurfaceFactory.createAspect(P, uk.ac.starlink.ttools.plot2.config.ConfigMap, uk.ac.starlink.ttools.plot.Range[])

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)
Factory method that knows shapes for some projections. Name and description are taken from the skyview metadata.

Parameters:
projecter - skyview projecter
Throws:
IllegalArgumentException - if the shape is not known


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.