Flux-Uncertanty from Aperture Photometry F. Masc, verson 1.0, 10/14/008 1. Summary We derve a eneral formula for the nose varance n the flux of a source estmated from aperture photometry. The 1-σ uncertanty s ven by the square root of ths expresson. Unless mentoned otherwse, t s assumed that the flux estmate ncludes backround subtracton and that there are no severe pxel-to-pxel correlatons. These usually occur n resampled and nterpolated maes (e.., mosacs). If present, the uncertanty computed by the formula below wll be an underestmate. Correlated nose s rather complcated to express analytcally. A formalsm to account for correlated nose usn Monte Carlo smulatons s descrbed n: http://web.pac.caltech.edu/staff/fmasc/home/wse/apphotuncert_corr.pdf The only dffcult thn to determne before usn ths formula s the an factor,.e., how many electrons correspond to a pxel flux unt f the mae at hand were drectly observed wth the detector. Electrons are the dscrete enttes that are counted, and these contrbute to Posson fluctuatons. A coadd or mosac of maes s not drectly observed. These are lkely to be resampled to a dfferent pxel sze, and are typcally enerated from an averae (or medan) of a number of overlappn detector maes. Co-addton has the effect of reducn the Posson nose-uncertanty by 1/ N, where N s the depth-of-coverae at mae pxel. N s usually constant over a source, and can be approxmated as the averae or medan depth over all pxels n the source aperture. All other nose contrbutons n the formula below (other than the Posson term) can be derved a posteror from the mae pxels at hand. Here s the fnal result. We also defne all quanttes nvolved. The dervaton s ven below. S # B % + k N ( A ' *" B / px & ) N 1
where = an n "electrons / pxel data unts" pretendn that mae was "observed" by a detector wth the same pxel sze. Note, the mae at hand could be a resampled co - add or mosac N A = number of pxels n source aperture = number of pxels n backround annulus N = depth - of - coverae at pxel ; N >1 f mae s a co - add S = snal n pxel n mae data unts B = estmated backround per pxel n annulus (ether mean or medan): " B / px f B = mean backround/pxel, k = 1 f B = medan backround/pxel, k = " / f assume B = 0 or f no backround s subtracted, set k = 0 = varance n sky backround annulus n [mae unts] /pxel. Can compute from square of RMS devaton from mean or medan. Can also approxmate usn a robust estmator of scale : [ ] # [( q 0.5 $ q 0.16 )] where the q are quantles; # 0.5( q 0.84 $ q 0.16 ) Ths last approxmaton s even more robust snce t only uses the lower tal where cosmc rays and spurous sources are less lkely to occur N.B : f frst summaton term above s < 0 (due to B exceedn source photon fluctuatons n aperture, set ths term to zero. It means the measurement s consstent wth zero Posson nose from the source.. Dervaton The above formula s derved as follows. Frst, the equaton for estmatn the flux of a source from aperture photometry can be wrtten: F src = F tot " N A B, (1) where F tot s the total nterated flux n the aperture, and other quanttes are defned above. The nose-varance n ths estmate s ven by standard error propaaton. We nore correlatons between pxels n the source aperture and backround annulus snce these are assumed to be well separated. The varance n Eq. (1) s ven by: = " tot + N A " B, ()
where the lne above the sky backround B ndcates that ts estmate refers to ether a mean or medan value. The frst term on the rht hand sde of Eq. () s the total varance n the source aperture. Ths s the quadrature sum of all the ndvdual pxel varances theren: " tot N A = #". (3) For smplcty, we nore possble pxel-to-pxel correlatons. These wll be handled n a future revson. An ndvdual pxel varance σ (for any pxel n the source aperture) can be wrtten n terms of a Posson varance term to account for the contrbuton of photon nose to pxel from the actual source, and a term to account for all other extraneous nose components, e.., photon-nose from the sky, read-nose and other nstrumental nose. Recall that the source photons are supermposed on a backround, and we must account for the contrbuton from each nose component separately. In eneral, f the mae at hand were observed wth the detector (wth the same pxel sze), the nose varance n unts of electrons can be wrtten: " e = ( S # B ) + " Be, (4) where the (S B ) s the snal n a pxel from source alone, n physcal unts of the mae data, s the an n electrons/pxel data unts, and σ Be s the extraneous nose component n electrons (see above). The pxel-varance n (4) can be wrtten n unts of [mae unts] by dvdn throuh by : ( " = S # B ) + " B / px, (5) where σ B/px s now the extraneous backround nose-varance n physcal mae unts. If the mae at hand s a co-add made from a stack of overlappn maes, we must dvde the Posson source term by the number of overlaps at pxel : N. Note, we do not dvde the backround varance term. Ths s because ths term wll be computed drectly off the co-add pxels (e.., va a spatal pxel RMS or data scale), and ths mplctly ncludes the 1/N varance-reducton. Posson nose from the source cannot be estmated n a smlar manner because the source does not occupy a lare enouh reon to compute a spatal RMS. Furthermore, the source s lkely to have a profle that vares rapdly over pxels. It s dffcult to solate the Posson fluctuatons about ths profle. It can be estmated from the varance n the resduals of a profle ft, but ths s outsde the scope of ths document. Therefore, to predct the amount of Posson nose from the source, we must o back to the detector mae-frame where the electron countn s done. Equaton (5) can then be re-wrtten: ( " = S # B ) N + " B / px, (6) Combnn Equatons (), (3) and (6), the nose-varance n a backround-subtracted source flux s ven by: 3
N S # B A $ + $ " B / px + N A " B. (7) N Wthout pror knowlede of the varaton of the backround pxel varance σ B/px, we smply assume t s a constant,.e., ndependent of pxel locaton. Ths s computed from pxels n the sky annulus. Therefore, we can replace the second summaton term wth the number of pxels n the source aperture, N A. Equaton (7) now becomes: S # B " B / px N + N A " B. (8) Now to the last term the varance n the mean or medan sky-backround per pxel. If B s an arthmetc mean, ts varance (or the square of ts 1-sma uncertanty) s ven by " B = µ = " B / px, (9) where σ B/px s our backround pxel varance from above, computed usn the pxels n our sky annulus. If however the medan was used for B and the pxel values are normally dstrbuted, ts 1-sma uncertanty as derved from Eq. (9) wll be slhtly underestmated by a factor of [π/] 1/, or ts varance underestmated by π/. In other words, the medan s noser (less effcent n statstcal parlance) than the mean for a randomly drawn sample. Nonetheless, ven the robustness of the medan aanst outlers, ths s a small prce to pay. A dervaton of ths π/ nflaton exsts n each of the follown references and was used to derve Equaton (8) n the follown paper: http://web.pac.caltech.edu/staff/fmasc/home/statstcs_refs/madstats.pdf Therefore, under the assumpton of normally dstrbuted data (whch s usually satsfed n the lmt of lare wth a well behaved astronomcal detector), the varance n the medan s ven by: " B = med = # " B / px, (10) We can combne Equatons (9) and (10) wth Equaton (8): S # B % + k N ( A ' *" B / px. (11) & ) N 4
Where k = 1 corresponds to B estmated usn an arthmetc mean, and k = π/ s for B estmated usn a medan. Incdentally, f the source flux estmate nvolved no sky-backround subtracton, or the backround s known to be nelble a pror, one can set k = 0. One can use robust estmators of spread n the sky-pxel values as a proxy for σ B/px. Ths s to avod estmates (lke the RMS) from ben based by cosmc rays and spurous sources n the sky annulus. Examples nclude usn the quantle dfference: σ B/px 0.5(q 0.84 q 0.16 ), or the Medan Absolute Devaton (MAD): σ B/px 1.486med p med{p } where p s the value of pxel. Both these measures assume normally dstrbuted data, and they convere exactly to the RMS value (standard devaton) as. An ssue s whether these robust proxes are as effcent as the RMS under the assumpton of a normally dstrbuted populaton when small sample statstcs are nvolved. By effcent, we mean no more varant than the RMS tself. As an asde, the RMS has the least varance for random sampln from a normally dstrbuted populaton. A moment s thouht tells us that just lke the medan (the 0.5 quantle), addtonal uncertanty wll be ntroduced f robust estmators of spread are used. Ths mples dfferent correctons that can be absorbed nto k. These correctons can be derved usn a Monte-Carlo smulaton. In the end, the benefts that these robust measures provde n the presence of outlers reatly outwehs any addtonal uncertanty they may ntroduce. One may verfy Equaton (11) va a smulaton. For example, one can add dfferent nose components wth known varance to an mae contann a snle source (a pont convolved wth a test PSF). One then uses Equaton (11) to compute the uncertanty n the source flux estmated from aperture photometry. Ths s then compared wth the nput truth. 5