apscatter input output
There are two additional parameter sets which define the parameters used for fitting the scattered light across the dispersion and along the dispersion. The default parameter sets are apscat1 and apscat2. The parameters may be examined and edited by either typing their names or by typing ":e" when editing the main parameter set with eparam and with the cursor pointing at the appropriate parameter set name. These parameters are used by the ICFIT package and a further description may be found there.
I/O parameters and the default dispersion axis are taken from the package parameters, the default aperture parameters from apdefault, automatic aperture finding parameters from apfind, recentering parameters from aprecenter, resizing parameters from apresize, parameters used for centering and editing the apertures from apedit, and tracing parameters from aptrace.
The scattered light outside the apertures defining the two dimensional spectra is extracted, smoothed, and subtracted from each input image. The approach is to first select the pixels outside the defined apertures and outside a buffer distance from the edge of any aperture at each point along the dispersion independently. A one dimensional function is fit using the icfit package. This fitting uses an iterative algorithm to further reject high values and thus fit the minima between the spectra. (This even works reasonably well if no apertures are defined). Because each fit is done independently the scattered light thus determined will not be smooth along the dispersion. If desired each line along the dispersion in the scattered light surface may then be smoothed by again fitting a one dimensional function using the icfit package. The final scattered light surface is then subtracted from the input image to form the output image. The scattered light surface may be output if desired.
The reason for using two one dimensional fits as opposed to a surface fit is that the actual shape of the scattered light is often not easily modeled by a simple two dimensional function. Also the one dimensional function fitting offers more flexibility in defining functions and options as provided by the icfit package.
The organization of the task is like the other tasks in the package which has options for defining apertures using a reference image, defining apertures through an automatic finding algorithm (see apfind), automatically recentering or resizing the apertures (see aprecenter and apresize), interactively editing the apertures (see apedit), and tracing the positions of the spectra as a function of dispersion position (see aptrace). Though unlikely, the actual scattered light subtraction operation may be suppressed when the parameter subtract is no. If the scattered light determination and fitting is done interactively (the interactive parameter set to yes) then the user is queried whether or not to do the fitting and subtraction for each image. The responses are "yes", "no", "YES", or "NO", where the the upper case queries suppress this query for the following images. When the task is interactive there are further queries for each step of the operation which may also be answered both individually or collectively for all other input images using the four responses.
When the scattered light operation is done interactively the user may set the fitting parameters for the scattered light functions both across and along the dispersion interactively. Initially the central line or column is used but after exiting (with 'q') a prompt is given for selecting additional lines or columns and for changing the buffer distance. Note that the point of the interactive stage is to set the fitting parameters. When the entire image is finally fit the last set of fitting parameters are used for all lines or columns.
The default fitting parameters are organized as separate parameter sets called apscat1 for the first fits across the dispersion and apscat2 for the second smoothing fits along the dispersion. Changes to these parameters made interactively during execution of this task are updated in the parameter sets. The general idea for these parameters is that when fitting the pixels from between the apertures the iteration and rejection thresholds are set to eliminate high values while for smoothing along the dispersion a simple smooth function is all that is required.
1. To subtract the scattered light from a set of images to form a new set of images:
cl> apscatter raw* %raw%new%*
This example uses a substitution in the names from raw to new. By default this would be done interactively
2. To subtract the scattered light in place and save the scattered light images:
cl> apscatter im* "" scatter="s//im*" ref=im1 interact-
The prefix s is added to the original names for the scattered light. This operation is done noninteractively using a reference spectrum to define the apertures.
apfind, aprecenter, apresize, apedit, aptrace, apsum, apmask, icfit,