---
title: "Crowded-star Photometry Interactive Lab | Sandbox Physics"
description: "Can a neighboring star make a steady star look brighter? Yes. A circular aperture also collects light spread from nearby stars."
canonical_url: "https://sandboxphysics.com/labs/crowded-star-photometry/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/crowded-star-photometry/"
last_modified: "2026-10-28"
---

AC02 · Counting starlight

# Crowded-star Photometry

**Can a neighboring star make a steady star look brighter?** Yes. A circular aperture also collects light spread from nearby stars. Fitting the shapes of both stars can separate their light, but the uncertainty grows as their images overlap.

Drag the amber star into the cyan aperture and watch its light enter the measurement. Compare a circular aperture with a two-star fit to the same noisy detector pixels.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Model assumptions

This detector is simulated. Both stars have a known circular Gaussian point-spread function and known positions. Each pixel integrates that profile, then receives independent Poisson photoelectrons and Gaussian read noise. The aperture uses fractional pixel areas and an exact-model aperture correction; the fit solves both fluxes and a constant sky jointly, with true model variances supplied as weights. These favorable assumptions omit PSF errors, saturation, cosmic rays, flat-field errors and interpixel correlations. The cyan star varies sinusoidally for the demonstration; time is accelerated. The separate TESS tutorial uses measured, already background-subtracted SPOC pixels.

## Follow one star through the measurements

White: injected target flux. Cyan: the two-star fit. Amber: aperture flux with the known target aperture correction. All values are photoelectrons per simulated exposure.

Repeated simulated exposures $F\;[\mathrm e^{-}]$

What the uncertainty includes

The quoted fit error comes from the weighted linear fit to the two pixel-integrated Gaussian profiles and a constant background. Photon and read noise are included. Source positions, profile width and weights are supplied by the generating model. Uncertainty in those inputs would increase the error in a real observation. Aperture leakage is an ideal contribution from the neighbor, corrected by the same target enclosed fraction as the aperture flux.

The detector uses one false-color scale for acquired simulated pixel counts. For display only, the known input sky is removed, negative remaining values use the darkest display color, and an asinh stretch runs from dark blue to white with a ceiling one thousand electrons above the sky. Cyan and amber mark the supplied aperture and star positions. Stored pixels and both measurements retain the original counts.

$$
\widehat{\boldsymbol f}=(A^{\mathsf T}WA)^{-1}A^{\mathsf T}W\boldsymbol y,\qquad\operatorname{Cov}(\widehat{\boldsymbol f})=(A^{\mathsf T}WA)^{-1}
$$

Physics tutorial

## Separating two overlapping pools of light

**Background** A telescope spreads the light of a star across several pixels. In a crowded field, the wings of one stellar image reach another. A circle around the target then counts some light from both stars.

**Why it matters** A small aperture loses target light. A large aperture admits more sky and neighbors. Knowing the shape of each stellar image offers another way to estimate the brightness.

Start with the essentials

- **Focus question**: How does the same detector image give two different brightness estimates?
- **One-sentence intuition**: An aperture adds pixels inside a boundary; a two-star fit uses their spatial pattern to divide the light.

### Core mathematical model

#### Light in each detector pixel

$$
y_i=F_{\mathrm t}P_{i\mathrm t}+F_{\mathrm n}P_{i\mathrm n}+B+\epsilon_i
$$

The target and neighbor contribute their total photoelectrons times the fraction falling in pixel i. The constant sky adds photoelectrons to every pixel; noise fluctuates around this mean.

#### Aperture correction

$$
\widehat F_{\mathrm{ap}}=\frac{\sum_i w_i(y_i-\widehat B)}{\sum_i w_iP_{i\mathrm t}}
$$

A pixel weight is the fraction of its area covered by the aperture. The denominator is the target profile fraction captured with those weights. It corrects target light loss; neighbor light remains in the numerator.

#### Noise of a pixel

