Trim axes from the current Frame of a FrameSet ATL_AXTRM
"
ROI"
Frame (that is,
Frames which are Regions and which have a Domain name beginning with "
ROI"
). If the
FrameSet contains zero or one ROI Frame, then only a single new Frame is added into the
FrameSet.
If the original current Frame has too few axes, the new Frame is a copy of the original current Frame with extra simple axes added to the end. These extra axes are supplied a value of AST__BAD by the Mapping which connects the original current Frame to the new current Frame.
If the original current Frame has too many axes, one or more new Frames will be created by picking the specified axes from the original current Frame. Each of these Frames is added into the FrameSet using a Mapping which has a forward transformation which simply drops the values for the unselected axes. The inverse transformation (from new to old Frame) attempts to assign usable values for the dropped axes if possible. If this is not possible, then AST__BAD is assigned to the dropped axes.
Two methods are used for finding suitable values to assign to dropped axes. The first is only possible if the value for a dropped axis can be determined uniquely from the value of one of the retained axes. This may be the case for instance in a situation where (RA,wavelength) axes were selected from the (RA,Dec,Wavelength) axes describing a 2D longslit spectrum. The missing Dec value can probably be determined from the RA value because the relationship between RA and Dec is determined by the position and orientation of the slit on the sky.
If it is not possible to determine the value for a dropped axis in this way, then a search is made for
Frames that are Regions having a Domain name beginning with "
ROI"
. If any are found, then
a new Frame is added into the FrameSet for each ROI Region found, connected to the
original current Frame via a PermMap. The values to be assigned to the dropped axes by the
inverse PermMap transformation are determined by transforming the bounding box of the
corresponding ROI Region into the original current Frame. The assigned axis values are
the mean values of the transformed bounding box on each dropped axis. The Domain
name of the corresponding ROI Region is stored in the Ident attribute of each new Frame
so that later code can identify the corresponding ROI Region, and is also appended to
the end of the Frame’
s Domain. The new Frame corresponding to the first ROI Region
found in the FrameSet is left as the current Frame on exit.
’
s length should be at least twice as large as the largest pixel
dimension implied by LBND and UBND.