view
Class OrthographicMorpher

java.lang.Object
  extended by view.OrthographicMorpher
All Implemented Interfaces:
Morphing

public class OrthographicMorpher
extends Object
implements Morphing

This morphing instance translates ra/dec to pixels under the rule of an orthogonal projection. It requires a center of projection in ra,dec and a field-of-view size, i.e. the size of the projected area in degrees. Setting a new component size can then be performed at will. The defining equations are:

   x = k_x cos(δ) sin(Δα),
   y = k_y [sin(δ)cos(δ_c)-cos(δ)sin(δ_c)cos(Δα)],
   sin(δ)=y/k_y cos(δ_c)+r sin(δ_c),
   tan(Δα)=x/[r cos(δ_c)-y sin(δ_c)]
   
where r is a radius,
   r^2 = (1-x^2/k_x^2-y^2/k_y^2)
   
The scaling factors k_x and k_y can be calculated using
   k_x = w/2 sin(δ_c)/[tan(a/2)*(1-sin^2(δ_c)cos^2(a/2))^0.5],
   k_y = h/2 1/sin(b/2)
   
with w and h being the width and height of the field-of-view in pixel.

Note that above formulars render the center of projection at (0,0). To allow direct conversion into component pixels, the pixels are translated for half the component's width and side, respectively.


Field Summary
private  double cosdc
          The cosine of the declination of the center of projection.
private  double dec
          The center of projection, declination in degrees.
private  Dimension fov
          The size of the field of view in pixel.
private  boolean hemisphere
          If true we only consider points on the front side.
private  double kx
          The scaling factor in x for fov-pixel size one.
private  double ky
          The scaling factor in y for fov-pixel size one.
private  double rac
          The center of projection, right ascension in degrees.
private  double sindc
          The sine of the declination of the center of projection.
 
Constructor Summary
OrthographicMorpher(double ra, double de, double width, double height)
          The center of the projcetion and the extend of the field-of-view in x and y directions must be specified.
OrthographicMorpher(double ra, double de, double width, double height, boolean half)
          The center of the projcetion and the extend of the field-of-view in x and y directions must be specified.
 
Method Summary
 void setFieldSize(Dimension size)
          Sets the current size of the field of view in pixels.
 Point2D toPrimary(Point2D radec)
          Converts a point from the secondary system to the primary.
 Point2D toSecondary(Point2D pixel)
          This conversation is non-unique, but we assume the solution closer to the center of projection to be the correct one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rac

private double rac
The center of projection, right ascension in degrees.


dec

private double dec
The center of projection, declination in degrees.


sindc

private double sindc
The sine of the declination of the center of projection.


cosdc

private double cosdc
The cosine of the declination of the center of projection.


kx

private double kx
The scaling factor in x for fov-pixel size one.


ky

private double ky
The scaling factor in y for fov-pixel size one.


fov

private Dimension fov
The size of the field of view in pixel.


hemisphere

private boolean hemisphere
If true we only consider points on the front side.

Constructor Detail

OrthographicMorpher

public OrthographicMorpher(double ra,
                           double de,
                           double width,
                           double height)
The center of the projcetion and the extend of the field-of-view in x and y directions must be specified. All units are in degrees. Scaling factors are calculated, but only for a 1pxl x 1pxl field. All angles are in degrees. Only considers points on the positive hemisphere


OrthographicMorpher

public OrthographicMorpher(double ra,
                           double de,
                           double width,
                           double height,
                           boolean half)
The center of the projcetion and the extend of the field-of-view in x and y directions must be specified. All units are in degrees. Scaling factors are calculated, but only for a 1pxl x 1pxl field. All angles are in degrees.

Method Detail

setFieldSize

public void setFieldSize(Dimension size)
Sets the current size of the field of view in pixels.


toSecondary

public Point2D toSecondary(Point2D pixel)
This conversation is non-unique, but we assume the solution closer to the center of projection to be the correct one.

Specified by:
toSecondary in interface Morphing
Parameters:
pixel - The image coordinates.
Returns:
A Point in the secondary system, i.e. ra/dec
Throws:
UnsupportedOperationException

toPrimary

public Point2D toPrimary(Point2D radec)
Converts a point from the secondary system to the primary. Converts ra/dec into pixel. Note that under a orthographic projection, two positions on the sphere exist that convert to the same pixel. If hemisphere is true, then null is returned if the ra/dec point handed over is on the 'backside'.

Specified by:
toPrimary in interface Morphing
Parameters:
radec - A point in the secondary system.
Returns:
Pixel coordinates.
Throws:
UnsupportedOperationException