$$
\operatorname{Var}(y_i)=F_{\mathrm t}P_{i\mathrm t}+F_{\mathrm n}P_{i\mathrm n}+B+\sigma_{\mathrm{read}}^2
$$

Independent Poisson electrons have variance equal to their expected count. The readout contributes an independent variance. The simulation supplies this true variance to the fit.

### Common difficulties

#### More pixels do not always improve the measurement

**Typical misconception** The widest aperture is best because it catches more target light.

**Better mental model** The outer pixels contain progressively less target light, but still add background noise and neighbor light. Try changing only the radius and compare the corrected aperture flux with the injected white curve.

### Run the experiment

1. 01

   #### Move the neighbor away

   Select A star on its own, then drag the amber star toward the cyan aperture.

   **What to observe:** The aperture estimate rises as neighbor light enters. The two-star fit still follows the injected target flux.

2. 02

   #### Blur the images together

   Choose Two images merge and reduce Star separation. Compare the fit uncertainty with the isolated preset.

   **What to observe:** The two profiles become harder to distinguish. The fit can remain unbiased while its uncertainty increases.

3. 03

   #### Give the sky the wrong value

   Choose Subtract too much sky. Open Background error and vary only Extra sky subtraction per pixel.

   **What to observe:** The aperture estimate falls because every covered pixel loses extra electrons. The fit solves its own constant background from the image.

Physical conclusion

A good brightness measurement needs a model of which light belongs to the target, and an uncertainty that includes the difficulty of separating its neighbors.

## Related experiments and articles

Continue exploring

### Measuring the sky

What do positions, colors, interference and radio delays reveal about the sky?

1. [Lab **Observing Cadence and Aliases** Move exposures and compare the rhythms that survive the sampling.](https://sandboxphysics.com/labs/observing-cadence-aliases/)
2. [Lab **Supernova Distances and the Distance Ladder** Move a geometric distance anchor and follow its shared calibration error.](https://sandboxphysics.com/labs/supernova-distance-expansion/)
3. [Lab **Stellar Parallax and Proper Motion** Change the stellar distance and follow its annual motion.](https://sandboxphysics.com/labs/stellar-parallax-proper-motion/)
4. [You are here **Crowded-star Photometry** Move the aperture and compare the light admitted from neighbouring stars.](https://sandboxphysics.com/labs/crowded-star-photometry/)
5. [Lab **Stellar Absorption Lines** Change the gas temperature and velocity, then compare the absorption lines.](https://sandboxphysics.com/labs/stellar-absorption-lines/)
6. [Lab **Galaxy Colors and Photometric Redshift** Compare redshift, dust and stellar-population effects in the same five bands.](https://sandboxphysics.com/labs/galaxy-colors-photometric-redshift/)
7. [Lab **Stellar Interferometry and Sparse Imaging** Move a telescope and compare images fitted to the same sparse signals.](https://sandboxphysics.com/labs/stellar-interferometer/)
8. [Lab **Interstellar Radio Propagation** Change the electron column and field, then follow the arriving radio pulse.](https://sandboxphysics.com/labs/interstellar-radio-propagation/)

Measuring starlight in crowded fields · Reading path

### Measuring starlight in crowded fields

Articles on this path that use this experiment, followed by the other experiments they suggest.

1. [Article **Did the star really fade?**](https://sandboxphysics.com/stories/stellar-photometry/whose-light/)
2. [Article **From one photoelectron to an aperture of pixels**](https://sandboxphysics.com/stories/stellar-photometry/counting-photons/)
3. [Article **One pixel can contain light from two stars**](https://sandboxphysics.com/stories/stellar-photometry/separating-stars/)
4. [Article **Extract TESS brightness from twelve pixels**](https://sandboxphysics.com/stories/stellar-photometry/tess-pixels/)
5. [Article **Read the residuals in deblending and difference images**](https://sandboxphysics.com/stories/stellar-photometry/reading-crowded-images/)

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
