skyview.geometry
Class WCS

java.lang.Object
  extended by skyview.geometry.Transformer
      extended by skyview.geometry.Converter
          extended by skyview.geometry.WCS
All Implemented Interfaces:
java.io.Serializable, Component

public class WCS
extends Converter

A World Coordinate System defines a translation between celestial and pixel coordinates. Note that in many cases FITS keywords describe the transformations in the other direction (from pixel to celestial) but we follow the convention that forward transformations are from celestial to pixel. Given a WCS object, wcs, the pixel-celestial coordinates trasnformation is simply wcs.inverse();

See Also:
Serialized Form

Constructor Summary
WCS(CoordinateSystem csys, Projection proj, Scaler scale)
          Create a simple WCS given a scaler, CoordinateSystem and Projection.
WCS(Header h)
          Create the WCS using the definition given in the FITS header.
WCS(Header h, int lonAxis, int latAxis)
          Let the user say which axes to use
 
Method Summary
 void copyToHeader(Header h)
           
 CoordinateSystem getCoordinateSystem()
          Get the CoordinateSystem used in the WCS
 Distorter getDistorter()
          Get the plane distorter used in the projection (or null)
 int[] getHeaderNaxis()
           
 Projection getProjection()
          Get the projection used in the WCS
 double getScale()
          Get the nominal scale of the WCS.
 Scaler getScaler()
          Get the linear scaler used in the projection
 void setHeaderNaxis(int[] newAxes)
           
static void setPreferDSS(boolean flag)
           
 boolean standardWCS()
           
static void updateHeader(Header h, Scaler s, double[] crval, java.lang.String projString, java.lang.String coordString)
          Write FITS WCS keywords given key values.
 
Methods inherited from class skyview.geometry.Converter
add, debug, getDescription, getInputDimension, getName, getOutputDimension, inverse, isInverse, printElements, transform, transform
 
Methods inherited from class skyview.geometry.Transformer
transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WCS

public WCS(CoordinateSystem csys,
           Projection proj,
           Scaler scale)
    throws TransformationException
Create a simple WCS given a scaler, CoordinateSystem and Projection.

Throws:
TransformationException

WCS

public WCS(Header h)
    throws TransformationException
Create the WCS using the definition given in the FITS header.

Throws:
TransformationException

WCS

public WCS(Header h,
           int lonAxis,
           int latAxis)
    throws TransformationException
Let the user say which axes to use

Throws:
TransformationException
Method Detail

setPreferDSS

public static void setPreferDSS(boolean flag)

getCoordinateSystem

public CoordinateSystem getCoordinateSystem()
Get the CoordinateSystem used in the WCS


getProjection

public Projection getProjection()
Get the projection used in the WCS


getScaler

public Scaler getScaler()
Get the linear scaler used in the projection


getDistorter

public Distorter getDistorter()
Get the plane distorter used in the projection (or null)


standardWCS

public boolean standardWCS()

getHeaderNaxis

public int[] getHeaderNaxis()

setHeaderNaxis

public void setHeaderNaxis(int[] newAxes)

getScale

public double getScale()
Get the nominal scale of the WCS.


updateHeader

public static void updateHeader(Header h,
                                Scaler s,
                                double[] crval,
                                java.lang.String projString,
                                java.lang.String coordString)
                         throws java.lang.Exception
Write FITS WCS keywords given key values. Only relatively simple WCSs are handled here. We assume we are dealing with axes 1 and 2.

Parameters:
h - The header to be updated.
s - A Scaler giving the transformation between standard projection coordinates and pixel/device coordinates.
projString - A three character string giving the projection used. Supported projections are: "Tan", "Sin", "Ait", "Car", "Zea".
coordString - A string giving the coordinate system used. The first character gives the general frame. For most frames the remainder of the string gives the equinox of the coordinate system. E.g., J2000, B1950, Galactic, "E2000", "H2020.10375".
Throws:
java.lang.Exception

copyToHeader

public void copyToHeader(Header h)
                  throws HeaderCardException
Throws:
HeaderCardException