Spitzer Documentation & Tools
MOPEX User's Guide

2.5            Which Modules Should I Choose?

When running MOPEX, each data reduction step should be tailored to the dataset. Users do this by selecting certain modules to run, and setting the input parameters for those modules. The number of modules and parameters in MOPEX can be a little daunting, so here we give a short introduction to the most-used modules. Detailed descriptions of the modules can be found later in the manual.

 

First-time users should start with the template namelists found in the File Menu, rather than trying to build up the namelist in an empty pipeline. These templates are intended only as guides, and will need fine-tuning for use with your data. With experience, you will be able to include or exclude modules as needed and tune the input parameters for specific purposes. MOPEX typically saves the results from each module in <output_dir>. These intermediate results can be examined to evaluate the performance at each step.

 

For data reduction walk-throughs, including more advice on options to use with different data sets, see the Spitzer Data Analysis Cookbook. We stress that these are not exhaustive, and are continually being developed.

2.5.1         Overlap (overlap.pl)

The Overlap pipeline (run on the command line with the script overlap.pl) performs background matching (§8.5) on the input images, and is fully described in Chapter 4. It does not set the background level to zero, rather it adds (or subtracts) a constant to bring it to an average level. This process is recommended for Spitzer data, as there can be variation in the sky level that will lead to a patchy-looking final mosaic if not corrected, but this step may not be necessary if the BCDs downloaded from the Spitzer archive have already been background-subtracted, e.g. by MOPEX’s “Median” filtering.

 

The modules required for Overlap are:

 

  • Fiducial Image Frame (unless the file FIF.tbl already exists; §4.3.4)
  • Mosaic Interpolate (§4.3.7)
  • Compute Overlap Correction (§4.3.8)

 

If there are bright objects in the field that could affect the estimate of the background level, MedFilter (§4.3.5) and Detect (§4.3.6) should be added and the Mask Bright Objects option in the Mosaic Interpolate module should be checked. Together, these will detect and ignore bright objects when calculating background levels.

 

Make sure to check the "Apply Overlap Correction" box in the Overlap Correction module to apply the correction to your input images. Overlap-corrected images can be used as the input to the Mosaic pipeline.

2.5.2        Mosaic (mosaic.pl)

The Mosaic pipeline (Chapter 5) has the largest number of modules to choose from, due to the many outlier detection options. While some outliers are flagged during the Spitzer pipeline processing (that produced the BCDs that you download from the archive), further rejection is recommended.

 

The basic mosaicking modules that you need, not including outlier rejection, are:

 

  • Fiducial Image Frame (§5.6.4)
  • Mosaic Interpolate (§5.6.8)
  • Mosaic CoAdder (§5.6.19)
  • Mosaic Combine (§5.6.20)

 

If any outlier rejection is employed, MOPEX will create a new status mask, the RMask, and use it to reinterpolate the rejected pixels. To use the RMask capability, you will need to add at least the following modules, plus the modules specific to the chosen outlier rejection scheme (see following discussion):

 

  • Mosaic Coverage (§5.6.11)
  • Mosaic RMask (§5.6.16)
  • Mosaic Reinterpolate (§5.6.17)

 

Choosing the right kind of outlier rejection (§8.2) also requires some care. Rejection schemes utilize either temporal information (rejecting sources that do not appear at the same coordinates in every frame) or spatial information (rejecting outliers based on their shape or size), or both. In the case of good coverage per pixel (about 10 or more BCDs per pixel on the sky), multiframe temporal outlier rejection (§8.2.2) can be a good choice. To add multiframe temporal outlier rejection, use the Mosaic Outlier module (§5.6.14). When using multiframe temporal outlier rejection, be careful when setting the rejection thresholds. A three-sigma rejection is often too low if the coverage is very high (50 or more). If only shallow coverage is available, then either the box outlier rejection (§8.2.4)  (include module Mosaic Box Outlier, §5.6.15) or dual spatial-temporal outlier rejection (§8.2.3) are preferred. Dual outlier rejection requires the following modules:

 

  • MedFilter (§5.6.6)
  • Detect (§5.6.9)
  • Mosaic Projection (§5.6.10)
  • Mosaic Dual Outlier (§5.6.12)
  • Level (§5.6.13)

 

Multiple outlier rejection methods can be employed, and all can be set to contribute to the RMask by setting the RMask Fatal Bit Pattern (see §8.11: Fatal Mask Bit Patterns). The Mosaic RMask module (§5.6.16) can also use the dual outlier rejection results as a check on the temporal outlier identifications (the Refine Outlier option). This combination can be useful to prevent the false identification of temporal outliers inside bright sources.

 

The Mosaic pipeline can produce a number of final outputs. The most basic output files that you will need are the mosaic and its coverage map and uncertainty file (mosaic.fits, mosaic_cov.fits, and mosaic_unc.fits). For more options, see §5.5 “Mosaic Pipeline Stages.”

2.5.3        APEX Single Frame (apex_1frame.pl)

