Spitzer Documentation & Tools
MOPEX User's Guide

 

6.5.18    APEX Modules: Source Estimate

Command Line Equivalent: run_sourcestimate

Default Output Directory: <output_dir>

Depends On: Detect or Input user list; Fit Radius (optional)

Relevant Pipelines: All

 

PURPOSE

Fits the input image with the PRF to estimate fluxes and refine positions of the point-source candidates from the detection list.

 

INPUT

NOTE: The inputs marked with a * are the ones users will be most likely to adjust.

 

Input Type: Image List for APEX Single Frame and APEX User List Single Frame; Tile Map for APEX Multiframe; Detection Map for APEX User List Multiframe.

 

*Fitting Area X,Y: (int) Size of the area in the input image to be fit with the PRF, in input image pixels. If not given, the detection table is expected to have FitX and FitY columns, whose content is used for the same purpose. These columns are produced by the Fit Radius module. If these columns are present, and Fitting Area X,Y are set then the latter takes precedence.

 

Max Number ps: (int) Maximum number of point sources to use in an attempt to deblend a detection (active de-blending). If Max Number ps > 1, the module will attempt to do an “active” deblend of the detections that were unsuccessfully fit. This should be used only with extreme caution.

 

*Chi Threshold: (float) Maximum acceptable value of χ2 / dof (degrees of freedom).

 

N Edge: (int) Positive number excludes point sources within N Edge pixels of the edge of the input image from fitting. A negative number appends an edge around the input images N_Edge pixels wide to include the point sources into the fitting. In APEX User List Multiframe, N Edge should match the parameter of the same name in the Detection Map module.

 

Max N Iteration: (int) Termination criterion for the maximum number of iterations to reach Chi Threshold.

 

Max N Success Iteration: (int) Termination criterion for the maximum number of iterations after Chi Threshold has been reached.

 

Minimize Ftol: (float) Termination criterion for the relative change in χ2 / dof to achieve before Chi Threshold is reached.

 

Minimize Ftol Success: (float) Termination criterion for the relative change in χ2 / dof to achieve after Chi Threshold is reached.

 

Dither Pixel Fraction: (float) See §8.6: PRF Fitting in MOPEX.

 

Dither Flux Fraction: (float) See §8.6: PRF Fitting in MOPEX.

 

Deblend Dither Pixel Fraction: (float) Same as Dither Flux Fraction but applied during active deblending.

 

*Background_Fit: (switch) Switch on (= 1) to fit a constant background under the point source in the fitting area. Default is off (= 0).

 

Random_Fit: (switch) Switch on (= 1) to give the minimization routine a random start, so that the results of fitting on the same set of data will not be identical for every run.

 

Chi2_Improvement: (float) Acceptable change in χ2 / dof for incremented number of point sources in active deblending.

 

*PRF ResampleX, Y Factor: (int) Ratio of the input image pixel size to the PRF pixel size.

 

*Normalization Radius: (int) PRF flux is normalized within this radius (in PRF pixels). By default, the PRF is normalized to the whole PRF array.

 

*Max Shift X, Y: (float) User List Mode only. Maximum distance in data pixels from the input position for a successfully fitted source position. If greater than Max Shift away from the user-supplied position, the source is given the letter "O" in the deblend column (for "Outside"), along with any other letter flags.

 

*Angular Distance: (float) User List mode only. The maximum angular distance (arcsec) used to identify the nearby sources for simultaneous fitting. If it is not given then the script will look for the Spitzer keywords "INSTRUME" and "CHNLNUM" in the input FITS header and the value gets set as follows: INSTRUME = "MIPS" and CHNLNUM = 1: Angular_Distance = 6. INSTRUME = "MIPS" and CHNLNUM = 2: Angular_Distance = 18. INSTRUME = "IRAC": Angular_Distance = 2 for all four channels. If the script is unable to set a value, the default is 0.0.

 

