Spitzer Documentation & Tools
MOPEX User's Guide

 


Appendix B.                    Full List of Modules in MOPEX

 

The following tables contain a full list of all of the modules available in MOPEX, with their namelist triggers, a brief description, and the prerequisites for each module. The modules are organised in the order that you might encounter them in the MOPEX scripts.

B.1    Overlap Modules

Module Name

Namelist Trigger

Brief Description

Module Prerequisites

Initial Setup

N/A

Set up the input files. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

Overlap Settings

N/A

Sets up the pipeline-specific global input parameters. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

S/N Estimator

compute_uncertainties_internally

Internally estimates the uncertainty for each pixel in the image when no independent uncertainty estimate is available. Only use if you do not trust the uncertainty images provided with your Spitzer data download.

Initial Setup,

Overlap Settings

MedFilter

run_medfilter

Performs background subtraction of the individual images. Only required if you intend to use Bright Object Masking

Initial Setup,

Overlap Settings

Fiducial Image Frame

run_fiducial_image_frame

Creates the unified grid coordinate system and defines the spatial boundaries that will include all of the input data frames (the FIF table).

Initial Setup,

Overlap Settings

Detect (Outlier)

run_detect_outlier

Performs image segmentation and produces detection maps of bright objects. This identifies bright pixels that should not contribute to the background matching calculation.

Initial Setup,

Overlap Settings

Mosaic Interpolate

run_mosaic_int

Performs a projection of input images onto a 2D plane defined by the FIF table and interpolates the input pixels to the output array. Also corrects for optical distortion in the input images.

Fiducial Image Frame; S/N Estimator (if S/N Estimator is turned on).

Compute Overlap Correction

compute-overlap-correction

Computes the correction needed to set the background of all overlapping images to a constant value. Optionally applies this correction to the input images.

Mosaic Interpolate

Quicklook Mosaic

mosaic-corrected-images

Creates a quick and dirty mosaic of the background-corrected images to check the results of the overlap correction.

Mosaic Interpolate

B.2    Mosaic Modules

Module Name

Namelist Trigger

Brief Description

Module Prerequisites

Initial Setup

N/A

Set up the input files. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

Mosaic Settings

N/A

Sets up the pipeline-specific global input parameters. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

S/N Estimator

compute_uncertainties_internally

Internally estimates the uncertainty for each pixel in the image when no independent uncertainty estimate is available. Only use if you do not trust the uncertainty images provided with your data download.

Initial Setup,

Mosaic Settings

MedFilter

run_medfilter

Performs background subtraction of the individual images. Only required if you intend to use Single Frame or Dual Outlier detection.

Initial Setup,

Mosaic Settings

Detect RadHit

run_detect_radhit

Performs single frame radhit rejection. It is the simplest of the outlier rejection schemes.

Initial Setup,

Mosaic Settings

Fiducial Image Frame

run_fiducial_image_frame

Creates the unified grid coordinate system and defines the spatial boundaries that will include all of the input data frames (the FIF table).

Initial Setup,

Mosaic Settings

Mosaic Geometry

run_mosaic_geom

Finds all of the input images that overlap with the FIF table, allowing the user to make a mosaic of a subset of the input data frames.

None, but requires a hand-edited version of the Fiducial Image Frame table.

Mosaic Interpolate

run_mosaic_int

Performs a projection of input images onto a 2D plane defined by the FIF table and interpolates the input pixels to the output array. Also corrects for optical distortion in the input images.

Uses the output from S/N Estimator (but only if S/N Estimator is turned on).

Detect (Outlier)

run_detect_outlier

First of four modules run as part of dual outlier detection. Performs image segmentation and produces detection maps of point sources and radhits.

None

Mosaic Projection

run_mosaic_proj

Second of four modules run as part of dual outlier detection. Projects the detection maps from Detect (Outlier) onto a common reference frame, and interpolates.

Detect (Outlier)

Mosaic Coverage

run_mosaic_covg

Produces a preliminary coverage map covering the whole FIF for use in the later module Mosaic RMask.

Mosaic Interpolate

Mosaic Dual Outlier

run_mosaic_dual_outlier

Third of four modules run as part of dual outlier detection. Applies the user-defined criteria to classify outliers using both spatial and temporal information.

Mosaic Projection

Level

run_level

Last of four modules run as part of dual outlier detection. Corrects the dual outlier maps produced in Mosaic Dual Outlier to ensure that the edges of point sources are not accidentally rejected

