#----------------------------------------------------------------------------- # IRACproc: IRAC Post-BCD Processing v4.3 PSF FITTING/SUBTRACTION #----------------------------------------------------------------------------- (c) 2008 Mike Schuster, Massimo Marengo (mmarengo@cfa.harvard.edu) (c) 2008 SAO - Smithsonian Astrophysical Observatory Harvard-Smithsonian Center for Astrophysics Smithsonian Astrophysical Observatory 30 JUL 2008 This method of PSF subtraction is an iterative process during which you try to achieve two goals: 1) to have the subtraction residuals as symmetric as possible; and 2) to have no net signal above, or below, the local background in a reasonably sized/shaped aperture. It is always desirable to have the level of the subtraction residuals below the noise level in the image, though this is not always possible. #----------------------------------------------------------------------------- # PSF Fitting/Subtraction #----------------------------------------------------------------------------- This step is for subtracting one or more PSFs, of virtually any dynamic range, from an IRAC image. This software will work with any group of FITS images, whether for PSF subtraction or not, or IRAC or not. The subtraction is done by aligning and rescaling the PSF with the sources to be subtracted. The PSF is then projected on the image pixel grid, and subtracted. The parameters for the PSF alignment and subtraction are given in the psfsub_I.par configuration files, which specify the names of the image file to be PSF subtracted, the name of the PSF file, the ratio between the pixel size of the PSF and the image in x and y direction separately. Then there is a line for each position the PSF needs to be subtracted, with the x and y coordinates and the scaling factor. Examples of the parameter files, with the correct pixel ratio for the default IRACproc pixel scale (0.8626716 arcsec/pix) are in the directory 'proc_dir/Lists/psfsub_I.par' user_name][ pico proc_dir/Lists/psfsub_I.par Example psfsub_I1.par file: ------------------------------ IMAGE: I1_IRACproc_mosaic.fits PSF: /psf/I1_ext_psf.fits XPIX_RATIO: 3.5259038 YPIX_RATIO: 3.5260594 # XCEN YCEN SCALE 1 000.00 000.00 1.00E+0 2 000.00 000.00 1.00E+0 . . . N 000.00 000.00 1.00E+0 The XCEN and YCEN are 'absolute' coordinates, are as read in DS9 placing the cursor on the center of the point source to be subtracted. The PSFs are mosaics in MJy/sr normalized as Vega. If the image is also in MJy/sr (as normal IRACproc mosaics) then the scaling factor will be '1' when PSF subtracting a zero magnitude star and les than one when subtracting fainter point sources. The file names can be either absolute or relative to the working directory. ---------------- Change dir to the target that you wish to fit PSFs. user_name][ cd proc_dir/analysis/ Start PDL. user_name][ perldl perldl> psfsub_bcd('../Lists/psfsub_I.par') {PIX_MAG=>1,IMAGE_FILE=>'I_IRACproc_psfsub.fits'}) Type coadd_fits() at the PDL prompt to see available options. The PIX_MAG option, in particular, determines the precision of the PSF projection. The default PSF_MAG=>1 projects the PSF directly on the final grid, while larger integer values use intermediate finer grids magnified by the PIX_MAG factor. Given that the memory usage and the processing time are proportional to PIX_MAG^2, large values of PIX_MAG should be used with caution. One the script is done, it will print on the screen the Vega magnitude of each subtracted point source, as: MAG = -2.5 LOG(SCALE) This is an iterative process where the optimal parameters are reached by minimizing the residuals left after PSF subtraction. It may help to display the PSF-subtracted image with a linear (or sqrt) stretch, minimum=median_sky-0.5, and maximum=median_sky+0.5. See next section for notes. A record of the final PSF subtraction parameters is saved as psfsub_I.par in Lists/. Once you get a feel for things, it may take you 5-10 min per subtraction. Repeat all of the above steps for channels 1-4. Quit PDL - you will need to restart for the next target. perldl> quit #----------------------------------------------------------------------------- # Fine Tuning the Parameters: Adjustment Sizes #----------------------------------------------------------------------------- We are finding that shifts as small as 0.05-0.1 pixel are adequate for saturated PSFs, where shifts as small as 0.005 may be useful for precise subtraction of non-saturated PSFs. We are also finding that changes as small as 0.5-3% in the relative PSF amplitude are noticeable in the subtraction residuals. #----------------------------------------------------------------------------- # PSF available for subtraction #----------------------------------------------------------------------------- Two sets of PSF are available in the directory 'psf' of the IRACproc distribution: - I_ext_psf.fits : "extended" PSFs made combining a set of bright saturated stars (Vega, epsilon Eridani, Fomalhaut, Sirius and epsilon Indi). The saturated cores of the PSF are masked. These PSF are very high quality and linear, and should be preferred whenever possible. - I_hdr_prf.fits : "high dynamic range" (HDR) PRFs combining the extended PSF with the "core" PRF provided by the SSC. The saturated masked part of the extended PSF is matched to a rescaled unsaturated core PSF and smoothly joined. This PSFs are useful when trying to subtract sources with little or no saturation, but should be used with caution. The core of these PRF is not a good representation of point source cores produced with IRACproc or MOPEX, and the renormalization/merging of the two components introduce a variable pedestal in the merging area, up to several arcsec from the center. PSF subtractions with the HDR PSFs will have a "donut" residual and pedestal in the center. #----------------------------------------------------------------------------- # Photometry from PSF Fitting #----------------------------------------------------------------------------- When using the extended PSF, the value of the PSF fitting photometry can be as accurate as 1%. Note that the psfsub_bcd script assumes that the image is a mosaic in MJy/sr (default for IRACproc and MOPEX). If that is not the case then convert first your images in MJy/sr. If this is the case, the script prints the Vega magnitude for each PSF subtracted source. To convert the magnitudes into flux one can use the Vega zero point fluxes in the IRAC Data Handbook: F0 = 280.9, 179.7, 115.0, 64.1 Jy When using the HDR PSF one have to be careful in matching only the spikes of the PSF, and not the core, or the PSF tails in proximity of the core, due to the issues described above. We have compared photometry for six stars (M5.5-M9.0) in all four IRAC bands using four independent methods, including PSF fitting with the extended PSFs, and found that the derived magnitudes from all methods match within about 1-2% (our typical photometric error). Our four methods for measuring photometry are: direct measurement from BCD image using an aperture; aperture photometry from a mosaic created with integer-pixel shift-and-add co-addition; aperture photometry from an IRACproc mosaic; and PSF fitting from an IRACproc image using the extended PSFs. In all cases we were extremely careful not to "clip" the cores of the under-sampled PSFs during outlier rejection. These stars were highly overexposed in the images used for PSF fitting. We conclude that the flux of an overexposed point source can be accurately determined from the wings/spikes of the PSF (provided there is sufficient signal-to-noise). In all cases these stars were observed with a small scale dither pattern near the center of the array. We also conclude that the outer wings/spikes of the HDR PSFs are accurately normalized to that of Vega (zero magnitude). We also have some preliminary evidence that the colors of the wings/spikes of the HDR PSFs are matched to Vega (zero color). The extended PSFs and HDR PRF have been calibrated as in the S16 Spitzer/IRAC pipeline. Versions of the Spitzer/IRAC pipeline previous than S13 had different calibrations (FLUXCONV). If using mosaics made from BCDs produced by a pipeline older than S13 you need to change their calibration to the calibration of S13 (divide by the appropriate FLUXCONV and multiply by the S13 FLUXCONV). On the other hand you may just be better off producing new mosaics using the latest version of the available data, with the more recent calibration. For convenience, the FLUXCONV and other parameters for different versions of pipeline are given below. S13+ IRAC Parameters: --------------------- ch.1 gain(e/DN): 3.3 ch.1 FLUXCONV: 0.1088 ch.1 orig_pix_scale(arcsec): 1.221 ch.2 gain(e/DN): 3.71 ch.2 FLUXCONV: 0.1388 ch.2 orig_pix_scale(arcsec): 1.213 ch.3 gain(e/DN): 3.8 ch.3 FLUXCONV: 0.5952 ch.3 orig_pix_scale(arcsec): 1.222 ch.4 gain(e/DN): 3.8 ch.4 FLUXCONV: 0.2021 ch.4 orig_pix_scale(arcsec): 1.220 S11-S12 DN/sec -> MJy/sr: ------------------------- ch.1 FLUXCONV = 0.1104 ch.2 FLUXCONV = 0.1390 ch.3 FLUXCONV = 0.6024 ch.4 FLUXCONV = 0.2083 S10 DN/sec -> MJy/sr: --------------------- ch.1 FLUXCONV = 0.1125 ch.2 FLUXCONV = 0.1375 ch.3 FLUXCONV = 0.5913 ch.4 FLUXCONV = 0.2008 #----------------------------------------------------------------------------- # Saturation #----------------------------------------------------------------------------- In IRAC channels 1 and 2, column pull-down indicates saturation; however the converse is not true, a source may be saturated and not exhibit column pull-down. #----------------------------------------------------------------------------- # Software Status #----------------------------------------------------------------------------- Rotation of the PSF is not available at this time. The mosaics should be produced in "array coordinates" (option CROTA=>'A' in mkmosaic_bcd, which is the default). #----------------------------------------------------------------------------- # Bugs #----------------------------------------------------------------------------- During the iterative PSF fitting process DS9 may die (this is a DS9 bug).