Package skyview.geometry
Class WCS
- java.lang.Object
-
- skyview.geometry.Transformer
-
- skyview.geometry.Converter
-
- skyview.geometry.WCS
-
- All Implemented Interfaces:
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
Constructors Constructor Description WCS(nom.tam.fits.Header h)
Create the WCS using the definition given in the FITS header.WCS(nom.tam.fits.Header h, int lonAxis, int latAxis)
Let the user say which axes to useWCS(CoordinateSystem csys, Projection proj, Scaler scale)
Create a simple WCS given a scaler, CoordinateSystem and Projection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WCS
addScaler(Scaler shift)
Return a new WCS from the existing WCS where we add a scale.WCS
approximate(double[] pix)
Approximate a WCS (which presumably includes a Distorter) with a standard, locally correct, WCS.void
copyToHeader(nom.tam.fits.Header h)
CoordinateSystem
getCoordinateSystem()
Get the CoordinateSystem used in the WCSDistorter
getDistorter()
Get the plane distorter used in the projection (or null)int[]
getHeaderNaxis()
Projection
getProjection()
Get the projection used in the WCSdouble
getScale()
Get the nominal scale of the WCS.Scaler
getScaler()
Get the linear scaler used in the projectionvoid
setHeaderNaxis(int[] newAxes)
static void
setPreferDSS(boolean flag)
boolean
standardWCS()
void
updateHeader(nom.tam.fits.Header h, Scaler s, double[] crval, String projString, String coordString)
Write FITS WCS keywords given key values.-
Methods inherited from class skyview.geometry.Converter
add, check, debug, getDescription, getInputDimension, getName, getOutputDimension, inverse, isInverse, printElements, transform
-
Methods inherited from class skyview.geometry.Transformer
transform, transform
-
-
-
-
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(nom.tam.fits.Header h) throws TransformationException
Create the WCS using the definition given in the FITS header.- Throws:
TransformationException
-
WCS
public WCS(nom.tam.fits.Header h, int lonAxis, int latAxis) throws TransformationException
Let the user say which axes to use- Throws:
TransformationException
-
-
Method Detail
-
addScaler
public WCS addScaler(Scaler shift) throws TransformationException
Return a new WCS from the existing WCS where we add a scale. This allows us to return a WCS for a subset of an image easily.- Throws:
TransformationException
-
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 void updateHeader(nom.tam.fits.Header h, Scaler s, double[] crval, String projString, String coordString) throws 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 o the coordinate system. E.g., J2000, B1950, Galactic, "E2000", "H2020.10375".- Throws:
Exception
-
copyToHeader
public void copyToHeader(nom.tam.fits.Header h) throws nom.tam.fits.HeaderCardException
- Throws:
nom.tam.fits.HeaderCardException
-
approximate
public WCS approximate(double[] pix) throws TransformationException
Approximate a WCS (which presumably includes a Distorter) with a standard, locally correct, WCS.- Parameters:
pix
- The pixel location we want to approximate around.- Returns:
- A more standard WCS with the distortion removed (locally).
- Throws:
TransformationException
-
-