The Lawfare Academy

Lawfare Group → Knowledge Institute → Lawfare Academy

← Astrophysics II: Galaxies, Observations, and Cosmology

Unit 3

Reduce a CCD exposure and measure a star

Check understanding

Why should a procedure document whether its master dark already contains bias?

  1. The digital gain numerically equals the bias in every exposure
    Feedback

    Gain maps digital units to charge. Bias is an offset that must be characterized separately.

  2. A flat field removes all additive offsets automatically
    Feedback

    Flat division corrects relative response, while offsets are additive terms dealt with separately.

  3. Subtracting both can remove the electronic offset twice
    Feedback

    A matched raw dark can include both dark and bias contributions, so the calibration must consistently represent the stored quantities.

Learning objectives

  • Apply bias, dark and flat corrections in the right order.
  • Subtract a local sky estimate in aperture photometry.
  • Relate a flux ratio to a differential magnitude and uncertainty.

A CCD converts detected photons into charge, then reports a digital value related to that charge by its gain. Its output contains the astronomical scene and instrumental effects. A bias frame measures the electronic offset. Dark frames describe exposure-dependent charge even with no incident light. Flat exposures measure relative response across the image. Master calibration frames combine multiple exposures and carry their own uncertainty. The detector mode, gain, filters, temperature, exposure history and possible saturation all affect what calibration frames are valid. Read the instrument metadata before operating on pixels.

A basic reduction for raw image S is C = (S − B − D)/F, where B is a master bias, D is a dark contribution matched to the exposure and already corrected for bias, and F is a normalized flat that is appropriately corrected. This form assumes that additive effects are removed before dividing by the multiplicative response. If a master dark already contains the bias level and is directly subtracted at matched conditions, subtracting B again would miscalibrate the image. Readout structure, bad pixels, cosmic rays, charge nonlinearities, and inconsistent illumination require additional treatment. Preserve masks for defects instead of replacing every suspicious value without a trace.

For aperture photometry, sum calibrated pixel values in a source aperture and subtract the local sky level per pixel times the effective aperture area. Estimate local sky from a surrounding annulus, rejecting contaminants and accounting for gradients. Choose an aperture large enough to include substantial source light without taking on unnecessary background and nearby objects. A neighboring star or unresolved pair can dominate systematic error. For calibrated relative magnitudes of two sources on the same scale, m₁ − m₂ = −2.5 log₁₀(F₁/F₂). Use comparable apertures or an aperture correction and account for bandpass and exposure time. Absolute photometry additionally needs a zero point and possibly extinction and color corrections.

Track how read noise, photon noise, sky estimation, and the calibration frames propagate. In electron units, ideal Poisson variance equals the expected count for the process. For independent sky and source calibrations, the sky-mean uncertainty scales with the aperture area when subtracting it. Image resampling can correlate neighboring pixel errors. Use empty comparison apertures or repeated measurements to test whether the uncertainty estimate matches observed scatter.

Open the computational workbook.

Apply the idea

A toy picture has a 5-pixel aperture whose reduced values total 2,000 electrons. The sky estimate is 100 electrons per pixel. A comparison source on the same scale has 750 net electrons. One pre-reduction pixel separately reads 1,100 units with bias 100, matched bias-free dark 20, and flat 0.98.

Correct the individual example pixel, find net aperture flux, and calculate the target’s magnitude relative to the comparison. Then identify one neglected error term.

Read the worked reasoning

The corrected example pixel is (1,100 − 100 − 20)/0.98 = 1,000 in the corresponding corrected units. Net aperture signal is 2,000 − 5 × 100 = 1,500 electrons. The magnitude difference is −2.5 log₁₀(2) ≈ −0.753 mag. The target is brighter. Errors can include the uncertainty of the sky estimate, shared calibration, and the missing light outside the two apertures.

Further reading

Compare the order of correction functions in the CCD reduction guide. In Photutils, inspect whether the aperture sum includes sky and how to supply a mask.

My learning →