aprecenter -- Recenter apertures automatically
I/O parameters and the default dispersion axis are taken from the package parameters, the default aperture parameters are taken from the task apdefault , automatic aperture finding parameters are taken from apfind , and parameters used for centering and editing the apertures are taken from apedit .
When this operation is performed from the task apall all parameters except the package parameters are included in that task.
For each image in the input image list, the aperture center positions are redefined by centering at the specified dispersion line using the center1d algorithm with centering parameters from apedit . Normally this is done when inheriting apertures from an aperture reference image. The recentering does not change the "trace" of the aperture but simple adds a shift across the dispersion axis.
There are a several recentering options. Each selected aperture may be recentered independently. However, if some or all of the spectra are relatively weak this may actually be worse than using the reference apertures defined by strong spectra or flat fields in the case of fibers or aperture masks. One may select a subset of apertures to be used in calculating shift. This is done with a the aprecenter list of aperture numbers (see ranges for the syntax) and/or by selecting a specific number or fraction of the apertures with the strongest peak values. The list selection is done first and the strongest remaining apertures are used to satisfy the npeaks value. Though some or all of the apertures may be recentered independently the most common case of recentering reference apertures is to account for detector shifts. In this case one expects that any shift should be common to all apertures. The shift parameter allows using the new centers for all selected apertures to compute a median shift to be added to ALL apertures. Using a median shift for all apertures is the default.
The find parameter allows automatically finding apertures if none are defined for the image or by a reference image. Since the purpose of this task is to recenter reference apertures it is usually the case that reference images are used and apertures are not defined by this task. One case in which the apertures from the image itself might be recentered is if one wants to use a different dispersion line. The resize parameter may be used to adjust the widths in a variety of ways based on the spectra profiles specific to each image. The aperture positions and any other parameters may also be edited with the aperture editing function if selected by the apedit parameter and the task is run interactively. The recentering algorithm may be run from the aperture editor using the g keystroke.
If the task is interactive the user is queried whether to perform various steps on each image. The queries may be answered with one of the four values "yes", "no", "YES" and "NO", where an upper case response suppresses all further queries to this question.
The aperture recentering algorithm may be selected from nearly every task in the package.
cl> aprecenter newimage reference=flat
center1d, ranges, apfind, apresize, apedit, apall