SSC Home Page

MOPEX Online Manual


SPITZER HOME - SPITZER SCIENCE - INSTRUMENTS - SCIENCE USER SUPPORT - SEARCH

APEX Modules: Extract MedFilter

Namelist Trigger: run_extract_medfilter
Output Directory Keyword: MEDFILTER_DIR
Default Output Directory: <output_dir>/Medfilter
Depends on: Detect


PURPOSE

    This module is an instance of the same Med Filter that is run during outlier rejection in the Mosaic pipeline, and earlier in the APEX pipeline (before source detection). In this case, it performs the background subtraction of the image(s) that will be used for source extraction. In apex.pl, those are the individual input images, and in apex_1frame.pl it is the mosaic image. There are two options, the Median case (default) and the Sbkg case, which uses a background estimate like that of SExtractor.

PARAMETER BLOCK

    &EXTRACT_MEDFILTER
     Window_X = 45,
     Window_Y = 45,
     N_Outliers_Per_Window = 50,
     Min_Good_Pixels_In_Window = 9,
     Min_GoodNeighbors_Number = 4,
     Max_Bad_Pixels_OutputImage = 100,
    &END

INPUTS

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

    Outliers per Window: (int) the number of high outlier pixels (N_Outliers_Per_Window in namelists) 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 N_Outliers_Per_Window is set too high, the background will be under-estimated.

    Use SExtractor background estimation: (int) A value of 1 invokes the Sbkg background estimate based on SExtractor. Any other value gives the default Median estimate. (This is Use_Sbkg_for_Med in namelists. Be sure to get the spelling right.)

    SExtractor background filter size: (int) Median filter box size for the Panels when this option is set. A value less than 2 means no filtering. If greater than the minimum number of panels across an image, it will use the minimum. (This is Sbkg_Filt_Size_for_Med in namelists.)

    NOTE: The following parameters should generally not need to adjusted. The first two are adjustable in the GUI.

    Min Good Pixels in Window: (int) The minimum number of good (non-NaN, non-masked) pixels needed to compute the median. If insufficient good pixels are present, the background is recorded as "missing" and the "missing" output pixel is replaced by interpolation of its neighbors if possible. (This is Min_Good_Pixels_In_Window in namelists.)

    Min Good Neighbors Number: (int) The minimum number of good neighbor pixels needed to perform the replacement of "missing" output pixels. (This is Min_GoodNeighbors_Number in namelists.)


OUTPUTS

    Generated FITS (*_Image_minback.fits in multiframe or mosaic_minus_median_detect.fits in single frame): The output is the background subtracted mosaic image (or individual images). These are in the main output directory, but in multiframe mode they are stored in the Medfilter subdirectory.

DISCUSSION

This module is run on the extraction images. In APEX single frame, this is the input image. In APEX multiframe, the mosaic may be a single image produced during the APEX pipeline, or it may be the several Tiles produced by Mosaic Coadd.

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 N_Outliers_Per_Window highest pixels. This is done for each pixel so can be very slow.

If Use SExtractor background estimation (Use_Sbkg_for_Med in namelists) 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 (Sbkg_Filt_Size_for_Med in namelists). 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 N_Outliers_Per_Window.

There is a minimum required number of good (not-NAN and not marked by any mask) pixels per median window Min_Good_Pixels_In_Window. If the number of good pixels is below this threshold then the corresponding pixel in the output image is marked as a "missing" pixel. When the median calculation is finished, the values of the marked pixels are interpolated from the neighboring pixels for which the median has been found. In order to do so the program scans around the pixel in question and accumulates values of good pixels. When the number of accumulated values reaches or exceeds the minimum number given by the input parameter Min_GoodNeighbors_Number the program finds the average and stores this value as the median for the pixel in question.





SPITZER HOME - SPITZER SCIENCE - INSTRUMENTS - SCIENCE USER SUPPORT - SEARCH

Contact us
This file was last modified on Wed Aug 13 16:27:16 2008.
California Institute of Technology Jet Propulsion Laboratory NASA