jview
Class DssTransformation

java.lang.Object
  extended by jview.DssTransformation
All Implemented Interfaces:
CoordinateTransforming, SkyTransforming

public class DssTransformation
extends Object
implements CoordinateTransforming, SkyTransforming

This transformation is used with DSS fits images retreived from the web. It uses various fits-keyword in the transferred file to convert from pixel coordinates to ra/dec and vice versa. The code is based on Doug Mink's dsspos.c code, which is distributed under GNU Lesser GPL. Download the original code from SAOImage.


Field Summary
private  VectorG amdx
          Plate solution x coeffiecients.
static String AMDX
          Plate solution x coefficients, add 1-?.
private  VectorG amdy
          Plate solution y coeffiecients.
static String AMDY
          Plate solution x coefficients, add 1-?.
private  Vector2D center
          The center of the DSS plate in ra/deg, both degrees.
static String CNPIX1
          Fits header keyword name.
static String CNPIX2
          Fits header keyword name.
static String NAXIS1
          Fits header keyword name.
static String NAXIS2
          Fits header keyword name.
private static double OFFPLATE
          For reverse transform (to normalized pixel), a small number.
private  VectorG orientation
          Orientation coefficients, only index 2 and 5 used.
private  Point2D pixoff
          The position of the upper-left corner in normalized(!) pixel.
private  Vector2D pixsize
          The pixel size in microns of normalized(!) pixel.
private  VectorDifferentiable plate
          We use vector functions for evaluation of plate coordinates.
static String PLTDECD
          Fits header keyword name.
static String PLTDECM
          Fits header keyword name.
static String PLTDECS
          Fits header keyword name.
static String PLTDECSN
          Fits header keyword name.
static String PLTRAH
          Fits header keyword name.
static String PLTRAM
          Fits header keyword name.
static String PLTRAS
          Fits header keyword name.
static String PLTSCALE
          Fits header keyword name.
static String PPO
          Orientation coefficients, add 1-6.
private  double scale
          The plate scale, used for inversion.
static String XPIXELSZ
          Fits header keyword name.
static String YPIXELSZ
          Fits header keyword name.
 
Constructor Summary
protected DssTransformation(Vector2D radec, Point2D plateoff, double arcsec, Vector2D micron, VectorG rotmatrix, VectorG platexsolution, VectorG plateysolution)
          Constructs a DssTransform with all neccessary parameters.
 
Method Summary
static DssTransformation parseFromDssHeader(nom.tam.fits.Header head)
          Factory method to generate DSS-transformations from a FITS-header.
 Point2D toNormalizedSpace(VectorG radec)
          Converts ra/dec into normalized coordinates.
 VectorG toUserSpace(Point2D norm)
          Converts normalized coordinates into user space, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAXIS1

public static final String NAXIS1
Fits header keyword name.

See Also:
Constant Field Values

NAXIS2

public static final String NAXIS2
Fits header keyword name.

See Also:
Constant Field Values

PLTRAH

public static final String PLTRAH
Fits header keyword name.

See Also:
Constant Field Values

PLTRAM

public static final String PLTRAM
Fits header keyword name.

See Also:
Constant Field Values

PLTRAS

public static final String PLTRAS
Fits header keyword name.

See Also:
Constant Field Values

PLTDECSN

public static final String PLTDECSN
Fits header keyword name.

See Also:
Constant Field Values

PLTDECD

public static final String PLTDECD
Fits header keyword name.

See Also:
Constant Field Values

PLTDECM

public static final String PLTDECM
Fits header keyword name.

See Also:
Constant Field Values

PLTDECS

public static final String PLTDECS
Fits header keyword name.

See Also:
Constant Field Values

PLTSCALE

public static final String PLTSCALE
Fits header keyword name.

See Also:
Constant Field Values

CNPIX1

public static final String CNPIX1
Fits header keyword name.

See Also:
Constant Field Values

CNPIX2

public static final String CNPIX2
Fits header keyword name.

See Also:
Constant Field Values

XPIXELSZ

public static final String XPIXELSZ
Fits header keyword name.

See Also:
Constant Field Values

YPIXELSZ

public static final String YPIXELSZ
Fits header keyword name.

See Also:
Constant Field Values

PPO

public static final String PPO
Orientation coefficients, add 1-6. Need at least 3 and 6.

See Also:
Constant Field Values

AMDX

public static final String AMDX
Plate solution x coefficients, add 1-?. Need at least 1 to 13.

See Also:
Constant Field Values

AMDY

public static final String AMDY
Plate solution x coefficients, add 1-?. Need at least 1 to 13.

See Also:
Constant Field Values

OFFPLATE

private static final double OFFPLATE
For reverse transform (to normalized pixel), a small number.

See Also:
Constant Field Values

center

private Vector2D center
The center of the DSS plate in ra/deg, both degrees.


pixoff

private Point2D pixoff
The position of the upper-left corner in normalized(!) pixel.


scale

private double scale
The plate scale, used for inversion.


pixsize

private Vector2D pixsize
The pixel size in microns of normalized(!) pixel.


orientation

private VectorG orientation
Orientation coefficients, only index 2 and 5 used. Must be N6.


amdx

private VectorG amdx
Plate solution x coeffiecients. Must be at least N14.


amdy

private VectorG amdy
Plate solution y coeffiecients. Must be at least N14.


plate

private VectorDifferentiable plate
We use vector functions for evaluation of plate coordinates.

Constructor Detail

DssTransformation

protected DssTransformation(Vector2D radec,
                            Point2D plateoff,
                            double arcsec,
                            Vector2D micron,
                            VectorG rotmatrix,
                            VectorG platexsolution,
                            VectorG plateysolution)