*Use_Photerr_for_SNR: (switch) Options for how the signal-to-noise ratio (SNR) of the fitted source can be estimated. These are approximations to the flux SNR, distinct from the formal flux uncertainty from the fit, delta_flux, which is also output. The SNR choices are given below. On the command line, use the number indicated (e.g. Use_Photerr_for_SNR = 2).

 

0.  no (default): This is APEX’s old SNR. The noise is the noise in the peak pixel, times a scaling factor that takes into account that pixel’s contribution to the PRF for a center-of-pixel hit. The noise should be from the Gaussnoise module (Use Data Uncertainties for PRF-fitted SNR turned off in the APEX Settings. The estimate is poor (an underestimate of noise) for undersampled pixels, e.g. IRAC channels 1 and 2.

 

1.  yes, no gain: Use the sum (in quadrature) of the data uncertainties within a box roughly the size of the core of the PRF (Use Data Uncertainties for PRF-fitted SNR turned on in the APEX Settings. This is usually best.

 

2.  yes, with gain: Use the background noise estimate from the Gaussnoise module within a box roughly the size of the core of the PRF, and add the photon noise calculated from the flux and the gain factor (Use Data Uncertainties for PRF-fitted SNR turned off)

 

Gain_for_SNR (float): The gain factor (electrons per data units) for use in the SNR estimate (above). For Spitzer data, the data units are given in MJy/sr. This is the gain for a single image. It will take into account the coverage to estimate an effective gain. In the case of integration-time weighting, it should be for unit time. 

 

COMMAND LINE INPUT

&SOURCESTIMATE

 InputType = 'image_list',

 Fitting_Area_X = 5,

 Fitting_Area_Y = 5,

 Max_Number_PS = 1,

 Chi_Threshold = 3,

 N_Edge = 4,

 Max_N_Iteration = 1000,

 Max_N_Success_Iteration = 0,

 MinimizeFtol = 0.001,

 MinimizeFtolSuccess = 0.00001,

 DitherPixelFraction = 0.1,

 DitherFluxFraction = 0.8,

 DeblendDitherPixelFraction = 1.,

 Background_Fit = 0,

 Random_Fit = 0,

 Chi2_Improvement = 1.,

 PRF_ResampleX_Factor = 4,

 PRF_ResampleY_Factor = 4,

 Normalization_Radius = 44,

 MaxShift_X = 3.0,

 MaxShift_Y = 3.0,

 Angular_Distance = 6.0,

 Use_Photerr_for_SNR = 1,

 Gain_for_SNR = 1000.0,

&END

 

OUTPUT

Table (*_extract_raw.tbl): The preliminary extract table, which includes the fluxes and improved positions of the point sources, along with other parameters characterizing the fit. Details of the output parameters are given in the description of Select (§6.5.20).

 

DISCUSSION

Details of the fitting are given in §8.6 PRF Fitting in MOPEX. Two kinds of uncertainty estimates are output (see §8.9 Uncertainty Estimation). If the Photerr is chosen, note that the SNR value for any bad uncertainties in the box is -9.99, and these objects might be lost from the final extract table if a SNR cut "select" is done.

 

If set, the fitting area parameters (Fitting Area X, Y) will be used instead of the output from the Fit Radius module, so make sure to unset them (leave them blank) if Fit Radius is to be used. If Fit Radius is not run, Fitting Area X, Y must be set. They must be set in APEX User List pipelines, as these pipelines do not use the Fit Radius module.

 

APEX normalizes the PRF in the following way: if Normalization Radius (in units of PRF pixels) is set, it will normalize by the sum of the "central" PRF within that radius. By "central" we refer to the PRF corresponding to a center-of-pixel hit. If Normalization Radius is not set, APEX will normalize by the available range that the "central" PRF covers, i.e. the whole array box. Getting correct PRF-fitted absolute fluxes requires a correct PRF normalization, and possibly correction factors to take into account how your data have been calibrated.

 

In general, it is better to keep Background_Fit turned off, as it is difficult to get a robust measure of the background within the small fitting area that is best for PRF fitting. An exception might be a very crowded field. If not used, you are relying on the results of the Extract MedFilter module to subtract the backgrounds.