The AstroStat Slog » background subtraction http://hea-www.harvard.edu/AstroStat/slog Weaving together Astronomy+Statistics+Computer Science+Engineering+Intrumentation, far beyond the growing borders Fri, 09 Sep 2011 17:05:33 +0000 en-US hourly 1 http://wordpress.org/?v=3.4 Background Subtraction, the Sequel [Eqn] http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-bkgsubtract-poisson/ http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-bkgsubtract-poisson/#comments Wed, 06 Aug 2008 17:00:39 +0000 vlk http://hea-www.harvard.edu/AstroStat/slog/?p=407 As mentioned before, background subtraction plays a big role in astrophysical analyses. For a variety of reasons, it is not a good idea to subtract out background counts from source counts, especially in the low-counts Poisson regime. What Bayesians recommend instead is to set up a model for the intensity of the source and the background and to infer these intensities given the data.

For instance, suppose as before, that C counts are observed in a region of the image that overlaps a putative source, and B counts in an adjacent, non-overlapping region that is mostly devoid of the source and which is r times larger in area and exposure than the source region. Further suppose that a fraction f of the source falls in the so-called source region (typically, f~0.9) and a fraction g falls in the background region (we strive to make g~0). Then the observed counts can be written as Poisson realizations of intensities,

C = Poisson(φS) ≡ Poisson(f ­ θS + θB) , and
B = Poisson(φB) ≡ Poisson(g ­ θS + r ­ θB)
,

where the subscripts denote the model intensities in the source (S) or background (B) regions.

The joint probability distribution of the model intensities,

p(φS φB | C B) dφSB

can be rewritten in terms of the interesting parameters by transforming the variables,

≡ p(θS θB | C B) J(φS φB ; θS θB) d θS d θB

where J(φS φB ; θS θB) is the Jacobian of the coordinate transformation, and thus

= p(θS θB | C B) (r ­ f – g) d θS d θB .

The posterior probability distribution of the source intensity, θS, can be derived by marginalizing this over the background intensity parameter, θB. A number of people have done this calculation in the case f=1,g=0 (e.g., Loredo 1992, SCMA II, p275; see also van Dyk et al. 2001, ApJ 584, 224). The general case is slightly more convoluted, but is still a straightforward calculation (Kashyap et al. 2008, AAS-HEAD 9, 03.02); but more on that another time.

]]>
http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-bkgsubtract-poisson/feed/ 0
Background Subtraction [EotW] http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-background-subtraction/ http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-background-subtraction/#comments Wed, 21 May 2008 17:00:32 +0000 vlk http://hea-www.harvard.edu/AstroStat/slog/?p=308 There is a lesson that statisticians, especially of the Bayesian persuasion, have been hammering into our skulls for ages: do not subtract background. Nevertheless, old habits die hard, and old codes die harder. Such is the case with X-ray aperture photometry.

When C counts are observed in a region of the image that overlaps a putative source, and B counts in an adjacent, non-overlapping region that is mostly devoid of the source, the question that is asked is, what is the intensity of a source that might exist in the source region, given that there is also background. Let us say that the source has intensity s, and the background has intensity b in the first region. Further let a fraction f of the source overlap that region, and a fraction g overlap the adjacent, “background” region. Then, if the area of the background region is r times larger, we can solve for s and b and even determine the errors:

X-ray aperture photometry

Note that the regions do not have to be circular, nor does the source have to be centered in it. As long as the PSF fractions f and g can be calculated, these formulae can be applied. In practice, f is large, typically around 0.9, and the background region is chosen as an annulus centered on the source region, with g~0.

It always comes as a shock to statisticians, but this is not ancient history. We still determine maximum likelihood estimates of source intensities by subtracting out an estimated background and propagate error by the method of moments. To be sure, astronomers are well aware that these formulae are valid only in the high counts regime ( s,C,B>>1, b>0 ) and when the source is well defined ( f~1, g~0 ), though of course it doesn’t stop them from pushing the envelope. This, in fact, is the basis of many standard X-ray source detection algorithms (e.g., celldetect).

Furthermore, it might come as a surprise to many astronomers, but this is also the rationale behind the widely-used wavelet-based source detection algorithm, wavdetect. The Mexican Hat wavelet used with it has a central positive bump, surrounded by a negative annular moat, which is a dead ringer for the source and background regions used here. The difference is that the source intensity is not deduced from the wavelet correlations and the signal-to-noise ratio ( s/sigmas ) is not used to determine source significance, but rather extensive simulations are used to calibrate it.

]]>
http://hea-www.harvard.edu/AstroStat/slog/2008/eotw-background-subtraction/feed/ 6