Return to Post-BCD pages
 
Manual Contents
 
Getting Started
 
Input Files
 
Background Matching (overlap.pl)
 
Mosaicking (mosaic.pl)
 
Point Source Extraction (apex*.pl)
 
Basic Concepts
 
Appendix 1: Full List of MOPEX Scripts
 
Appendix 2: Fatal Bit Patterns
 
Appendix 3: Full Lit of MOPEX Modules

Basic Concepts: Image Interpolation

The image interpolation module performs a projection of input images onto the Fiducial Image Frame (FIF) and an interpolation of the input pixel values to the output array of pixels of the user-defined pixel size. It corrects for the optical distortion in the input images. The process is intended to, but not restricted to, accept images measuring surface brightness and to yield images in the same units.

The FIF defines the sky position, orientation, and the size of the mosaic. The final mosaic pixel size is set in the Mosaic namelist options. Four interpolation schemes are implemented. The first two schemes use the same area overlap method, but they differ in the way the projection is done. The third scheme is an approximation of the area overlap, it is called the grid interpolation. The fourth scheme is the bicubic interpolation, which is a common technique used in image processing.

Whatever interpolation scheme is used for the input images, the uncertainty images are interpolated in an identical fashion. A coverage map is created for each interpolated image. For each output pixel the coverage map gives the fraction of the pixel covered by the input image. It reflects the presence of any input bad pixels or pixels on the edge of the input image.

In general, a projection onto the reference frame of an input image with optical distortions will not be a simple rectangle. Each interpolated image occupies a part of the FIF and is, in general, of different size with different offsets from the origin of the FIF. The interpolated images' offsets in x- and y- directions relative to the FIF, and their sizes (in intergral numbers of pixels) are given in the file interpolated_images.tbl, and also written in the headers of the interpolated images in the keywords MINTOFFX and MINTOFFY.

For maximum speed of operation, a special set of routines have been developed that allow direct plane-to-plane coordinate transformations that bypass computing the sky coordinates. For details, see the document Fast Direct Plane-to-Plane Coordinate Transformations (PASP Journal article).


Pixel Overlap Integration (FINERES)

The value Oj of an output interpolated pixel j is equal to the weighted average of the input pixels Ii overlapping the output pixel. It is weighted with the relative overlap areas as follows (Eq. 1):

Here aij is the area of the overlap of output pixel j with input pixel i.

For this scheme (see Figure 1), each output pixel is projected onto the input image frame and the flux from all the input pixels overlapping the output pixels is integrated and then normalized by the output pixel area to yield the result in the units of surface brightness.


Figure 1: This figure shows the calculation of the weighted sum of the input image pixels (red, regular grid) overlapping the interpolated output image pixel (blue, thick line).


If the FINERES keyword is specified in the namelist (see Mosaic Namelist Options), an additional bilinear interpolation of the input pixels is performed before projecting onto the output grid. A grid of fineres pixels with the size defined as Input_Pixel_Size/FINERES is introduced. In Figure 2 the input pixels are shown in black, the intermediate fineres pixels are shown in blue. The value of an fineres pixel is a linear interpolation of the four closest input pixels, with the interpolation coefficients being the relative overlap area of the pixel the same size as the input pixels and centered around the fineres pixel. i.e. the valued FP of shaded fineres pixel in Figure 2 value is equal to

FP = A7*IP7+ A8*IP8+ A4*IP4+ A5*IP5

where IPi is the value of input pixel i, and Ai is the overlap area of pixel i with the pixel (blue fat lines) centered around the shaded pixel and of the size of the input pixels. The output pixels are then computed using the pixel overlap interpolation scheme with the fineres pixels used as the input pixels.


Figure 2: FINERES = 4. The coordinates of the shaded pixel are j = 2, k = 2.



Pixel Overlap Distribution (DRIZZLE)

The output pixels values are computed using Eq.1, just like in the previous scheme. The difference is that for this scheme (see Figure 3) the input pixels are projected onto the output frame. The flux of an input pixel gets distributed among the output pixels it overlaps.

Each input pixel is shrunk by the factor DRIZ_FAC set in the namelist. The values of the shrunken pixels are equal to the values of the original pixels. The shrunken pixels are projected onto the output image frame. This would be extremely hard to implement using scheme one, since then the overlap with the non-contiguous array of pixels would have to be computed (see Figure 4). On the other hand scheme one has been shown to be faster by ~25% than scheme two in the case of no drizzle, DRIZ_FAC = 1.

Note: When using the Drizzle option, several of the mosaicking steps are run twice. Firstly, a linear interpolation is carried out so MOPEX can run the outlier rejection scheme. Once the outlier rejection masks (RMasks) have been created, MOPEX returns to the Mosaic Interpolate module and re-runs the interpolation with the Drizzle algorithm, masking out any pixels flagged in the RMasks. When using this option, do not include the Mosaic Reinterpolate Module in the processing flow


Figure 3: This figure shows the calculation of the weighted contributions of the input image pixel (red, thick line) to the overlapping interpolated output image pixels (blue, regular grid). The area of each output pixel in the output coordinate system is constant.


Figure 4: Input pixels are shown in black. The drizzle pixels, shown in red, are projected onto the output array of pixels shown in blue.


QUICK-LOOK: Grid Distribution

As a fast alternative of the area overlap method the grid interpolation is implemented. Each input pixel is filled with GRID_RATIO squared grid points (see Figure 5). Each grid point is assigned the value of the pixel it belongs to. Each grid point is projected onto the output frame and the flux associated with the grid point is added to the output image pixel into which the grid point was projected. The value Oj of an output interpolated pixel j is equal to the weighted average of the input pixels Ii

where nij is the number of the grid points projected into the output pixel j from the input pixel i. The parameter GRID_RATIO specifies the number of grid points in one direction in an input pixel. In other words there are GRID_RATIO squared grid points per input pixel. If GRID_RATIO = 1 and the input to output pixel size ratio PR = 1, the method is equivalent to the nearest-neighbor interpolation. In the limit of infinite GRID_RATIO the method approaches the area overlap interpolation. The main purpose of this scheme is to create first-look mosaic images fast, the gain in speed being up to 10 times as fast as scheme one. The price you pay is the fidelity of the interpolated images.



Figure 5: Input pixel (red) is filled with a grid of points. When the input pixel is projected onto the output array (blue) each point contribute an equal share of the input pixel value to the output pixel it is in.


Bicubic Interpolation

For the bicubic interpolation the value O(j) of the output pixel j is computed as a linear combination of the input pixel values

at the 16 positions i closest to j. The coefficients C(j,i) depend on the distance between the points:


The coefficients akl are derived by imposing the following constraints h(0) = 1; h(1)=h(2) = 0; h'(1) and h'(2) are continuous. These constraints yield seven equations for eight unknown coefficients. By allowing a31= α the tunable parameter the system can be solved and the results are shown in the Table. The parameter α is set in the interpolation module, with the default value equal to -0.5.



i a31 a21 a11 a01
0 α+2 -(α+3) 0 1
1 α -5α -8α -4α




SPITZER HOME || SPITZER SCIENCE || INSTRUMENTS || SCIENCE USER SUPPORT || SEARCH

help@spitzer.caltech.edu

This file was last modified on Tue Jun 10 17:37:40 PDT 2008.

California Institute of Technology Jet Propulsion Laboratory NASA