|
Mosaicking of the SINGS Galaxy NGC 1097:
|
This example demonstrates how to run the Spitzer mosaicker to create mosaics of a large field of view around the SINGS galaxy NGC 1097 in IRAC channels 1 through 4. We pay special attention to choosing the appropriate parameters in the mosaicker namelist files, and discuss the effect of various choices of several of these parameters. For channels 3 and 4, we show how to run the overlap correction script before mosaicking. The final products include the mosaic image, the mosaic uncertainty image and the mosaic coverage map.
Here is a summary with links to all the examples that use NGC 1097 data, including a detailed step-by-step presentation of mosaicking in pdf format.
In general, it is a good idea to run your data through the IRAC artifact mitigation software before mosaicking. Your input would then be the overlap and artifact corrected BCDs (over_cor_sfx*bcd.fits), updated uncertainty images (cor_sfx*bunc.fits) and the original imask files. However, in this example we will mosaic the pipeline-produced BCDs which in this case are relatively artifact-free.
In the MOPEX namelist (see sample namelists above), you have the option to run all the modules at once (set run* = 1) or select some/one module (set all others run* = 0). If you want to see what happens in each step, then you should set all the run* = 0, except the ones that are discussed currently or have been set before.
You need the input BCD files, listed in a file (here called "image_stack_all.txt", one file per line). Only files with odd expids, (e.g., only the 30 sec frames in the HDR observations), should be included. Here is a nifty unix trick to just get the odd- or even-numbered files in a file, one file per line (assuming you are currently in the directory with all the BCDs):
unix% ls *bcd.fits | awk 'BEGIN{i=0}{if (i%2) print $0; i++}' > oddlist.txt
unix% ls *bcd.fits | awk 'BEGIN{i=1}{if (i%2) print $0; i++}' > evenlist.txt
|
Don't forget to also download the IRAC Pmask files.
unix% overlap.pl -n ngc1097ch3overlap.nl unix% overlap.pl -n ngc1097ch4overlap.nl |
The links to namelists to be used (remember to change the paths to input and output files to correspond to your directories) are given above. Make sure that you have specified the input BCDs in the file pointed to by IMAGE_STACK_FILE_NAME parameter in the namelist file (including their path on your disk), and similarly the SIGMALIST_FILE_NAME and DCE_STATUS_MASK_LIST should point to files that give the full path and filenames to your uncertainty and imask images, respectively (one path/filename per line). For overlap.pl, you also need to give OVERLAP_CORR_DIR name in the namelist file. This is the name of the directory, under your specified OUTPUT_DIR, where the final, overlap-corrected BCDs will be written to. Pay attention to specifying the parameters for overlap correction:
&COMPUTEOVRLAPCORRIN
TOP_THRESHOLD = 3,
BOTTOM_THRESHOLD = 3,
MIN_IMG_NUM = 4,
&END
These parameters are used in the outlier rejection to set the upper and lower limits (multiples of sigmas), and the minimum number of images needed to perform the overlap correction. Also remember to set compute_overlap_correction = 1 and apply_overlap_correction = 1 in the namelist file. Finally there is a parameter mask_bright. You can set this to 1 to use masks created by the ``detect'' module. In this example, the central parts of the galaxy are very bright, and adjusting the parameters to detect less bright objects only did not help to avoid the masking of the brightest galaxy parts, and therefore the mask_bright parameter is set to 0. You can experiment by running the overlap correction module with mask_bright set to 1. In addition, the first frame of an AOR often has a bias offset which is very different from the rest of the frames in the AOR. In this example, we leave the first frames (EXPID=1) in channel 3 out from both AORs in generating our overlap-corrected frames and mosaics. Most of the rest of the parameters specified in the namefiles of the overlap correction module are discussed below in the context of generating the mosaics below. Remember that your IMAGE_STACK_FILE_NAME when making the mosaics for channels 3 & 4 below must point to a file that specifies the overlap-corrected filenames (and their path on your disk; filenames starting with ``correct_spitzer''), not the BCDs (for channels 1 & 2 it is ok to use the BCDs as input files). Also note that the option mosaic_corrected_images will only give a quick and dirty mosaic to see whether the overlap correction worked ok. A thorough mosaicking with the mosaic.pl script, as described below, is necessary to produce a high quality mosaic.
This creates the file FIF.tbl that gives the header keywords that specify the orientation, size, etc. of the final mosaic (CRVAL,CRPIX,CDELT,NAXIS). It also creates the file header_list.tbl that lists the projected CRVAL, CRPIX etc. values for each input BCD image. Specify the following in the namelist file:
run_fiducial_image_frame = 1
Edge_padding = 100 (add 100 arcsec of NaN-valued pixels on each edge)
CROTA2 = A (orientation of the final mosaic, use A for average CROTA2
value of the input BCDs, 0 ("zero") for north up orientation). If not
specified, an optimal orientation is used that minimizes the area covered
by the mosaic.
MOSAIC_PIXEL_RATIO_X =1, MOSAIC_PIXEL_RATIO_Y = 1 (mosaic has the same pixel
size as the input BCDs). To get equal pixel sizes in the final mosaic, use
MOSAIC_PIXEL_SIZE_X, MOSAIC_PIXEL_SIZE_Y instead (in degrees).
Run the mosaicker:
unix% mosaic.pl -n ngc1097ch1mos.nl |
Background subtraction is performed by subtracting median-filtered
values from pixels. Background subtraction needs to be run only if single
or dual outlier rejection is to be run. You need to specify:
run_medfilter = 1
&MEDFILTER
Window_X = 21,
Window_Y = 21,
N_Outliers_Per_Window = 100,
&END
unix% mosaic.pl -n ngc1097ch1mos.nl |
Trying a larger Window size (and larger outlier number) does not produce as good results. Trying a smaller Window size did not remove the background.

