phot.apphot.apphot_annulus

phot.apphot.apphot_annulus(
    ccd,
    aperture,
    annulus=None,
    gain='GAIN',
    rdnoise='RDNOISE',
    t_exposure=None,
    exposure_key='EXPTIME',
    error=None,
    mask=None,
    sky_keys=None,
    sky_min=None,
    npix_mask_ap=2,
    pandas=True,
    **kwargs,
)

Measure aperture fluxes with an optional annular sky estimate.

Parameters

ccd : ~astropy.nddata.CCDData

Image data, preferably in ADU.

aperture : astroapers aperture or list of such

Aperture(s) and the optional sky annulus for the measurement.

Note

For multiple positions, use one aperture with multiple positions, for example aap.CircAp(positions, r=10). For multiple radii, use, e.g., [aap.CircAp(positions, r=r) for r in radii].

annulus : astroapers aperture or list of such

Aperture(s) and the optional sky annulus for the measurement.

Note

For multiple positions, use one aperture with multiple positions, for example aap.CircAp(positions, r=10). For multiple radii, use, e.g., [aap.CircAp(positions, r=r) for r in radii].

gain : (str, float) = 'GAIN'

CCD gain in electrons per ADU. A string names the header keyword; a missing keyword defaults to 1. A float is used directly. Used only when error is None. Default is "GAIN".

rdnoise : (str, float) = 'RDNOISE'

Read noise in electrons. A string names the header keyword; a missing keyword defaults to 0. A float is used directly. Used only when error is None. Default is "RDNOISE".

t_exposure : float = None

Exposure time used to scale the reported magnitude. If None, read exposure_key from a CCDData header; otherwise the fallback is 1.

exposure_key : str = 'EXPTIME'

Header keyword for the exposure time when t_exposure is None. Ignored when t_exposure is supplied. Default is "EXPTIME".

error : array-like or ~astropy.units.Quantity = None

Pixel-wise error map to propagate to source-sum and magnitude errors.

sky_keys : dict = None

Keyword arguments for sky_fit. If None, use 3-sigma, 5-iteration clipping with ddof=1 and the SExtractor sky estimator; see ~astroimred.phot.background.sky_fit.

sky_min : float = None

Minimum sky value used for sky subtraction.

npix_mask_ap : int = 2

Mark "bad" as 1 when weighted masked aperture support exceeds this value.

Note

The annulus is not checked; this applies only to the aperture.

pandas : bool = True

Return a ~pandas.DataFrame when True; otherwise return a QTable. Default is True.

****kwargs** : = {}

Reserved for backward compatibility. Supply method here to select "exact" (default) or "center" aperture sampling.

Returns

phot_f : pandas.DataFrame or astropy.table.QTable

Photometry results. The bad column is 1 when weighted masked aperture support exceeds npix_mask_ap, and 0 otherwise. The return type follows pandas.

Notes

srcsum = apsum - apsum_npix*msky, and

``srcsum_err**2 = apsum_err**2 + (apsum_npix * dsky)**2``.

apsum = sum(w * data) with exact pixel-overlap weights w holds both the source and the sky signal inside the aperture, so apsum_err**2 = sum(w**2 * error**2) holds the noise of both, and no separate in-aperture sky-noise term is added. apsum_npix = sum(w) is the in-image, unmasked aperture support. dsky is the standard error of msky from sky_fit. A user-supplied error without sky noise underestimates srcsum_err. Both terms assume independent pixel noise.

Without error, use error=sqrt(data/gain + (rdnoise/gain)**2) on the image before sky subtraction, so sky photon noise is included. This assumes dark current is zero and ignores digitization error; see Merline & Howell (1995), ExpA.