Mosaic Dual Outlier

Mosaic Outlier

run_mosaic_outlier

Runs the multiframe outlier rejection method to flag bad pixels.

Mosaic Interpolate

Mosaic Box Outlier

run_mosaic_box_outlier

Runs the Box Outlier rejection method to flag bad pixels.

Mosaic Interpolate

Mosaic RMask

run_mosaic_rmask

Combines outlier rejection information into a single RMask: bit 0 (single frame radhit detection), bit 1 (multiframe temporal outlier detection), bit 2 (dual outlier detection), bit 3 (box outlier detection)

Mosaic Outlier, Level, Mosaic Coverage

Mosaic Reinterpolate

run_mosaic_reinterp

Re-runs the interpolation, this time including information from the RMasks. Only pixels flagged by the RMasks are reinterpolated.

Mosaic Interpolate, Mosaic RMask

Fix Coverage

run_fix_coverage

After all outlier pixels have been identified, this module gives the option to suppress the use of pixels that have very small coverage (repeated observations at the same point on the sky). Pixels whose usage is suppressed have their coverage set to 0 in new coverage maps.

Mosaic Interpolate (Mosaic Reinterpolate)

Mosaic Coadder

run_mosaic_coadder

Co-adds the interpolated images to create one mosaic image. Co-addition can be performed on Tiles to address computer memory considerations. Several co-addition schemes are available.

Mosaic Interpolate (Mosaic Reinterpolate)

Mosaic Combiner

run_mosaic_combiner

Combines the co-added tiles into a single mosaicked image. This module must be run, even when there is only one tile, in order to create the expected output files.

Mosaic Coadder

Mosaic Medfilter

run_mosaic_medfilter

Performs median background subtraction of the mosaic image.

Mosaic Combine

 

B.3    APEX (User List) and APEX (User List) 1Frame Modules

Module Name

Namelist Trigger

Brief Description

Module Prerequisites

Initial Setup

N/A

Set up the input files. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

APEX Settings

N/A

Sets up the pipeline-specific global input parameters. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

Fiducial Image Frame

run_fiducial_image_frame

Creates the unified grid coordinate system and defines the spatial boundaries that will include all of the input data frames (the FIF table).

Initial Setup,

APEX Settings

Mosaic Interpolate

run_mosaic_int

Performs a projection of input images onto a 2D plane defined by the FIF table and interpolates the input pixels to the output array. Also corrects for optical distortion in the input images. Only required if you are not using the results from the Mosaic processing.

Fiducial Image Frame

Mosaic Coadder

run_mosaic_coadder

Co-adds the interpolated images to create one mosaic image. Co-addition can be performed on Tiles to address computer memory considerations. Several co-addition schemes are available. Only required if you are not using the results from Mosaic processing

Mosaic Interpolate

Mosaic Combiner

run_mosaic_combiner

Combines the co-added tiles into a single mosaicked image. This module must be run, even when there is only one tile, in order to create the expected output files. Only required if you are not using the results from Mosaic processing.

Mosaic Coadder

Detect MedFilter

run_detect_medfilter

Performs background subtraction of the individual or mosaicked images that will be used for source detection.

Mosaic Combine (or the output of mosaic.pl)

Gaussnoise

run_gaussnoise

Estimates the background flucuations in the input image for use in the signal-to-noise ratio estimation

none

Point Source Probability

run_pointsourceprob

Filters the input coadded image to estimate the probability at each pixel of having a point source above the noise.

Mosaic Coadd (or the output of mosaic.pl)

Bright Detect

run_bright_detect

Detects bright sources in the input images, and includes source shape information. Does not record the blends, and so generally cannot replace Detect.

Point Source Probability

Detect

run_bright_detect

Performs image segmentation and computes the centroids for detected point sources.

Point Source Probability

Extract MedFilter

run_extract_medfilter

Performs background subtraction of either the mosaicked image (apex_1frame.pl) or tiles (apex.pl) that will be used for point source extraction.

Detect

Detection Map

run_detectionmap

Required by APEX User List multiframe to track the input positions through the stack of input BCDs.

Initial Setup,

APEX Settings

Fit Radius

run_fit_radius

Determines a fitting area for each source in the detect table. This module is optional if the parameters Fitting_Area_X,Y are defined in the Source Estimate module.

Detect

Select Detect

