Spitzer Documentation & Tools
MOPEX User's Guide

6.5.12    APEX Modules: Detect

Command Line Equivalent: run_detect

Default Output Directory: <output_dir>; <output_dir>/Coadd-apex

Depends On: Point Source Probability

Relevant Pipelines: APEX Multiframe; APEX Single Frame

 

Important notes: The user has a choice of several different input images to his module, but the choice is only partly set from within this module. The Input Type parameter gives the choice of whether to use a data or SNR image as input, but the choice of which version of these two types to use is set in the APEX Settings module using the parameters Use PSP To Detect, Use Uncertainty to Detect and Use Standard Deviation to Detect. See the Input Type and Discussion information below for a full description.

 

PURPOSE

Detect performs image segmentation and computes the centroids for the detected pixel clusters. It is another instance of the same module used for outlier detection in the Mosaic pipeline.

 

INPUT

 

Threshold Type: This parameter determines the way the image segmentation threshold is recalculated during iterative thresholding. The threshold type does not depend on the type of input image. See §8.3 for a description of the thresholding options.

 

Detection Threshold: (float) The number of sigma above the mean to be used as the initial threshold used for cluster detection.  Vary this to determine how deep the detections can go.

 

Detection Min Peak Fraction: (float) A candidate sub-peak must have a minimum height above the current threshold.  The height is given as the fraction of the “parent”  peak height.  Allowed values are between 0.0-1.0.  If not set, it is 0.0.  Vary this to limit false detections on the wings of bright sources.

 

Detection Min Area: (int) The minimum area (pixel) for a detected pixel cluster to be retained; smaller clusters are discarded.

 

Detection Max Area: (int) The maximum area (pixels) of a detected pixel cluster before iterative thresholding.

 

Extended Object Area: (int) The minimum area (pixels) to be considered an extended object. If the number of pixels in a cluster is larger than this area, it is not split by Threshold Type = “Peak".

 

Input Type: Determines the type of image to be used as the input for detect. The first choice is between an "snr" image (SNR Input) or an image based on the original data (Image Input).  Which image within these 2 types depends on the Use PSP to Detect setting in the initial Apex settings.   See the Table below. 

 

If Input Type is chosen to be “snr_input”, then the Gaussnoise module is run on the input to Detect (e.g. the PSP image) to create the new SNR image.  In that case, the Window and Outlier parameters of Gaussnoise can be set.

 

Window X: (int) The X size in pixels of the window used to compute the median of the background. The default value is 45.

 

Window Y: (int) The Y size in pixels of the window used to compute the median of the background. The default value is 45.

 

N Outliers Per Window: (int) The number of outlier pixels (N) being rejected from the X*Y window when computing the noise.

 

Output Type: Centroids only output is the normal choice.  Centroids and pixels output allows a complete table (see below).

 

Minimum Coverage: (float) The minimum value in the coverage map needed for a pixel to be considered for segmentation.

 

Neighbor Type:  Defines what an adjacent pixel means.  “Sides only” is the normal choice.

 

Peaks Radius: (int)  Radius in pixels that a pixel must be the maximum in order to be defined as a peak.  1 is the normal choice.

 

Max Segmentation Level: (int)  Maximum number of segmentation passes.  50 is the normal choice.

 

N Edge: (int) 0 is the normal choice.

 

Probability Threshold: (float) 0.0 is the normal choice.

 

Additional output files: See “Output”.

 

 

 

 

COMMAND LINE INPUT

&DETECT

 Input_Type = 'image_input',

 Output_Type = "centroids_only_output",

 Detection_Max_Area = 5,

 Detection_Min_Area = 2,

 Detection_Threshold = 10,

 Threshold_Type = 'combo',

 Extended_Object_Area = 500,

 Minimum_Coverage = 1.8,

 Complete_Table_Out_Filename = "completeout.tbl",

&END

 

if Input_Type = "snr_input" then you must also include the following parameter block. N_Outliers_Per_Window must be set to 0:

&PSP_GAUSSNOISE

 Window_X = 45,

 Window_Y = 45,

 N_Outliers_Per_Window = 0,

&END

 

OUTPUT

Table (mosaic_detect.tbl): In Single Frame mode there is one detection list produced in this step. In Multiframe mode, the detection is performed for each co-added tile. The detection lists for each tile (i.e. each spatial area) are merged into one detection list for the full area.

 

For each source, the output table of detected sources lists:

 

·      the source ID

·      the position (X, Y in pixels)

·      a rough "flux" estimate (the peak pixel value, in the same units as the input image),

·      BlendId: keeps track of the sequential number of a detection blend in the table.

·      BlendSize: gives the number of detections in the blend.

 

Additional Output Images: Other images can be output if specified: Complete table (has all detected pixels), FITS Output (image of highest detected pixels), Mask Output (image with all detected pixels marked with highest segmentation level), Peaks Image (image with peak pixels set to 1), Number Cluster Image (pixels above last threshold marked with cluster number).

 

Detection Image: The image used for detection (input or SNR, for example) can be displayed.

 

DISCUSSION

The Detect module performs image segmentation and computes the centroids for the detected pixel clusters. Detected sources are written to two identical tables (mosaic_detect.tbl and mosaic_detect_raw.tbl). The output table may be filtered on certain criteria using the Select Detect module, in which case the "raw" table is retained and other is overwritten.

 

Input Image Type: The input to this module depends on the Detect parameter Input Type and the APEX Settings parameters Use PSP to Detect. In addition, the APEX Settings parameters Use Uncertainty to Detect and Use Standard Deviation to Detect affect the output of the Point Source Probability module, and therefore the type of PSP image that is used as input into this module. The table below gives the type of image that will be used for segmentation. The "Filtered" image mentioned in the table is defined as the product of the PSF image times the background subtracted image (see §6.5.9 APEX Modules: Point Source Probability for more information).

 

Table 6.1: Resultant input image to module Detect depending on the values of Use PSP to Detect and Input Type.

Use PSP to Detect

Input Type

Resultant Input Image

Background subtracted input image (= 2 on the command line)

SNR input

SNR image based on the background subtracted input image

Background subtracted input image (= 2 on the command line)

Image input

Background subtracted input image

PSP image (= 1 on the command line; default)

SNR input

SNR image based on the Point Source Probability image

PSP image (= 1 on the command line; default)

Image input

Point Source Probability image

Filtered image (= 0 on the command line)

SNR input

SNR image based on the Filtered image

Filtered image (= 0 on the command line)

Image input

Filtered image

Input image w/o background subtraction (= -1 on the command line; Single Frame only)

SNR input

SNR image based on the input image without background subtraction

Input image w/o background subtraction (= -1 on the command line; Single Frame only)

Image input

The input image without background subtraction

 

 

Output Format: Below is an example of the output table from APEX Single Frame:

 

\char comment = Output from DETECT, version 1.00

srcid|     x|       y|       flux| BlendId| BlendSize|

| i  |     r|       r|       r   | i      | i        |

    0   2.50   229.50   1.328e+03        0          0

    1   3.30    77.50   1.369e+03        0          0

    2   3.40   190.55   1.338e+03        1          2

    3   4.82   190.24   1.435e+03        1          2

    4   4.50   111.50   1.332e+03        0          0

    5   8.40   205.00   1.275e+04        2          3

    6   5.50   205.00   1.330e+03        2          3

    7   6.38   206.70   1.853e+03        2          3

    8   5.50   127.50   1.328e+03        0          0