KPG1_ASMRG

Merges two FrameSets by aligning them in a common Frame

Description:

This routine merges two FrameSet by aligning them in a suitable common Frame. The Current Frame in the second FrameSet becomes the Current Frame in the merged FrameSet. The domain search order for finding a suitable Frame is:

1) The domain of the Current Frame in IWCS2, if not blank. 2) " SKY" 3) " SPECTRUM" 4) " PIXEL" 5) " GRID" 6) The domain specified by argument DOMAIN, if not blank. If DOMAIN is blank, " AGI_WORLD" is used. 7) Any other suitable Frame.

For each of these Domains, the current Frame is checked first. An error is reported if alignment is not possible, and a message identifying the alignment Frame is displayed if alignment is possible.

If either FrameSet contains a second Frame with the same Domain as the alignment Frame then a warning is issued.

If the above attempt to align the Frames directly using astConvert fails, then a further attempt is made if one of the two Frames is a SpecFrame or SkyFrame, and the other Frame is a CmpFrame. In this case, the CmpFrame is searched for a Frame that can be aligned with the SkyFrame or SpecFrame. If this is succesful, the other axes in the CmpFrame are fed bad values by the Mapping which connects the two Frames.

Invocation

CALL KPG1_ASMRG( IWCS1, IWCS2, DOMAIN, QUIET, IND, STATUS )

Arguments

IWCS1 = INTEGER (Given)
An AST pointer to the first FrameSet. This is modified by adding all the Frames from IWCS2 into it. The Current Frame on exit is inherited from IWCS2.
IWCS2 = INTEGER (Given)
An AST pointer to the second FrameSet. The Current and Base Frames are unchanged on exit.
DOMAIN = CHARACTER ( ) (Given)
A comma separated list of domains in which alignment of the FrameSets should be attempted if alignment is not possible in the Current Frame of the second FrameSet, or SKY, SPECTRUM, PIXEL or GRID.
QUIET = LOGICAL (Given)
Suppress the message identifying the alignment Frame?
IND = INTEGER (Given)
The alignment message is padded with IND leading spaces.
STATUS = INTEGER (Given and Returned)
The global status.