run_select_detect

Allows the user to select the columns and rows from the detect table to be written out to the full extract table

Detect

Source Estimate

run_sourcestimate

Performs point source estimation using PRF-fitting. Estimates fluxes refines the positions of the point source candidates from the detect table.

Detect; Fit Radius

Aperture (Photometry)

run_aperture

Calculates the flux(es) within the specified circular aperture(s) for each source in the extract table. The module will optionally subtract a background value calculated from a user-defined annulus.

Source Estimate

Select

run_select

Allows the user to select the columns and rows to be written to the final extract table, based on a range of user-specified conditions.

Source Estimate; Aperture (Photometry)

 

B.4    APEX QA Modules

Module Name

Namelist Trigger

Brief Description

Module Prerequisites

Initial Setup

N/A

Set up the input files. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

APEX QA Settings

N/A

Sets up the pipeline-specific global input parameters. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

Point Source Subtract

create_residual_images (with apex.pl)

create_residual_mosaic (with apex_1frame.pl)

Subtracts the extracted point sources from the input images or the input mosaic to create residual images. Invaluable for testing the results of PRF-fitting.

Initial Setup,

APEXQA Settings,

Output from either apex.pl or apex_1frame.pl

 

 

B.5    PRF Estimate Modules

Module Name

Namelist Trigger

Brief Description

Module Prerequisites

Initial Setup

N/A

Set up the input files. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

PRF Estimate Settings

N/A

Sets up the pipeline-specific global input parameters. On the command line, this is done in the main body of the namelist. See §9.4 for details.

None

MedFilter

run_medfilter

Performs the background subtraction of the individual input images.

Initial Setup,

PRF Estimate Settings

Crop Stack

run_crop_stack

Cuts out postage stamp images from the input images around each point source from the input point source list

MedFilter

Split By Array Position

split_by_array_position

Allows the user to direct MOPEX to divide the detector array into a number of sectors and generate a separate PRF file for each.

Initial Setup,

PRF Estimate Settings

PRF Estimate

run_prf_estimate

Combines the postage stamp images generated by the module Crop Stack into the final PRF/PRF Map.

Crop Stack, Split By Array Position

 

 


Appendix C.                  PRF Fitting Correction Factors for APEX:   Version 1 (10/20/2010)

 

When PRF fitting, APEX normalizes the PRF, either out to the limits of the file provided, or with a Normalization Radius given in the Source Estimate block.  Given the finite size of the PRF files, and differences in the way the Spitzer instruments are calibrated, correction factors are needed to the PRF-fitted fluxes (the column labeled “flux” in the extract tables).

 

The following is a wide table, broken up to fit vertically.  If using the PRF and Normalization Radius values indicated, which are the defaults, the user should divide “flux” by the final column.   The factors for IRAC are discussed in detail in the IRAC Instrument Handbook.  These are for data from the cryogenic mission.

 

 

Instrument

Script/Flow

Default Namelist

Fit on Images or Mosaic?

Pixel Size (arcsec)

 

IRAC 1

Apex

apex_I1_have_mosaic.nla

Images

1.22b

          2

 

         I2

 

 

          3

 

         I3

 

 

          4

 

         I4

 

 

 

 

 

 

 

MIPS  24

Apex_1frame

apex_1frame_M1.nl

Mosaic

2.45

           70

 

                       M2

 

4.0

         160

 

                       M3

 

8.0

 

 

 

 

 

IRS PUI Blue

Apex_1frame

apex_1frame_PUI_blue.nl

Mosaic

1.8

               Red

 

                               red

 

 

 


 

 

Instrument

PRF

Sampc

Norm Radius (PRF pixels)d

Divide PRF Fit Fluxes by

 

IRAC 1

apex_sh_IRAC1_col129_row129_x100.fitse

100x

1000

1.021

          2

 

 

 

1.012

          3

 

 

 

1.022

          4

 

 

 

1.014

 

 

 

 

 

MIPS  24

mips24_prf_mosaic_2.45_4x.fitsf

4x

57

0.94

           70

mips70_prf_mosaic_4.0_4x.fits

 

None

0.83

         160

mips160_prf_mosaic_8.0_4x.fits

 

None

0.83

 

 

 

 

 

IRS PUI Blue

b0_prf_blue_new.fits

4x

48

0.91

               Red

             red

                               red

52

0.89

 

 

aPresumes mosaic has already been made in the output directory.

