---
title: "From a pupil wave to counted camera pixels"
description: "Derive a finite-band coronagraph image from complex amplitudes, a fixed angular pixel grid and photon counting."
canonical_url: "https://sandboxphysics.com/stories/direct-imaging/from-pupil-to-pixels/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/direct-imaging/from-pupil-to-pixels/"
last_modified: "2026-10-28"
---

[Direct imaging, from glare to a spectrum](https://sandboxphysics.com/stories/direct-imaging/)

L1 · Direct imaging

# From a pupil wave to counted camera pixels

Sandbox Physics · 2026-10-28

A camera count starts with a wave across the telescope pupil. Propagate that wave through the masks, square its amplitude, integrate over wavelength and pixel area, then sample the arriving photons. Keeping that order preserves the light lost at each step.

## Before you begin

Begin with The faint point that turns beside a star. You need trigonometry and the idea of area. This chapter introduces a complex amplitude as a compact way to keep wave strength and phase together; the next chapter uses rotation and averages.

## Choose the angular and detector coordinates

Put the origin at the stellar direction. The camera horizontal coordinate increases to the right and its vertical coordinate increases upwards. Source positions use those sky directions before field rotation. Detector arrays store their first row at the top, so the array row index increases in the opposite direction to the vertical coordinate.

An aperture sets a natural angular scale: wavelength divided by pupil diameter. This ratio has no length unit and gives a small angle in radians. For the eight-metre pupil and reference wavelength of 1.24 micrometres, it is about 32 milliarcseconds. A milliarcsecond is one thousandth of an arcsecond; a full degree contains 3,600 arcseconds.

The teaching camera uses one quarter of this reference angular unit per pixel. Its eighty pixels span twenty reference units. The star and all source separations use this one fixed grid, even when the wavelength changes. A changing wavelength changes the optical image, not the camera pixel size.

$$
\theta_{\rm ref}=\frac{\lambda_{\rm ref}}D=\frac{1.24\times10^{-6}\,\mathrm m}{8\,\mathrm m}=1.55\times10^{-7}\,\mathrm{rad}\simeq31.97\,\mathrm{mas}
$$

The reference angular pixel size is one quarter of this value, about 7.99 milliarcseconds. Source separation five means about 160 milliarcseconds in this synthetic instrument.

Reading: Marois et al. · Bonnefoy et al.

## Keep the phase until the waves have combined

A wave can arrive early or late compared with another wave of the same color. Phase records that fraction of a cycle. A complex amplitude packages the wave strength with two perpendicular components: cosine and sine of the phase. The imaginary unit is a way to track the second component, not an extra physical direction.

Let the pupil coordinate be a two-component position in metres, and let the source angle be a small two-component angle in radians. A tilted incoming wave has a path difference equal to their dot product. Multiply corresponding components and add them to form that dot product. An optical-path error adds another length. Dividing their sum by wavelength converts length to wave cycles; multiplying by one full turn converts cycles to phase.

The pupil transmission is one inside the circular aperture and zero outside. The adopted static path pattern has a twenty-nanometre RMS over those actual pupil samples. At the reference wavelength this gives about a tenth of a radian of phase RMS. A separate prescribed pattern changes during the sequence. These path patterns describe residual optics directly; they do not solve an atmospheric or adaptive-optics control problem.

$$
E_{\lambda,t}(\boldsymbol r;\boldsymbol\theta)=P(\boldsymbol r)\exp\!\left[\frac{2\pi i}{\lambda}\left(W_t(\boldsymbol r)+\boldsymbol r\cdot\boldsymbol\theta\right)\right]
$$

The pupil position and optical-path error have length units. Phase is dimensionless. The source angle tilts the wave across the pupil.

$$
I(\boldsymbol\alpha)=\left|\mathcal C_\lambda[E](\boldsymbol\alpha)\right|^2
$$

The linear propagation operator applies a Fourier transform, the focal mask, pupil reimaging, the Lyot stop and the final Fourier transform. Square the complex amplitude only after those operations.

Reading: Soummer · Pueyo

## Normalize to the light entering the instrument

A Fourier transform adds all pupil wave contributions with their relative phases. Its discrete normalization must preserve the corresponding total power. The teaching calculation checks that convention independently with NumPy transforms. Three successive forward lens transforms invert the final image; the named detector axes include the corresponding image reversal.

For each source, divide the final intensity by the clear entrance-pupil photon normalization. The resulting camera array gives a fraction of the incident photons per pixel. Its sum can be less than one because the masks, Lyot stop and finite camera have removed light. Dividing it again by its own transmitted sum would erase the very loss we want to measure.

The continuous pupil, focal mask and Lyot stop have circular hard edges. The grid integrates the circle’s exact area inside each cell and approximates its complex field as constant there. A 512-point transform and a 64-sample pupil are checked with independent finer calculations. In ninety-six control-corner comparisons outside three reference angular units, the largest aperture-flux correction is about 0.036 percent. The complete default spectrum changes by less than 0.05 of its quoted statistical standard error when the reference grid is refined. Nearer the mask, the camera shows the fading source while the spectral analysis is withheld.

The star and companion each have a coherent wave across the pupil, but their optical phases are mutually uncorrelated over the exposure. Their time-averaged intensities therefore add. Adding the amplitudes first would create interference fringes between independent astronomical sources.

$$
p_{\star,t\ell p}+c_\ell p_{{\rm s},t\ell p},\qquad\sum_p p_{{\rm s},t\ell p}\leq1
$$

Each camera PSF uses the same entrance normalization. The contrast compares source and stellar incident photon numbers in that narrow band; the inequality includes optical and finite-camera losses.

Reading: Soummer · Bonnefoy et al.

## Integrate a color before counting it

A channel admits a short interval of wavelengths. Its integral adds the contributions from very narrow wavelength slices. An energy spectral density describes energy per wavelength; dividing photon energy into it gives photon number. Longer-wavelength photons carry less energy, so the photon-weighted response contains a factor of wavelength. The simulation adopts a flat energy density within each 0.02-micrometre top-hat band and a constant source contrast inside that band.

Three Gauss nodes approximate this band integral; five-node comparisons measure the quadrature error. The stellar normalization is thirty million potential photoelectrons per channel and exposure, with unit quantum efficiency in this teaching convention. It already includes the integral over the band. Multiplying by wavelength a second time after that normalization would count the photon conversion twice.

A native Fourier focal grid scales with wavelength. The fixed camera integrates over the same angular pixel at every wavelength. At four Gauss nodes inside each pixel, the calculation interpolates the complex amplitude, takes its squared magnitude and adds the weighted intensities. The area Jacobian converts native sampling to physical camera area. This is the same distinction as changing the size of a bucket: surface brightness and photons per bucket transform differently.

$$
\bar p_{t\ell p}=\frac{\int_{\ell}T_\ell(\lambda)F_\lambda\lambda\,p_{t\lambda p}\,d\lambda}{\int_{\ell}T_\ell(\lambda)F_\lambda\lambda\,d\lambda}
$$

The factor involving Planck constant and light speed cancels between numerator and denominator. The transmission is a rectangular band here. The normalized band PSF is dimensionless per camera pixel.

Reading: Bonnefoy et al. · Samland et al.

## A worked count estimate from the saved observation

Consider the first band of the default synthetic sequence. Its entrance contrast is 0.002, so thirty million stellar photon equivalents correspond to sixty thousand source photons before the coronagraph. About two thirds reach this finite camera in the off-axis source model. The camera therefore receives roughly forty thousand source electrons, distributed across the PSF.

Each pixel also receives a five-electron background. It samples a Poisson count with its own expected total, then adds independent read noise with a two-electron standard deviation. Independent photon arrivals during a fixed exposure are modeled by the Poisson law. A Poisson variable has variance equal to its mean; the read variance adds four squared electrons. Keep the source contribution in that variance, even if the comparison ring contains only stellar background.

The saved seed fixes one observed realization. Repeating the calculation with a new noise seed changes the counts and the extracted spectrum, while the optical expectation stays the same. That separation supplies the repeated-acquisition test in the third chapter.

$$
\mu_{t\ell p}=N_\star\left(\bar p_{\star,t\ell p}+c_\ell\bar p_{{\rm s},t\ell p}\right)+b,\quad\operatorname{Var}(D_{t\ell p})=\mu_{t\ell p}+\sigma_{\rm r}^2
$$

Counts use electrons per pixel per exposure. The sequence has eighteen one-second exposures at two-minute intervals. Finite shutter-angle smear is neglected in this synthetic camera.

| Saved default input | Value | Meaning |
| --- | --- | --- |
| Reference wavelength | 1.24 micrometres | Fixed angular scale |
| Pupil diameter | 8 metres | Circular entrance |
| Stellar photon equivalent | 30 million per band | Before coronagraph losses |
| First-band source contrast | 0.002 | Sixty thousand entrance photons |
| Read noise | 2 electrons RMS | Independent per pixel |
| Noise seed | 22022 | One saved synthetic acquisition |

Reading: Bonnefoy et al. · Greco & Brandt

## Try the observation

### [Connect the conjugate planes to the sampled camera](https://sandboxphysics.com/labs/pupil-engineering-coronagraph/)

1. Open Optical bench and follow the entrance pupil, focal mask, Lyot stop and final camera in that order.
2. Return to Observe a companion. Predict which features broaden at the longer camera band, then compare the first and last bands.
3. Keep the source position fixed and increase static optical-path RMS. Describe the change in stellar leakage before reading the extracted spectrum.

## Exercises and explained answers

At the same wavelength, what changes if the pupil diameter doubles but the physical angular camera pixels stay fixed?

The diffraction angle halves, so a PSF occupies roughly half as many pixels across. The sky source stays at its original angular pixel position. A new pupil propagation and pixel integral are needed; shrinking the displayed source separation would change the astronomical scene.

A source PSF sums to 0.67. A colleague normalizes it to one before generating the counts. What happens to the inferred entrance contrast?

The model now predicts too many detected photons at a given entrance contrast. Fitting the same observation gives about 0.67 times the true entrance contrast, if every other part of the response is unchanged. The missing transmission belongs in the model normalization.

A pixel expects twenty-five electrons and has two-electron read noise. What is its standard deviation?

Independent variances add: $\sqrt{25+2^2}=\sqrt{29}\simeq5.39\,\mathrm e^-$. Add the two variances first, then take their square root.

[Previous: The faint point that turns beside a star](https://sandboxphysics.com/stories/direct-imaging/the-point-that-turns/) [Next: Why subtracting a halo also subtracts a companion](https://sandboxphysics.com/stories/direct-imaging/rotation-and-self-subtraction/)

## Sources and calculation scope

1. [Marois et al., Angular Differential Imaging (2006)](https://arxiv.org/abs/astro-ph/0512335v1)

   Fixed v1, observing geometry and reference subtraction. Field rotation supplies diversity between an astronomical source and pupil-fixed structure.

2. [Soummer, Pueyo & Larkin, KLIP (2012)](https://arxiv.org/abs/1207.4197v1)

   Fixed v1, Sections 2.1–2.3 and 3.1, Equations 5–12, Figures 1–2. The reference library, eigenimages and projection define a particular subtraction operator.

3. [Pueyo, Detection and Characterization of Exoplanets Using Projections on Karhunen–Loève Eigenimages (2016)](https://arxiv.org/abs/1604.06097v1)

   Fixed v1, Sections 2.1–2.5, 3.1–3.3 and 4.1–4.2; Appendix E, Equations E18/E20, and Appendix F, Equations F8–F12. Source contamination changes the reference basis. The illustrative J-band spectra use synthetic injections.

4. [Greco & Brandt, The Measurement, Treatment, and Impact of Spectral Covariance and Bayesian Priors in Integral-Field Spectroscopy of Exoplanets (2016)](https://arxiv.org/abs/1602.00691v1)

   Fixed v1, Section 2, Equations 1–6; Sections 3.1–3.2, Equations 7–8. Spectral covariance changes the weighting of broad spectral structures.

5. [Bonnefoy et al., Physical and orbital properties of beta Pictoris b (2014)](https://arxiv.org/abs/1407.4001v1)

   Fixed v1, Section 2 and Table 1. Nineteen J-band exposures, satellite-spot calibration and the adopted stellar spectrum belong to the published analysis; the tutorial selects three later-reduced public cubes.

6. [Samland et al., Spectral cube extraction for the VLT/SPHERE IFS (2022)](https://arxiv.org/abs/2210.06390v1)

   Fixed v1, Sections 3.4, 4.2–4.3, 4.6, 5.2–5.3 and 6. Raw-detector PSFlet fitting and spectral cross-talk occur upstream of the already-reduced GPI cubes used here.
