The algorithm used during the interpolation process is as follow: First, a region of blank sky BG_PIXELS wide is identified around the spectrum, using the location, size and orientation of the object on the direct image, and from the known dispersion relation of the grism (In this computation, the shape of the object is approximated by an ellipse with minor and major axes that are SZ_FACTOR times the 2nd moments of the object). Then, this region is searched for the presence of other spectra. If a pixel in that region contains information from another spectrum, it is replaced by the closest unoccupied pixel. In the end, the region that is used to estimate the background is made up of only the unoccupied pixels that surround the spectrum of interest. Figure 3.2 shows an example of how Calnic C chose this region in a complex situation. Finally, a straight line is fit to the flux values of each of the columns of this region of blank sky. This fit is then used to compute and subtract the background at each of the pixel positions of the spectrum.