Spitzer Documentation & Tools
MOPEX User's Guide

5.6.6        Mosaic Modules: MedFilter

Command Line Equivalent: run_medfilter

Default Output Directory: <output_dir>/Medfilter-mosaic

Depends On: Initial Setup; Mosaic Settings

 

PURPOSE

This module performs a background subtraction of the individual input images. It needs to run if single-frame outlier rejection or dual outlier rejection are to be used in the Mosaic pipeline (see §8.2.1; §8.2.3). There are two options: the Median case (default) and the Sbkg case, which uses a background estimate like that of SExtractor.

 

INPUT

Window X, Y: (int) the X, Y size in input pixels of the window used to compute the background value.

 

Outliers / Window: (int) the number of high outlier pixels rejected from the X*Y window when computing the Median background. For a very crowded field, the fraction of rejected pixels should be higher than for a less crowded field. Values of a few percent should be acceptable for uncrowded fields. If Outliers / Window is set too high, the background will be under-estimated.

 

SExtractor background filter size: (int) Median filter box size for the Panels when the Use SExtractor background estimation option is turned on. A value less than 2 means no filtering. If greater than the minimum number of panels across an image, it will use the minimum.

 

Use SExtractor background estimation: Checking this box invokes the Sbkg background estimate based on SExtractor. Leaving it unchecked causes MOPEX to use the default Median estimate.

 

Med Filter output subdirectory: The subdirectory of <output_dir> that you wish to use for the output files. Default is Medfilter-mosaic.

 

COMMAND LINE INPUT

&MEDFILTER

 Window_X = 45,

 Window_Y = 45,

 N_Outliers_Per_Window = 50,

 Sbkg_Filt_Size_for_Med = 1,

 Use_Sbkg_for_Med = 1,

&END

In Global Parameters:

MEDFILTER_DIR = Medfilter-mosaic

 

OUTPUT

Generated Fits Files (*_minback.fits): The background subtracted, individual images. A list of the generated images is also written out.

 

DISCUSSION

This module is required in order to do single-frame (Detect Radhit) or dual (spatial & temporal) outlier rejection (see §8.2 Outlier Detection). The background subtraction is only for the purpose of outlier rejection, and the background-subtracted images are not used for later mosaicking.

 

With the default Median option, the program computes a background value using the median of a running rectangular window of Window X by Window Y pixels, after omitting the Outliers / Window highest pixels. This is done for each pixel so can be very slow.

 

If Use SExtractor background estimation is set, the module switches to the Sbkg background estimation based on that of SExtractor (Bertin and Arnouts, AASupp 117, 393, 1996). The image is divided into Panels with size given by Window X, Y. In each Panel, iterative clipping is used to find a single estimate of the background in the Panel. You can optionally median filter the Panel background values, e.g. to avoid ones where bright objects skewed the background estimate. The median filter size is given by SExtractor background filter size. It then interpolates the Panel values to find the background at each pixel. This is much faster than calculating the median of a big window at each pixel.

 

Both background estimates generally give reasonable results, but if the data volume is large, the Sbkg option is strongly recommended, as it is much faster. It also does not require an estimate of Outliers / Window.