Source extraction can be performed on the mosaic image using APEX Single Frame mode (Chapter 6). This takes a single image (together with an optional coverage map and optional uncertainty file) as input. It can be used independently or as a follow-on to the Mosaic pipeline.

 

A typical APEX Single Frame task might include background subtraction, noise estimation, non-linear filtering, point source detection, point source fitting and flux estimation, and aperture photometry. These are carried out by the following modules:

 

  • Detect MedFilter (§6.5.8)
  • Point Source Probability (§6.5.9)
  • Gaussnoise  (§6.5.10)
  • Detect (§6.5.12)
  • Extract MedFilter (§6.5.14)
  • Source Estimate (§6.5.18)
  • Aperture Photometry (§6.5.19)

 

A commonly used but optional task is Fit Radius. If an uncertainty image is available, the Fit Radius module can be run to define the fitting area based on source brightness above the noise. Setting the Fitting Area X,Y parameters in the Source Estimate block is the other method (and this will override the use of the Fit Radius results).

 

The output of APEX is the table of extracted sources (extract.tbl), which gives the position and flux for each object. Compared to the Mosaic pipeline, there are fewer module choices in APEX Single Frame, so it is a little easier to use.

2.5.4        APEX Multiframe (apex.pl)

Source extraction can also be performed in Multiframe mode. In this case, sources are detected in the mosaic but PRF-fitting (§8.6) is performed on the individual BCDs (after geometric distortion correction); aperture photometry is still performed on the mosaic. APEX Multiframe uses all of the same modules as the single frame mode, but can also optionally create the mosaic as well, by including the following modules:

 

  • Fiducial Image Frame (§6.5.5)
  • Mosaic Interpolate (§6.5.6)
  • Mosaic CoAdder (§6.5.7)
  • Mosaic Combine (§6.5.13)

 

The downside to having APEX create the mosaic is that it cannot do outlier rejection. Most users prefer to make their own mosaic beforehand with the Mosaic pipeline. To use the Mosaic output as the input into APEX, you need to insert the APEX Multiframe pipeline into the flow, and turn off the four modules listed above. APEX will automatically pick up the files it needs from the Mosaic output directories.

2.5.5        APEX User List (apex_user_list.pl; apex_user_list_1frame.pl)

APEX User List (§6.1.3; §6.1.4) gives users the option to extract a specified list of sources, rather than extracting all sources that were detected in the image(s). The sources are input as an ASCII list of positions in either RA and Dec, or pixel coordinates, and there is the option to either allow centroiding of the source positions during the source extraction (both PRF fitting and aperture photometry), or to fix the positions (aperture extraction only). MOPEX also enables interactive selection of sources within the GUI window, using a point-and-click interface. Source extraction is performed in exactly the same way as for APEX Multiframe and APEX Single Frame, using the user-supplied list of sources as input instead of the source list generated by the Detect module. If you are running Single Frame mode, you only require the following:

 

  • Extract MedFilter (§6.5.14)
  • Source Estimate or Aperture Photometry (§6.5.18 ; §6.5.19).

 

If you are running Multiframe mode and creating your own mosaic, you will need the following (but see previous section for the advantage of using the results of Mosaic as input to APEX Multiframe):

 

  • Fiducial Image Frame (§6.5.5)
  • Mosaic Interpolate (§6.5.6)
  • Mosaic CoAdder (§6.5.7)
  • Mosaic Combiner (§6.5.13)
  • Extract MedFilter (§6.5.14)
  • Detection Map (§6.5.17)
  • Source Estimate or Aperture Photometry (§6.5.18 ; §6.5.19).

 

2.5.6        APEX QA: Residual Image Creation (apex_qa.pl)

The APEX Quality Assurance (APEX QA) pipeline (§6.1.6) performs subtraction of the detected point sources from the input data and produces a residual image mosaic.

 

In Single Frame mode, the PRF is subtracted from the input images or mosaic, depending on whether it is being run in conjunction with APEX Multiframe or APEX Single Frame. Subtraction is performed by the Point Source Image module. In Multiframe mode, APEX QA can create a new mosaic from the individual residual images using the Mosaic Interpolate, Mosaic CoAdder, and Mosaic Combiner modules. There is only one module required for APEX QA, although its name on the command line changes depending on whether it is being run in Multiframe or Single Frame mode:

 

  • (Mosaic) Point Source Image (§6.6.4)

2.5.7        PRF Estimate (prf_estimate.pl)

PRF Estimate (Chapter 7) allows users to create a Point Response Function (PRF) from their own data. However, it is not designed to work for severely undersampled data, such as IRAC channels 1 or 2. So PRFs are made available for use with IRAC data. The following modules are required:

 

  • MedFilter (§7.5.3)
  • Crop Stack (§7.5.4)
  • PRF Estimate (§7.5.6)

 

You may also choose to generate a PRF Map, thereby creating a different PRF for different areas on the array. To do this you should also include the Split By Array Position module (§7.5.5).