Aperture Photometry Uncertantes assumng Prors and Correlated Nose F. Masc, verson.0, 10/06/009 1. Summary We derve a general formula for the nose varance n the flux of a source estmated from aperture photometry assumng () pror pxel-flux uncertantes are avalable for the mage (e.g., computed a pror from a nose model), and () nose s correlated amongst pxels. Correlated nose usually occurs n re-sampled and nterpolated mages (e.g., mosacs), wth the degree of correlaton dependng on the sze of the nterpolaton kernel. The smoothng kernel moves nose-power from hgh to low spatal frequences and therefore needs to be recaptured to properly quantfy the uncertanty n the flux summed over a regon. Ignorance of correlated-nose wll lead to an underestmate of the fnal aperture-flux uncertanty. The 1-σ uncertanty s gven by the square root of the varance expresson below. A formalsm for estmatng uncertantes when one does not have access to prors and s content on gnorng correlated-nose s descrbed n: http://web.pac.caltech.edu/staff/fmasc/home/wse/apphotuncert.pdf Important Pre-Check: It s mportant that the pror pxel uncertantes are statstcally compatble wth the nput mage data on whch photometry s beng performed. One way to do ths s to compare the uncertantes wth the local RMS pxel-to-pxel fluctuaton about the mean or medan background level. It s mportant to ensure that the background regon s statonary (spatally unform) and free of contamnaton from outlers (ncludng real sources), otherwse, some trmmed verson or robust measure of the RMS must be used. Furthermore, t s strongly recommended that the background regon used for ths comparson has approxmately unform depth-of-coverage. The best place to perform ths check s at the raw-mage level pror to mosackng. Ths wll ensure that the depth-of-coverage s constant,.e., unty. If nconsstences are found between the data-derved (RMS) nose and pror uncertantes, one wll need to rescale the pxel-uncertantes accordng to the rato RMS/<σ >, where <σ > s the mean or medan pxel-uncertanty over the regon of nterest. 1
We frst gve the fnal result and defne all quanttes nvolved. The dervaton s gven below. " src where = F corra #" + F corrb k " / px B = number of pxels n source aperture = number of pxels n background annulus " = pror pxel flux uncertanty for mage, rescaled f necessary F corra = correlated nose correcton factor for varance n flux n source aperture F corrb = correlated nose correcton factor for varance n flux n background annulus B = estmated background per pxel n annulus (ether mean or medan): set k =1 f B = mean background/pxel set k = # / f B = medan background/pxel set k = 0 f assume B = 0 or f no background s subtracted " B / px = varance n sky background annulus n [mage unts] /pxel. Can compute from square of RMS devaton from mean or medan, and trmmed versons thereof. Can also approxmate usng robust estmators of scale: [ ] # [( q 0.5 $ q 0.16 )] where the q are quantles, or the MAD : # 0.5( q 0.84 $ q 0.16 ) [ ], the Medan Absolute Devaton from the medan # 1.486 medan p $ medan{ p }. Dervaton The above formula s derved as follows. Frst, the equaton for estmatng the flux of a source usng aperture photometry can be wrtten: F src = F tot " B, (1) where F tot s the sum of all pxel fluxes f A n the source aperture: A F tot = " f, () and all other quanttes were defned above. For the purpose of varance estmaton, we assume that the sky-background per pxel s derved usng a mean of all pxel fluxes n the annulus:
B = 1 " f B. (3) Generalzaton to the medan wll be descrbed below. The nose-varance n the estmate from Eq. 1 can be derved usng standard error propagaton. Ignorng correlatons between pxels n the source aperture and background annulus (snce these are assumed to be well separated), we have: " src = " tot + N A " B, (4) The frst term on the rght s the varance n the total flux n the source aperture. Usng Eq., ths can be wrtten n terms of the varance n pxel and the covarance between any two pxels (j, k) n the source aperture: " tot = #" A + # # cov( j,k) (5) j k< j wth the constrant : ( x j $ x k ) + ( y j $ y k ) % D PRF Smlarly, the varance n the mean background per pxel as estmated from Eq. 3 can be wrtten: " B = 1 $ & %& #" B + # # cov j,k j k< j also wth the constrant : ( x j * x k ) + ( y j * y k ) + D PRF ( ) ' ) () (6) If the co-add or mosac was constructed usng an nterpolaton kernel represented by the detector Pont Response Functon (PRF), then a nose fluctuaton n a detector pxel wll affect all the co-add pxels n the PRF's doman after nterpolaton. Therefore, the maxmum range over whch co-add pxels can be correlated s determned by the maxmum lnear extent of the PRF, D PRF. Ths s also called the correlaton length. Equatons 5 and 6 can re-factored respectvely as follows: 3
" tot = F corra #" A (7) " B = F corrb #" B (8) where : F corra =1+ ## ( ) cov j,k j k< j # " A ; F corrb =1+ ## ( ) cov j,k j k< j # " B (9) The correlated-nose correcton factors n Eq. 9 are further dscussed n secton 3. The nose varance n the source flux can then be wrtten be combnng Equatons 4, 7 and 8: " src N = F corra #" A + F A corrb #" B, (10) One would not typcally use the pror-uncertantes n the sky annulus (σ B ) to estmate the varance contrbuted by the background. Ths s because the annulus may be contamnated by sources and other outlers, whose effect s to nflate the σ B prors. Assumng the background s statonary wthn the annulus, the second summaton term n Eq. 10 can be replaced by σ B/px, where σ B/px s the varance n the sky estmate, e.g., as estmated from a hstogram of the pxel values. Therefore, f B n Eq. 1 were estmated usng an arthmetc mean (or a trmmed verson thereof), ts varance can be wrtten: " B = µ = 1 #" B $ " B / px, (11) If however a medan was used for B n Eq. 1 and the pxel values are normally dstrbuted, the varance as derved from Eq. 11 wll be slghtly underestmated by a factor of π/. In other words, the medan s noser (less effcent n statstcal parlance) than the mean for a randomly drawn sample. Nonetheless, gven the robustness of the medan aganst outlers, ths s a small prce to pay. A dervaton of ths π/ nflaton exsts n each of the followng references and was used to derve Equaton 8 n the followng paper: http://web.pac.caltech.edu/staff/fmasc/home/statstcs_refs/madstats.pdf 4
Therefore, under the assumpton of normally dstrbuted data (whch s usually satsfed n the lmt of large wth a well behaved astronomcal detector), the varance n the medan sky value per pxel s gven by: " B = med = # 1 $ " B % # " B / px, (1) We can combne Equatons 10, 11 and 1 nto our fnal general expresson: " src = F corra #" + F corrb k " / px, (13) B where k = 1 corresponds to B estmated usng an arthmetc mean, and k = π/ s for B estmated usng a medan. Incdentally, f the source-flux estmate nvolved no sky-background subtracton, or the background s known to be neglgble a pror, one can set k = 0. 3. Estmatng F corra and F corrb F corra and F corrb n Eq. 9 represent correcton factors 1 to account for an ncrease n the varance due to correlatons between pxels n the source-aperture and sky-annulus respectvely. In general, the covarance between any two pxels n ether the source-aperture or sky-annulus can be wrtten: cov(j, k) = ρ jk σ j σ k, where ρ jk s the correlaton coeffcent. Note, ρ jk = 0 for pxel separatons d jk > D PRF (the correlaton length of the smoothng kernel), and 0 < ρ jk 1 for d jk D PRF. The spatally unform background-domnated case For background-lmted observatons,.e., where flux n the source-aperture s domnated by background photons, the pxel varance s approxmately statonary (spatally unform) so that cov(j, k) ρ jk σ A. For the sky-annulus, we can also safely assume cov(j, k) ρ jk σ B. Furthermore, there s good reason to beleve that pxel-to-pxel covarances are statonary over the aperture and annulus regons so that ρ jk constant for any pxel par j,k wth fxed separaton d jk D PRF. Therefore, for the background-photon domnated case, ether F corra or F corrb n Eq. 9 can be reduced to: N N F corr "1+ $ $ # jk (14) N j k< j where N = or, the number of source-aperture or sky-annulus pxels respectvely. We expect (and smulatons confrm t) that: F corr = constant " N PRFeff for N # N PRFeff, (15) where N PRFeff s the effectve number of pxels n the smoothng kernel,.e., wthn some effectve correlaton length. Ths s not necessarly the total number of pxels spanned by the kernel, unless however the kernel s a top-hat (see below). We also expect: F corr " #N for N < N PRFeff, (16) 5
where α s a (non-trval) constant of proportonalty. Therefore, the correcton factor s a lnear functon of the number of pxels n the aperture up to some effectve N N PRFeff, and then levels off to some constant value N PRFeff for N N PRFeff. If one has no knowledge of the smoothng kernel, the correlaton coeffcent ρ jk n Eq. 14 can be calbrated as a functon of pxel separaton d jk from the mage usng some robust estmator of the autocorrelaton functon (ACF), preferably wthn statonary regons. An analytc functon can then be ft to ρ(d jk ) for use n evaluatng Eq. 14. If the smoothng kernel s known, ρ(d jk ) can be derved from the kernel drectly, ether numercally or analytcally. It can be shown that for a pxelzed PRF kernel where a value r j theren s defned as the response at pxel j when the PRF s centered on pxel, " jk = N PRF # =1 N PRF # r j r k r N PRF = N p # r j r k, (17) =1 where N p s the nfamous effectve number of nose pxels for the PRF kernel n queston. The dervaton shall be added n future. For an explanaton of N p, the reader s referred to: http://web.pac.caltech.edu/staff/fmasc/home/wse/nosepx_specs.pdf. For a top-hat PRF volumenormalzed to unty, the (constant) values are r j = 1/N PRF, and t s not dffcult to show from Eq. 17 that N p N PRF and ρ jk = 1 j,k. Unless one wants to satsfy ther mathematcal curosty, explct calculaton of F corr usng ρ jk for any PRF n general s unnecessary as we shall show. The full dervaton s deferred to a future paper. Consder the smple case of a top-hat PRF as used when nterpolatng detector pxels onto a fner coadd grd usng overlap-area weghtng. Here we have ρ jk 1 over the span of the N PRF co-add pxels overlappng wth an nput pxel. The double summaton n Eq. 14 s just the number of dstnct co-add pxel pars n ths span and evaluates to N(N-1)/. Eq. 14 then smplfes to F corr N = N PRF = N p (the number of nose pxels as shown above)! Ths s also the resamplng factor,.e., the number of output (co-add) pxels per nput pxel. For the general PRF case, t can also be shown (the full dervaton s deferred) that the effectve number of pxels n the smoothng kernel,.e., N PRFeff n Eq. 15, s N p. Hence n general, F corr = N p as the aperture sze ncreases beyond the effectve correlaton length of the kernel,.e., contans N > N p pxels. It s mportant to note that N p for the kernel should be measured n terms of the number of target mage (co-add) pxels, not natve detector pxels. The source-photon domnated case When flux n the source-aperture s domnated by actual photons from the source, the pxel-varance and covarances ρ jk σ j σ k (at fxed pxel-to-pxel separaton) theren can no longer be assumed to be statonary snce the Posson varance generally follows the profle of the source. Eq. 14 wll no longer hold, however, some workable approxmaton based on averagng correlatons wthn the aperture s stll possble. Nonetheless, t s comfortng that smulatons also show that F corr N p s a good approxmaton n the large aperture lmt. Consequently, for the source-photon domnated case, F corra s expected to depend on the relatve contrbuton of source-to-background flux n the source aperture. We have parameterzed ths usng the parameter R sb. In the notaton of Equatons 1-3, ths s defned as: 6
R sb = F tot B = " " f A f B. (18) To account for the complcatons noted above: () estmatng correcton factors for the source-photon domnated (spatally non-unform) case, and () the dependence of correcton factors for small apertures wth < N PRFeff pxels (.e., α n Eq. 16), we have resorted to a Monte-Carlo smulaton. Here are the smulaton steps used to estmate F corra and F corrb : 1. Create a test truth detector mage contanng some background B per pxel and a pont source spke wth flux F src n the mddle;. Convolve ths truth mage wth the detector PRF, volume-normalzed to unty; 3. Add Posson nose to the detector mage. We assume we re n the Gaussan lmt and sample our pxel errors ε from a normal dstrbuton: ε ~ N(0, σ = p ) for pxel value p ; 4. Interpolate the detector mage to a new grd (.e., the co-add mage grd) usng your favorte nterpolaton kernel. For WISE ths wll be the detector PRF as mplemented n AWAIC [see: http://web.pac.caltech.edu/staff/fmasc/home/wse/awac_adass08.pdf]; 5. Compute and store values of F A ( F src ), F B ( B ), V A, and V B, defned as respectvely: A B F A = " f ; F B = " f ; V A = "# A ; V B = "# B ; V A and V B represent the sum of squares of the nput pror 1-sgma uncertantes. 6. Go back to step 3 and re-smulate a new realzaton of Posson dstrbuted nose, savng the values from step 5 at each tral; 7. After 500-1000 nose realzatons, compute the varance n F A and F B over all N t trals va: 1 " (F A ) = N t #1 1 " (F B ) = N t #1 N t $ m=1 N t $ m=1 F m m ( A # F A ) F m m ( B # F B ) 8. The source-aperture and sky-annulus correcton factors are computed from the ratos: F corra = " (F A ) V A F corrb = " (F B ) V B So how do we know that the values for F corra and F corrb computed n ths manner are correct? The trck s that we also compute the varance n the source flux over all trals, σ (F src ), where F src s estmated at each tral (nose realzaton) usng Eq. 1. When ths s compared to the predcted varance usng Eq. 13, values of F corra and F corrb as precsely computed above are needed for consstency. F corra and F corrb wll be computed for each band-dependent PRF and a range of,, and R sb values. R sb s 7
defned by Eq. 18 and s only applcable to F corra. A user performng aperture photometry can then select (or approxmate) the approprate F corra and F corrb to use n the boxed equaton n secton 1. We also note that F corra (as well as F corrb ) can be computed (or verfed) drectly from the postsmoothed mage by throwng many apertures at random, retanng those apertures whch fall wthn regons wth a spatally-unform, source-free (and confuson-free) background, computng ther summed-flux varance as n step 7 above, and then comparng to the pxel varance, V A. The dffcultly here s havng enough random samples that are not sgnfcantly skewed by contamnatng sources, confuson, and/or a varyng background. 4. Example usng a WISE test PRF The example below s for a band-1 WISE PRF (FWHM ~ 6 ) used n creatng an nterpolated (coadd) mage wth resamplng factor of 4 (= number of output co-add pxels per nput natve pxel wth lnear scale.75 arcsec). Note, the PRF used here dates back to July 008. Results are shown for two test source-apertures and one sky annulus. Ap. Radus Rsb FcorrA (coadd px) (Eq. 18) ----------------------------------------------------- 6 0.99993001330583 7.01156843831 6 1.31718856548 8.340138075576 6 1.4635031970776 9.17784695401 6 1.695855935508 9.757545004733 6 1.9706696650331 30.18409774697 6.8541871359996 31.13645094043 6 3.7813096465519 31.58801445336 6 7.48974884015606 3.096004158001 6 14.9066046154863 3.467453097101 6 9.74066780869 3.559671495817 6 59.4074963888088 3.579836793639 6 118.74184587015 3.5714647056869 1 0.999887546531 9.7736948915878 1 1.56300066088 30.93700093471 1 1.517737761095 31.7747186767907 1 1.769461740915 3.3876481487989 1.0571799730685 3.8537565183179 1 3.05160093677735 33.961648859818 1 4.077479843960 34.575668375048 1 8.180979589585 35.3987855947 1 16.38794963875 35.859450916661 1 3.80184960564 36.091496179744 1 65.69519944466 36.1861485564 1 131.8489080113 36.86743664831 ----------------------------------------------------- annulus correlated-nose correcton factor for 36 -> 51 co-add pxels: FcorrB = 31.8995915784158 For comparson, the effectve number of nose pxels for ths PRF (n number of co-add pxels) s N PRFeff 34.61, consstent wth Eq. 15. 8