bApproximate pixel size on images; mosaic pixel size is 0.6 arcsec.

cFactor by which the PRF samples the data pixel size.

dPRF normalization radius (input in Source Estimate block).

ePRFs derived from cryogenic mission data.

fValid for most 24 micron data.  Some fast scan maps may differ – a PRF derived from the data may be preferable.

 

 

 

Appendix D.                  Some Tips for MOPEX with Spitzer Data:   Version 1 (3/16/2012)

 

D.1  Mosaics (IRAC and MIPS)

    The end result of a normal Mosaic run is mosaic files in output_dir/Combine-mosaic (Combine in command-line).  Generally no weighting of the pixel stack is used, and especially no sigma weighting if sources are present.  You can combine data with different exposure times and weight them by time if the FITS keyword that has the time in it is provided.  For Spitzer data, this is 'EXPTIME'.  It should be set in the GUI Mosaic Coadd Settings.  (In command-line, put INTEG_TIME_KWD = 'EXPTIME', in the Coadd block of the namelist.nl file.)

 

     The coverage mosaic is always the number of good pixels in the final stack.  The total exposure time for a pixel (when time-weighting) is not available as a mosaic, but can be found per tile in the output_dir/Coadd-mosaic directory.  (If there's only one tile, it is like the final mosaic.)

D.2  Fluxes and Uncertainties (IRAC and MIPS)

    The end result of a normal point-source fitting run (Apex or Apex 1frame) is a table in the Output directory called *extract.tbl.  It's in IPAC table format, readable by many common tools.  A tool for reading an IPAC table into an IDL structure is available at

http://irsa.ipac.caltech.edu/tools/irsa_idl.html. 

 

    The point-source fitted fluxes (in microJy for Spitzer data) are in the "flux" column.  For the uncertainty, use the signal-to-noise column called "SNR", i.e.  uncertainty = flux/SNR (for a quick discussion, see the file in the Mopex directory readme/README_new_snr_option_081108.pdf).  The aperture fluxes and uncertainties (in microJy) have obvious names in *extract.tbl. (If you ran only aperture photometry, they are in aperture.tbl.)

 

    There are some small correction factors needed for the highest accuracy.  Aperture corrections for apertures other than the standard calibration aperture and annnulus can be found in the IRAC and MIPS Data Handbboks. Some corrections for PSF-fitted fluxes can be found in Appendix C.

 

   IRAC array location-dependent corrections with MOPEX are discussed in Spitzer Data Analysis Cookbook: Recipes 6 and 7.  Color corrections are in the IRAC and MIPS Data Handbooks.

D.3 Point-Source Fitting: Apex for IRAC stacks, Apex_1frame for MIPS mosaic

    The point source response functions and sample namelists that come with MOPEX are for fitting on the (C)BCD frames for IRAC (Apex) and on the default mosaics for MIPS (Apex 1frame). 

D.4  Use the Mosaic Task to make Mosaics (IRAC data)

    Sounds obvious, but the confusion comes when running APEX (multiframe) on IRAC data. APEX is set up to make a mosaic from the image stack for point-source detection (and does so in the default templates and namelists, e.g. apex_I1_gui.nl).  This is because APEX needs some files that are part of the mosaic process.  But it can't do all the fancy outlier rejection that Mosaic can.  For most data, it's better to make mosaics with the Mosaic task.

 

    One approach might be called "all at once".  Set up a GUI Mosaic flow, then click on "Insert APEX multiframe..." and use one of the standard templates.  Shut off (hit the X) APEX mosaic commands: Fiducial Image Frame, Mosaic Interpolate, Mosaic Coadd, and Mosaic Combine. This is described in the Spitzer Data Analysis Cookbook: Recipe 7.  The GUI version of APEX will now be able to find the Mosaic files it needs.  Start the combined flow with the green arrow at the top.

 

    What if you made a nice mosaic last week and don't want to re-do it?  Provided you saved the original output directory, you can just run APEX.  Set the APEX output directory to the original output directory.  You can use a standard template and turn off the APEX mosaic commands as above, or, for your convenience, there are example namelist files that do this for you, cdf/apex*have_mosaic*gui.nl.

 

(In command-line, run mosaic.pl as usual, then drop the mosaicing tasks from your Apex namelist and run apex.pl to the same output directory used for mosaic.pl, or use one of the

cdf/apex*have_mosaic*.nl namelists.)