High level functions

The starlink.Atl module within PyAST provides a small number of high level functions and classes that wrap up various other PyAST calls to perform commonly required operations.

Utility functions

readfitswcs:
Reads an AST FrameSet from a FITS header.

The header from the specified PyFITS HDU is read, and an AST FrameSet describing the WCS information in the header is returned. None is returned instead of a FrameSet if WCS information cannot be read from the header. A string identifying the scheme used to describe WCS information in the header (the encoding) is also returned.

Synopsis:

Example:

plotfitswcs:
Read WCS from a PyFITS HDU and plot an annotated coordinate grid in a matplotlib axes area. The grid covers the entire image. The function returns a reference to the Plot that was used to draw the axes.

Synopsis:

Example:

plotframeset:
Plot an annotated coordinate grid in a matplotlib axes area.The function returns a reference to the Plot that was used to draw the axes.

Synopsis:

Example:

writefitswcs:
Writes an AST FrameSet to a FITS header.

The WCS information described by the supplied FrameSet is converted into a set of FITS header cards which are stored in the supplied PyFITS HDU (all cards in the header are first removed).

Synopsis:

Example:


Utility classes

PyFITSAdapter:
This class allows a PyFITS HDU to be used as the source or sink object with a FitsChan.

When used as a FitsChan source, the PyFITSAdapter will allow the FitsChan to read each of the cards in the associated PyFITS header, thus allowing the cards to be copied into the FitsChan. This happens when the newly created, empty FitsChan is used for the first time (i.e. when any of its methods is invoked), and subsequently whenever the FitsChan.readfits() method is invoked.

When used as a FitsChan sink, the PyFITSAdapter will allow the FitsChan to copy its own header cards into the PyFITS header. This happens when the FitsChan is deleted or when the FitsChan.writefits() method is invoked. If the PyFITSAdapter.clear property is true, then the PyFITS header is first emptied of all existing headers, and the contents of the FitsChan are then stored in the PyFITS header. If the PyFITSAdapter.clear property is False, the original contents of the PyFITS header are retained. In this case each FitsChan card replaces any existing card that refers to the same keyword (if there is no card for the keyword already in the PyFITS header, the FitsChan card will be appended to the end of the header).

The class provides a public constructor, but no public methods.

Synopsis:

Example: