#----------------------------------------------------------------------------- # IRACproc: IRAC Post-BCD Processing v4.3 PHOTOMETRY #----------------------------------------------------------------------------- (c) 2005 Mike Schuster, Massimo Marengo (mmarengo@cfa.harvard.edu) (c) 2005 SAO - Smithsonian Astrophysical Observatory Harvard-Smithsonian Center for Astrophysics Smithsonian Astrophysical Observatory 16 JAN 2007 Measuring photometry from your IRAC data with IRACproc is a 4-step process: step 1: Prepare your IRAC data. This may include mosaicking, image cropping, unit conversion, as well as PSF subtractions and masking. step 2: Gather input information for IRAF photometry scripts. step 3: Run IRAF photometry scripts. step 4: Correlate, or merge, the photometry across all bands based on WCS coordinate information. This perl script may be useful even if your photometry comes from other sources. We have developed this software to assist with the photometry of IRAC fields. The scripts will work with any combination of IRAC channels, up to 4. The scripts assume that the images have been cleaned of transients. These scripts do have some limitations since they were developed specifically for the Nearby Stars GTO program. #----------------------------------------------------------------------------- # Assumptions #----------------------------------------------------------------------------- Zero-Point Determination** ------------------------ pixel scale = 1.22/sqrt(2) = 0.8626716"/pix image units are DN/s (the PDL routine cropout_bcd can be used to convert image units) zero-points are for pre-S11 calibration photometry is done with apertures aperture has a radius of 4 pix annulus has an inner radius of 14.1 pixels and a width of 14.1 pixels ** do_nsfind.cl and do_nsphot.cl can be modified to work with other IRAC data limitation of IRAF scripts -------------------------- image filenames start with 'I_' and end with the extension '.fits' #----------------------------------------------------------------------------- # Check Setup #----------------------------------------------------------------------------- You will need to add the following to your loginuser.cl file before starting IRAF. You may have already performed this step during the initial IRACproc setup process. user_name][ pico ~/iraf/loginuser.cl # IRAC Processing set IRACproc = "/IRACproc/" task do_nsfind = IRACproc$source/do_nsfind.cl task psort_xy = IRACproc$source/psort_xy.cl task pdump_xy = IRACproc$source/pdump_xy.cl task do_nsphot = IRACproc$source/do_nsphot.cl task pdump_xymag = IRACproc$source/pdump_xymag.cl task do_wcsctran = IRACproc$source/do_wcsctran.cl task run_nsphot = IRACproc$source/run_nsphot.cl noao digiphot apphot ptools #----------------------------------------------------------------------------- # Preparing Images #----------------------------------------------------------------------------- If you need to perform other PSF subtractions and masking, see HOWTO_PSFSUB and HOWTO_PSFMASK. ---------------- This step is for preparing the images for photometry by converting the pixel units from MJy/sr to DN/s. Change dir to the target for which you wish to perform photometry: user_name][ cd proc_dir/analysis/ Start PDL. user_name][ perldl Unit conversion: ---------------- Example, convert MJy/sr -> DN/s: perldl> cropout_bcd('I1_NAME.fits','I1_NAME_dns.fits',{MJSR2DNS=>1}) perldl> cropout_bcd('I2_NAME.fits','I2_NAME_dns.fits',{MJSR2DNS=>1}) perldl> cropout_bcd('I3_NAME.fits','I3_NAME_dns.fits',{MJSR2DNS=>1}) perldl> cropout_bcd('I4_NAME.fits','I4_NAME_dns.fits',{MJSR2DNS=>1}) Set the USE_OLD_PIPE option to "1" if you are using S10 thru pre-S11 pipeline. Set the USE_OLD_PIPE option to "2" if you are using S11 thru pre-S13 pipeline. Type cropout_bcd() at the PDL prompt to see available options. Quit PDL - you will need to restart for the next target. perldl> quit #----------------------------------------------------------------------------- # Gather Input Information for Photometry #----------------------------------------------------------------------------- Start IRAF and Ds9. user_name][ cd proc_dir/analysis/ user_name][ ds9 & user_name][ cd ~/iraf/ user_name][ cl cl> cd proc_dir/analysis/ cl> imhist I1_NAME_dns.fits z1= z2= cl> imhist I2_NAME_dns.fits z1= z2= cl> imhist I3_NAME_dns.fits z1= z2= cl> imhist I4_NAME_dns.fits z1= z2= Adjust the x-axis display range with the parameters z1 and z2 so that they are just enough to contain the data. You are looking for the minimum data value for "good" pixels, this is usually where the main "hump" in the histogram falls below a few. Alternative method: Display image in Ds9 with a log stretch, set the data scale to 90-some%, and open the Scale Parameters window to adjust the minimum value. The pixels with values at or below that minimum will be black and all other pixels will be much lighter, thus making it fairly easy to find a good minimum data value. Repeat for channels 1-4, and record the minimum good data value for each channel. ---------------- cl> imexam I1_NAME_dns.fits nlst=13 ncst=13 cl> imexam I2_NAME_dns.fits nlst=13 ncst=13 cl> imexam I3_NAME_dns.fits nlst=13 ncst=13 cl> imexam I4_NAME_dns.fits nlst=13 ncst=13 Move the cursor over the image display. Place the cursor on "blank sky" areas and press the "m" key. You will see image statistics for a box centered on the location of the cursor. Do this at several locations across the field (5 to 6+), and 2 to 3 times at each location (with slight shifts to weed out bad areas). You should find some consistency in the standard deviations that print at the IRAF command prompt. Average the standard deviations, ignoring values that are obviously low/high. A box size of 11x11, or 13x13, works well (set by nlst=11 ncst=11). Record the sky sigma value for each channel. #----------------------------------------------------------------------------- # Measure Photometry #----------------------------------------------------------------------------- cl> run_nsphot This script will identify possible sources, perform photometry and convert image coordinates to WCS for any of 4 channels. You will be prompted for the following parameters: "File Name" - everything in the image filename after "I_" and up to ".fits"; "exptime" - the exposure time for the image (same for all channels); "dmin*" and "sig*" - the minimum good data and sky sigma values for each channel determined in the previous step; and "dmax*" - the maximum good data value (default INDEF). If the coverage/exptime varies across a mosaic or between channels, then use the most prevalent exptime. The scripts will still give the correct magnitudes. This only affects the error calculation for objects whose photometry will be source-noise limited. #----------------------------------------------------------------------------- # Correlate Photometry #----------------------------------------------------------------------------- user_name][ cd proc_dir/analysis/ user_name][ correlate -s 2 This script will correlate magnitudes and errors based on WCS coordinates for up to 4 channels. Low-quality data can be excluded from the final lists with either option -e (max error) or -s (min S/N). If the maximum absolute average differential in arcseconds for any channel is > 0.01, then increase the number of iterations with the -N option. Hints: ------ Typically, the matching radius parameter should be close to either: (1) the resolution of the camera(s), or (2) the sampling of the camera(s) if undersampled. Try to set the matching radius >= 3*rms deviation (from trial outputs). Smaller than this and your probably missing real sources. If the matching radius is too large, then the routine may erroneously match sources and the rms deviation will likely grow larger. There seems to be a sweet spot with IRAC data for the absolute size of the search box scale, in terms of speed, that is around 10". USAGE: perl correlate.pl [--help][--ver][--t tolerance][--N max_iter] [--r radius][--b boxscale][--a] [--e max_error][--s min_S2N] [--c red_color_cut] [--phot phot_file_root] [--wcs wcs_file_root] [--o output_file_root] --help Print usage information and exit. --ver Print current version and exit. --t tolerance tolerance in arcseconds for maximum average differential in arcseconds (Dec or projected RA) between channels between successive iterations - default is 0.01 --N max_iter maximum number of iterations to achieve tolerance - default is 3 --r radius maximum initial separation in arcseconds for matching sources - default is 2.444 --b boxscale search box size scale for matching sources positive - in multiples of matching radius negative - in integral arcminutes - default is 4 --a use progressively more aggressive initial separation constraint with each successive iteration - not used as default --e max_error maximum photometric error allowed (in magnitudes) - default is 1.0857 (i.e. S/N=1) --s min_S2N minimum signal-to-noise allowed - default is 1 (i.e. max_error=1.0857) --c red_color_cut red source color cut (in magnitudes): ch1-ch2 >= red_color_cut - default is 1.5 --phot phot_file_root Photometry file: phot_file_root.channel - default is "magd" --wcs wcs_file_root WCS coordinate file: wcs_file_root.channel - default is "wcscood" --o output_file_root Output correlated photometry file root - default is "phot" The output files are phot.all and phot.red (sources with m[3.6]-m[4.5] >= red_color_cut, provided those channels are present), ds9 region files phot.all.reg and phot.red.reg, and a log file phot.log.