-----------------------------------------------------------------------
Estimating Signal-To-Noise Ratio of a Point Source Measurement for IRAC
-----------------------------------------------------------------------
Updated to apply to warm IRAC observations on April 13, 2010

Note that a tool to calculate the Signal-To-Noise Ratio and
other quantities mentioned in this memo is available at

https://irsa.ipac.caltech.edu/data/SPITZER/docs/files/spitzer/snirac_warm.pro
https://irsa.ipac.caltech.edu/data/SPITZER/docs/files/spitzer/snirac.pro

When planning observations that need to measure the flux 
density or variations in the flux density of a point source 
to a certain precision, it is important to include the Poisson 
noise of the source in the estimation of the signal-to-noise 
ratio. The online sensitivity estimator, SENS-PET, that 
determines the detection signal-to-noise ratio (how significant 
a source is compared to the background) only includes the read 
noise of the instrument and the Poisson noise of the background 
in the calculation of the uncertainty. This memo discusses in 
detail how to estimate the uncertainty in a measurement of the 
source flux density for the benefit of observers who are 
interested in variations in source brightness (as in observations 
of extrasolar planet transits, etc).

The uncertainty in the measured flux density of a point source 
in a single exposure is

sigma^2 = sigma_rn^2 + sigma_s^2 + ap_fac * sigma_bg^2 + sigma_sys^2

where sigma_rn is the read noise of the detector, sigma_s is the 
Poisson noise of the source + background, sigma_bg is the 
Poisson noise of the subtracted background alone, ap_fac is 
a scaling factor accounting for the noise in the annulus used 
to estimate the background to subtract, and sigma_sys is any 
systematic/confusion error. In this memo, sigma is calculated 
for a single exposure and in the limit where sigma_sys = 0; 
therefore, sigma decreases as the square-root of the number of 
exposures.

The number of pixels (npix) contributing to the source is the 
size of the aperture used (~28.3 pixels for a 3 pixel radius 
circular aperture). Then the read noise for the source is

sigma_rn^2 = npix * sigma_readnoise^2,

where sigma_readnoise is the read noise in electrons for the 
desired frametime (see Table 6.4 of the SOM).

The term sigma_s^2 is the Poisson noise of the source plus the 
background in the aperture used. Then, sigma_s^2 = e_s + npix * e_bg, 
where e_s is the signal of the source in electrons and e_bg is 
the signal of the background per pixel in electrons.

Typically, the source flux density (fd) is given in micro-Jy. 
To convert to electrons detected, use

e_s = fd(micro-Jy) * GAIN * EXPTIME / (scale * FLUXCONV * apcorr)

where scale (34.98) converts from micro-Jy to equivalent MJy/sr, 
so that the the correct number of electrons are determined when 
using the FLUXCONV and GAIN values supplied; FLUXCONV converts 
from MJy/sr to DN/s; GAIN converts from DN to electrons; and, 
EXPTIME is the effective exposure time used.  Note that GAIN, 
EXPTIME and FLUXCONV can all be found in the headers of a BCD 
image. GAIN and FLUXCONV are constants for a given IRAC channel. 
1./apcorr is the fraction of source flux enclosed in the default 
aperture.

Simplifying the expression,

e_s = fd * EXPTIME * fd_to_e

where fd_to_e = 0.700, 0.580 electrons / (micro-Jy * sec) for 
channels 1 and 2, respectively.

Likewise, the number of electrons contributed by the background 
is given by

e_bg = background_sb * EXPTIME * sb_to_e

where the background_sb is an estimate of the surface brightness 
of the background in MJy/sr (such as the estimate given by Spot)
and sb_to_e is the scaling between surface brightness and electrons. 

The term sb_to_e = 27.546, 22.869 electrons / (MJy/sr * sec) for 
channels 1 and 2, respectively.

To be conservative, assume that the background subtraction used 
in either aperture photometry or PSF fitting contributes noise 
from the background summed over the number of noise pixels for 
the source. Then, ap_fac = npix and

sigma_bg^2 = e_bg  / nback = background_sb * EXPTIME * sb_to_e / nback

where nback is the number of pixels used in a reasonably-sized 
background annulus.

A reasonable estimate of the noise (in electron units) in a 
single exposure is then

sigma^2 = sigma_rn^2 + EXPTIME * (fd * fd_to_e + 
npix * background_sb * sb_to_e + npix * background_sb * sb_to_e / nback).

To be conservative, scale the noise upward by 30%-50% to account for 
systematics, etc.

The signal-to-noise ratio for one exposure is simply

fd * fd_to_e * EXPTIME / sigma.