This section describes how to add a WCS calibration to a data set which you are creating from scratch, rather than modifying an existing data set.
In most common cases, the simplest way to create a new WCS calibration from scratch is probably to create a set of strings describing the required calibration in terms of the keywords used by the FITS WCS standard, and then convert these strings into an AST FrameSetFrameSet describing the calibration. This FrameSet can then be used for many other purposes, or simply stored in the data set.
The full FITS-WCS standard is quite involved, currently running to four
separate papers, but the basic kernel is quite simple, involving the
following keywords (all of which end with an integer axis index,
indicated below by ):
As an example consider the common case of a simple 2D image of the sky in which north is parallel to the second pixel axis and east parallel to the (negative) first pixel axis. The image scale is 1.2 arc-seconds per pixel on both axes, and the image is presumed to have been obtained with a tangent plane projection. Furthermore, it is known that pixel coordinates (100.5,98.4) correspond to an RA of 11:00:10 and a Dec. of -23:26:02. A suitable set of FITS-WCS header cards could be:
Notes:
The EQUINOX value defaults to J2000.0 if omitted. FK4 can also be used in place of FK5, in which case EQUINOX defaults to B1950.0.
Once you have created these FITS-WCS header card strings, you should store them in a FitsChanFitsChan and then read the corresponding FrameSet from the FitsChan. How to do this is described in §3.4.
Having created the WCS calibration, you may want to store it in a data
file. How to do this is described in §3.15).
If the required WCS calibration cannot be described as a set of FITS-WCS headers, then a different approach is necessary. In this case, you should first create a FrameFrame describing pixel coordinates, and store this Frame in a new FrameSet. You should then create a new Frame describing the world coordinate system. This Frame may be a specific subclass of Frame such as a SkyFrameSkyFrame for celestial coordinates, a SpecFrameSpecFrame for spectral coordinates, a Timeframe for time coordinates, or a CmpFrameCmpFrame for a combination of different coordinates. You also need to create a suitable MappingMapping which transforms pixel coordinates into world coordinates. AST provides many different types of Mappings, all of which can be combined together in arbitrary fashions to create more complicated Mappings. The WCS Frame should then be added into the FrameSet, using the Mapping to connect the WCS Frame with the pixel Frame.