Package skyview.geometry
Class WCS
java.lang.Object
skyview.geometry.Transformer
skyview.geometry.Converter
skyview.geometry.WCS
- All Implemented Interfaces:
Serializable
,Component
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:
-
Constructor Summary
ConstructorsConstructorDescriptionWCS
(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
Modifier and TypeMethodDescriptionReturn a new WCS from the existing WCS where we add a scale.approximate
(double[] pix) Approximate a WCS (which presumably includes a Distorter) with a standard, locally correct, WCS.void
copyToHeader
(nom.tam.fits.Header h) Get the CoordinateSystem used in the WCSGet the plane distorter used in the projection (or null)int[]
Get the projection used in the WCSdouble
getScale()
Get the nominal scale of the WCS.Get the linear scaler used in the projectionvoid
setHeaderNaxis
(int[] newAxes) static void
setPreferDSS
(boolean flag) boolean
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 Details
-
WCS
Create a simple WCS given a scaler, CoordinateSystem and Projection.- Throws:
TransformationException
-
WCS
Create the WCS using the definition given in the FITS header.- Throws:
TransformationException
-
WCS
Let the user say which axes to use- Throws:
TransformationException
-
-
Method Details
-
addScaler
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
Get the CoordinateSystem used in the WCS -
getProjection
Get the projection used in the WCS -
getScaler
Get the linear scaler used in the projection -
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
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
-