The following parameters need to be set:
run_mosaic_interp = 1
&MOSAICINTIN
INTERP_METHOD = 1,
FINERES = 4,
&END
unix% mosaic.pl -n ngc1097ch1mos.nl |
It is also possible to do drizzling (INTERP_METHOD = 2) or bicubic interpolation (INTERP_METHOD = 4). For drizzle, specify drizzle factor (DRIZ_FAC < 1). In channels 3 and 4 a better mosaic results if the FINERES parameter is not used, or if you use drizzle or bicubic interpolation. Also try setting MOSAIC_PIXEL_RATIO_X, MOSAIC_PIXEL_RATIO_Y to 2 and compare to what you get by setting the pixel ratios to 1.

Interpolation using the default option (left) or drizzling (right).
For dual outlier (spatial and temporal) rejection
run_medfilter = 1For run_detect_outlier, the parameter list is DETECT:
&DETECTTry playing with the threshold parameter. Increasing it causes a lot of cosmic rays to not be detected. Lowering it causes too many detections. Leave it at 4.
For dual outlier detection, the parameters are
&MOSAICDUALOUTLIERINPlay with MAX_OUTL_FRAC. Increase it to 0.95. You see a lot of non-radhit detections. If you lower it to 0.2, very few detections are seen. The best value seems to be 0.5. Tile size parameters can be played with if your computer has problems with insufficient memory.
For run_level the parameter is Threshold_Ratio. Use 0.5 to have all the pixels within a cluster to have the same sign (see mosaicker user's guide for more info). To run multiframe outlier rejection, the parameter list is
&MOSAICOUTLIERINTHRESH_OPTION = 1 is now preferred (see mosaicker user's guide for more information). In case of low coverage, uncertainty images are used for sigma estimation if coverage is less than MIN_PIX_NUM.
unix% mosaic.pl -n ngc1097ch1mos.nl |
run_mosaic_covg = 1
run_mosaic_rmask = 1
&MOSAICRMASKIN
BOTTOM_THRESHOLD = 3,
TOP_THRESHOLD = 3,
MIN_COVERAGE = 4,
MAX_COVERAGE = 100,
RM_THRESH = 0.5,
REFINE_OUTLIER = 1,
REFINE_OUTLIER_THRESH = 10
&END
Both dual and multiframe outlier are run between MIN_COVERAGE to MAX_COVERAGE. Below MIN_COVERAGE only dual outlier detection is run. RM_THRESH needs to be changed if mosaic has a different pixel size from the BCDs. BOTTOM and TOP thresholds allow the projection of outlier pixels only if they are a certain number of sigmas above or below mean. The refinement allows pixels inside real point sources not to be marked as outliers unless their deviation is very high.

Final mosaic after cosmic ray rejection (left), one of the original BCDs (right).
run_mosaic_reinterp = 1
run_mosaic_coadder = 1
run_mosaic_combiner = 1
Note that for most accurate photometry you should not use the uncertainty images as weights when performing the coaddition (otherwise the point sources in the resulting mosaic are likely to have flux values that are too low, due to the weigthing by the inverse squared of the sigma values which themselves are essentially the square root of the pixel flux in most cases, following Poisson statistics). So set
sigma_weighted_coadd = 0
which is also the default in MOPEX.
&MOSAICCOADDIN
TILEMAX_X = 1000,
TILEMAX_Y = 1000,
&END
If you want to mosaic background-subtracted BCDs, set run_mosaic_medfilter = 1

Pipeline-created mosaic in channel 2 (left), custom-tailored mosaic (made in this demo; right).
CAVEAT EMPTOR: More optimally constructed mosaics may possibly be constructed by using a different set of input parameters in the namelists. Use your own judgement and common sense.
Return to the Data Analysis Demos main page.