next up previous
Next: Saving and Restoring Objects (Channels)
Up: Higher Level Operations on FrameSets
Previous: Maintaining the Integrity of FrameSets

Merging FrameSets

As well as adding individual Frames to a FrameSet ([*]), it is also possible to add complete sets of inter-related Frames which are contained within another FrameSet. This, of course, corresponds to the process of merging two FrameSets (see Figure below).


  
Figure: Two FrameSets in the process of being merged using astAddFrame. FrameSet B is being added to FrameSet A by supplying a new Mapping which inter-relates a nominated Frame in A (here number 1) and the current Frame of B. In the merged FrameSet, the Frames contributed by B will be re-numbered to become Frames 4, 5 and 6. The base Frame will remain unchanged, but the current Frame of B becomes the new current Frame. Note that FrameSet B itself is not altered by this process.
\begin{figure}
\includegraphics [scale=0.75]{sun211_figures/fsmerge.eps}

 \end{figure}

This process is performed by adding one FrameSet to another using astAddFrame, in much the same manner as when adding a new Frame to an existing FrameSet ([*]). It is simply a matter of providing a FrameSet pointer, instead of a Frame pointer, for the 4th argument. In performing the merger you must, as usual, supply a Mapping, but in this case the Mapping should relate the current Frame of the FrameSet being added to one of the Frames already present. For example, you might perform the merger shown in Figure [*] as follows:

AstMapping *mapping;

...

astAddFrame( frameseta, 1, mapping, framesetb );

The Frames acquired by ``frameseta'' from the FrameSet being added (``framesetb'') are re-numbered so that they retain their original order and follow on consecutively after the Frames that were already present, whose indices remain unchanged. The base Frame of ``frameseta'' remains unchanged, but the current Frame of ``framesetb'' becomes its new current Frame. All the inter-relationships between Frames in both FrameSets remain in place and are preserved in the merged FrameSet.

Note that while this process modifies the first FrameSet (``frameseta''), it leaves the original contents of the one being added (``framesetb'') unchanged.



next up previous
Next: Saving and Restoring Objects (Channels)
Up: Higher Level Operations on FrameSets
Previous: Maintaining the Integrity of FrameSets

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2003 Central Laboratory of the Research Councils