The Andromeda galaxy, M31 , covers over 5 deg^2 of sky (optically), making it one the largest galaxy encountered by 2MASS (excepting the LMC/SMC). It spans several 2MASS scan strips, and hence cross-scan background removal is critical to successful mosaic construction -- as is the case for most nearby galaxies. The following images show the intermediate steps in the H-band background removal (the H-band is the most difficult case owing to the strong "airglow" emission features in the images).
Step 1. Retrieve Atlas images from database. Retrieve table of "stars" local to the target, also from the database.
Step 2. Place Atlas images on a common grid, subtract the mean background sky value from each Atlas image. Scale fluxes to adhere to a common zero-point calibration scale.
Step 3. Apply offset adjustment to coadd-to-coadd boundaries (common to each scan) when needed. This step is necessary to eliminate artificial "steps" between coadds within a scan. Continue this process one scan at a time. Here is an example of one scan with the galaxy masked:
Step 6. For each pixel of each column, derive the background solution using a cubic polynomial applied with the corresponding in-scan scale-length.
Step 7. Subtract column solution from initial construction.
Step 8. Using the residual image, determine the row (cross-scan) solution for each pixel using a cubic polynomial applied with the corresponding cross-scan scale-length.