org.eso.fits
Class FitsWCS

java.lang.Object
  extended by org.eso.fits.FitsWCS

public class FitsWCS
extends java.lang.Object

FitsWCS class maps FITS WCS keywords to internal representatios and provides basic transformations. The transformations are described in Greisen & Calabretta (2002, A&A 395, 1061) for the basic representation and in Calabretta & Greisen (2002, A&A 395, 1077) for transformations. Note: the current implementation supports only the following non-linear transformations: TAN, STG, and ARC. Note: Rotations defined by the CROTAi keyword are not applied! Warning: The current implementation is experimental and should not be used for production. It will fail for none trivial headers.


Field Summary
protected  double[] amdx
           
protected  double[] amdy
           
static int ARC
           
protected  double[] cdelt
           
protected  double[][] cdMatrix
           
protected  int[] cproj
           
protected  double[] crota
           
protected  double[] crpix
           
protected  double[] crval
           
protected  java.lang.String[] ctype
           
protected  double[] fip
           
protected  boolean hasCdMatrix
           
protected  boolean hasPcMatrix
           
static int LIN
           
protected  int nax
           
static int NOT
           
protected  double[][] pcMatrix
           
static int STG
           
static int TAN
           
protected  double[] thp
           
protected  int type
           
 
Constructor Summary
FitsWCS()
          Default constructor for FitsWCS class.
FitsWCS(FitsHeader header)
          Constructor for FitsWCS class given a FITS header with associated data unit as a file.
FitsWCS(FitsHeader header, char ver)
          Constructor for FitsWCS class given a FITS header with associated data unit as a file.
FitsWCS(int nax)
          Constructor for FitsWCS given number of axes
 
Method Summary
 int getType(int nax)
          get projection type of WCS transformation of given axis.
 void setHeader(FitsHeader header, char ver)
          Define FITS header for FitsWCS object.
 double[] toPixel(double[] wcs)
          Compute pixel coordinates from a set of World Coordinates.
 double[] toWCS(double[] pix)
          Compute World Coordinates from pixel coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT

public static final int NOT
See Also:
Constant Field Values

LIN

public static final int LIN
See Also:
Constant Field Values

TAN

public static final int TAN
See Also:
Constant Field Values

ARC

public static final int ARC
See Also:
Constant Field Values

STG

public static final int STG
See Also:
Constant Field Values

type

protected int type

nax

protected int nax

cproj

protected int[] cproj

crpix

protected double[] crpix

crval

protected double[] crval

cdelt

protected double[] cdelt

crota

protected double[] crota

fip

protected double[] fip

thp

protected double[] thp

ctype

protected java.lang.String[] ctype

cdMatrix

protected double[][] cdMatrix

pcMatrix

protected double[][] pcMatrix

hasPcMatrix

protected boolean hasPcMatrix

hasCdMatrix

protected boolean hasCdMatrix

amdx

protected double[] amdx

amdy

protected double[] amdy
Constructor Detail

FitsWCS

public FitsWCS()
Default constructor for FitsWCS class.


FitsWCS

public FitsWCS(FitsHeader header)
Constructor for FitsWCS class given a FITS header with associated data unit as a file.

Parameters:
header - FitsHeader object with the image header

FitsWCS

public FitsWCS(FitsHeader header,
               char ver)
Constructor for FitsWCS class given a FITS header with associated data unit as a file.

Parameters:
header - FitsHeader object with the image header
ver - version of WCS i.e. ' ' or 'A'..'Z'

FitsWCS

public FitsWCS(int nax)
Constructor for FitsWCS given number of axes

Parameters:
nax - Number of axes in data matrix
Method Detail

setHeader

public void setHeader(FitsHeader header,
                      char ver)
Define FITS header for FitsWCS object.

Parameters:
header - FitsHeader object with the image header
ver - version of WCS i.e. ' ' or 'A'..'Z'

getType

public int getType(int nax)
get projection type of WCS transformation of given axis.

Parameters:
nax - no. of axis to enquire (0..naxis-1)
Returns:
type of World Coordinate System

toWCS

public double[] toWCS(double[] pix)
Compute World Coordinates from pixel coordinates.

Parameters:
pix - Array with pixel coordinates
Returns:
array with pixel location in world coordinates

toPixel

public double[] toPixel(double[] wcs)
Compute pixel coordinates from a set of World Coordinates.

Parameters:
wcs - Array with World Coordinates