Constructs a DssTransform with all neccessary parameters. The parameter can be parsed out of DSS-Fits Headers using the factory method parseFromDssHeader(nom.tam.fits.Header).

Warning: Plate offset and pixel size in microns given in the FITS header must be translated to represent normalized pixel.

See Also:
parseFromDssHeader(nom.tam.fits.Header)
Method Detail

toNormalizedSpace

public Point2D toNormalizedSpace(VectorG radec)
Converts ra/dec into normalized coordinates. This involves newton approximation and is thus much slower than the 'forward' transformation toUserSpace(java.awt.geom.Point2D), which is good, as toUserSpace(java.awt.geom.Point2D) is often coupled with a mouse-motion listener.

Specified by:
toNormalizedSpace in interface CoordinateTransforming
Parameters:
radec - A vector of user coordinates.
Returns:
A point in normalized screen coordinate, with 0≤x,y≤1
See Also:
parseFromDssHeader(nom.tam.fits.Header)

toUserSpace

public VectorG toUserSpace(Point2D norm)
Converts normalized coordinates into user space, i.e. into ra/dec in degrees. Note that fits-header information works on true pixel, but we work on normalized pixels.

Specified by:
toUserSpace in interface CoordinateTransforming
Parameters:
norm - A pixel in normalized coordinates.
Returns:
A vector in user space, never null
See Also:
parseFromDssHeader(nom.tam.fits.Header)

parseFromDssHeader

public static final DssTransformation parseFromDssHeader(nom.tam.fits.Header head)
                                                  throws nom.tam.fits.BadHeaderException
Factory method to generate DSS-transformations from a FITS-header. The fits header is scanned for the necessary keywords for converting pixels to ra/dec and vice versae. The name of these keys plus example values are:
       NAXIS1  =                 1782 /Length X axis
       NAXIS2  =                 1786 /Length Y axis
       PLTRAH  =                    9 /Plate center RA
       PLTRAM  =                   22 /
       PLTRAS  =  3.9569489333335E+01 /
       PLTDECSN= '+                 ' /Plate center Dec
       PLTDECD =                    9 /
       PLTDECM =                   49 /
       PLTDECS =  4.0900600000001E+01 /
       PLTSCALE=  6.7199996948242E+01 /Plate Scale arcsec per mm
       CNPIX1  =                 3674 /X corner  (pixels)
       CNPIX2  =                13427 /Y corner
       XPIXELSZ=  1.5029459953308E+01 /X pixel size microns
       YPIXELSZ=  1.5000000000000E+01 /Y pixel size microns
       PPO1    = -3.0694170000000E+06 /Orientation Coefficients
       PPO2    =  0.0000000000000E+00 /
       PPO3    =  1.7750000000000E+05 /
       PPO4    =  0.0000000000000E+00 /
       PPO5    =  3.0694170000000E+06 /
       PPO6    =  1.7750000000000E+05 /
       AMDX1   =  6.7129457419911E+01 /Plate solution x coefficients
       AMDX2   =  1.3626646187870E-01 /
       AMDX3   = -2.9208496144965E+02 /
       AMDX4   = -2.9899239919615E-05 /
       AMDX5   =  2.5043127769380E-05 /
       AMDX6   = -5.7373181429586E-06 /
       AMDX7   =  0.0000000000000E+00 /
       AMDX8   =  2.2933676519874E-06 /
       AMDX9   = -4.0751949082659E-09 /
       AMDX10  =  2.3672449369580E-06 /
       AMDX11  = -4.7291435999810E-08 /
       AMDX12  =  0.0000000000000E+00 /
       AMDX13  =  0.0000000000000E+00 /
       AMDX14  =  0.0000000000000E+00 /
       AMDX15  =  0.0000000000000E+00 /
       AMDX16  =  0.0000000000000E+00 /
       AMDX17  =  0.0000000000000E+00 /
       AMDX18  =  0.0000000000000E+00 /
       AMDX19  =  0.0000000000000E+00 /
       AMDX20  =  0.0000000000000E+00 /
       AMDY1   =  6.7133343203278E+01 /Plate solution y coefficients
       AMDY2   = -1.3340634210135E-01 /
       AMDY3   =  3.1610776589125E+02 /
       AMDY4   =  2.8815934297932E-05 /
       AMDY5   = -1.8079494715991E-05 /
       AMDY6   =  1.6010028102203E-05 /
       AMDY7   =  0.0000000000000E+00 /
       AMDY8   =  2.3353722449029E-06 /
       AMDY9   = -2.5704411915230E-08 /
       AMDY10  =  2.3192988724761E-06 /
       AMDY11  = -2.5321357027618E-11 /
       AMDY12  =  0.0000000000000E+00 /
       AMDY13  =  0.0000000000000E+00 /
       AMDY14  =  0.0000000000000E+00 /
       AMDY15  =  0.0000000000000E+00 /
       AMDY16  =  0.0000000000000E+00 /
       AMDY17  =  0.0000000000000E+00 /
       AMDY18  =  0.0000000000000E+00 /
       AMDY19  =  0.0000000000000E+00 /
       AMDY20  =  0.0000000000000E+00 /
       
IMPORTANT INFORMATION:
To transform to normalized pixels and not to plate pixels, the information gather from the fits header is changed for the offset (CNPIX1, CNPIX2) to represent an offset in normalized space by
       offset_x,y=(CNPIX_1,2+0.5)/NAXIS_1,2
       
as well as the pixel size in micron (XPIXELSZ, YPIXELSZ) is changed to the normalized pixel size in microns:
       pixsize_x,y=(X,Y_PIXELSZ)*NAXIS_1,2
       
As a further detail, the plate center is recorded in degrees, not in radians as in the original SAO image code.

Throws:
nom.tam.fits.BadHeaderException - If not enough information is provided in the fits header to initialize the transformation.