On the direct image, let the location of an object i be xi and yi. On the grism image, the location of corresponding spectrum is from xmin, i to xmax,i and ymin,i to ymax,i, where x is the direction of the wavelength dispersion.
xmin, i and xmax,i are computed from the position of the object xi, and the dispersion length as specified in grismspec.dat.
ymin,i and ymax,i are computed from the position of the object yi, and, for point sources from the "width" of the weight and, for extended objects, from the size of the object as determined by SExtractor.
Two objects i and j overlap if they overlap in wavelength in the sense that
![]() |
(10) |
![]() |
(11) |
The user can define three thresholds called o_thresh1 (default: 0.05), o_thresh2 (default 2) and o_thresh3 (default: 3).
Three levels of overlap are used:
Below, only case 2 is discussed.
The first step is to identify overlap between any 2 spectra. Note that a spectrum can overlap with several other spectra.
Not every wavelength in the contaminated spectrum is affected. Say, the k-th wavelength point in spectrum for object j is called Fj,k, and the l-th wavelength point in spectrum for object i is called Fi,l. Let xmax,j and xmin, i be the minimum and maximum of the x-coordinates of a spectrum i, and similarly ymax,j and ymin, i be the minimum and maximum of the y-coordinates of a spectrum i (see figure 3.4).
For the case xmin,j < xmax,i, the following points in spectrum j are contaminated: Fj,k, where k=1 ... (xmax,i-xmin,j -xi) AND the following points in spectrum i are contaminated: Fi,l, where l=(xmax,i-xmin,j -xj) ... xmax,j-xj
The case xmax,j > xmin, i can be written in an equivalent way.