---
title: "Galaxy Colors and Photometric Redshift Interactive Lab | Sandbox Physics"
description: "Is a red galaxy distant, old, or dusty? All three can redden a galaxy."
canonical_url: "https://sandboxphysics.com/labs/galaxy-colors-photometric-redshift/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/galaxy-colors-photometric-redshift/"
last_modified: "2026-10-28"
---

AC04 · Five filters, several possible distances

# Galaxy Colors and Photometric Redshift

**Is a red galaxy distant, old, or dusty?** All three can redden a galaxy. Redshift moves spectral features between filters, old stars supply less blue light, and dust absorbs more short-wavelength light. Several colors help separate these causes; some galaxies still allow more than one distance.

Drag a galaxy to redshift its light. Change its stellar population and dust, watch five detector planes respond, and follow every peak of the inferred redshift distribution.

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

Model assumptions

The synthetic observation uses seven solar-metallicity BC03 single-burst stellar populations with a Salpeter IMF, six Calzetti continuum attenuation values and measured SDSS2010 filter throughputs. Stellar age means the age of this particular population model. Redshift is restricted to zero through 1.2; templates older than the assumed universe are excluded. The observed r-band normalization stays fixed as colors change. The virtual photometer has five equal optical branches; each receives one fifth of a one-square-metre collecting area; detector images share an illustrative fixed morphology and show mean photon intensity in false color. Symbolic moving photons illustrate the optical paths; dust markers show the attenuation setting. A proper half-normal amplitude prior is integrated analytically; age and dust are summed, and the full redshift posterior is normalized. Synthetic errors are independent Gaussian flux errors. Metallicity variation, composite star-formation histories, emission lines, intergalactic absorption and cross-band calibration covariance are omitted. The companion tutorial treats a separately frozen, real SDSS DR17 sample.

## Five measurements become several possible redshifts

Colored dots are synthetic fluxes with one-standard-deviation errors; white squares show the template fitted at the tallest posterior peak. Gray is the generating spectrum; gold marks the selected true redshift.

Spectrum and integrated filter fluxes$\langle f_\nu\rangle_b=\frac{\int f_\nu(\lambda)T_b(\lambda)\,d\lambda/\lambda}{\int T_b(\lambda)\,d\lambda/\lambda}$

Full redshift posterior; nuisance parameters integrated$\int_0^{1.2}p(z\mid\boldsymbol f)\,dz=1$

Counts, errors and model resolution

Conditional fit at the highest peak: population age $2.15\,\mathrm{Gyr}$, continuum color excess $0.1$, squared standardized residual sum $2.17$.The central interval can include a valley between peaks.

Mean photon rates in the five equal optical branches:

- $\dot N_u=0.526\,\mathrm{s^{-1}}$
- $\dot N_g=26.1\,\mathrm{s^{-1}}$
- $\dot N_r=98.7\,\mathrm{s^{-1}}$
- $\dot N_i=121\,\mathrm{s^{-1}}$
- $\dot N_z=27.5\,\mathrm{s^{-1}}$

Collecting area is one square metre before equal splitting; additional optical efficiency is unity. Detector brightness uses a fixed nonlinear compression.

The source spectra retain the native BC03 wavelength sampling. Filter integrals use four-Angstrom observed-wavelength steps. Four independent off-node quadrature comparisons at half-Angstrom steps have a largest tested difference of about 0.0195% in tested band ratios. This is a tested numerical difference, not a bound on stellar-population accuracy.

The redshift grid spacing is 0.005. Stellar ages are discrete from one hundred million to ten billion years; continuum color excess runs from zero to 0.5 in steps of 0.1. The age prior is uniform over allowed age nodes at each redshift. The synthetic r-band mean is one hundred nanomaggies. Relative measurement errors are eight, three and a half, three, three and a half and five percent, with an additional half-nanomaggy floor. Turning off u removes that measurement from inference.

[BC03](https://arxiv.org/abs/astro-ph/0309134v1) · [SDSS response](https://arxiv.org/abs/1002.3701v1) · [EAZY](https://arxiv.org/abs/0807.1533v1)

Physics tutorial

## How five colors become a redshift distribution

**Background** A broad filter adds the light across a range of wavelengths. A galaxy spectrum contains changes of slope and many absorption features. Moving these features through neighboring filters changes their relative signals.

**Why it matters** Spectra can identify narrow lines, but taking spectra for every faint galaxy is expensive. Images through several filters offer a faster, less precise distance clue. Their uncertainty often has several peaks.

Start with the essentials

- **Focus question**: Which color change moves a spectral feature, and which only changes its strength?
- **One-sentence intuition**: Redshift stretches wavelengths; age and dust reshape the light already present. Several combinations can reproduce the same five fluxes.

### Core mathematical model

#### Stretch the wavelength

$$
\lambda_{\mathrm{obs}}=(1+z)\lambda_{\mathrm{rest}}
$$

The broad absorption break near four thousand Angstrom moves to six thousand Angstrom at redshift one half. Dust attenuates the spectrum at its rest wavelength before this shift.

#### Count the photons a filter transmits

$$
\dot N_b=\frac{A_{\mathrm{tel}}}{5h}\int f_\nu(\lambda)T_b(\lambda)\,\frac{d\lambda}{\lambda}
$$

The five equal branches share the collecting area. The throughput includes the detector response and the reference atmosphere. The displayed images apply the same fixed nonlinear intensity mapping to these rates.

#### Sum the alternative explanations

$$
p(z\mid\boldsymbol f)\propto p(z)\sum_{t,E}p(t,E\mid z)\int_0^\infty p(\boldsymbol f\mid z,t,E,A)\,p(A)\,dA
$$

The amplitude is positive with a proper half-normal prior. The sum uses equal discrete weights for allowed ages and dust nodes. A uniform redshift prior is confined to the displayed interval; the curve is normalized by its numerical integral.

### Common difficulties

#### The brightest redshift peak can change suddenly

**Typical misconception** A small flux change must cause only a small change in the reported redshift.

**Better mental model** Two separated peaks can be almost equally high. A small change makes the other peak taller even though both peaks were present before. Compare their integrated probability and the full curve.

### Run the experiment

1. 01

   #### Move the break

   Start with A break crosses the filters. Predict which detector gains signal as the redshift grows, then drag the galaxy to the right.

   **What to observe:** The source keeps the same r-band normalization. Its other band ratios change as the break moves through their measured responses.

2. 02

   #### Redden the source locally

   Compare Young stars behind dust with An old stellar population. Keep their low redshift fixed and compare the generating spectra below.

   **What to observe:** Both lose blue light, but age changes the intrinsic stellar spectrum and dust attenuates it smoothly. Their broad-band colors can still be similar.

3. 03

   #### Lose a measurement

   Select The blue detector goes dark. Compare the full posterior with the default case before resetting.

   **What to observe:** The highest peak moves from about 0.32 to 0.545 for these fixed noise draws. The larger interval and surviving lower-redshift peak show what the missing information had supplied.

Physical conclusion

Keep the entire redshift probability curve. A tall peak, a broad interval and a secondary peak answer different questions about the same measurements.

## 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. [Lab **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. [You are here **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/)

Galaxy colors and redshift · Reading path

### Galaxy colors and redshift

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

1. [Article **Why a red galaxy can have several possible distances**](https://sandboxphysics.com/stories/galaxy-colors/why-galaxies-look-red/)
2. [Article **What a filter measures when a detector counts photons**](https://sandboxphysics.com/stories/galaxy-colors/counting-light-through-filters/)
3. [Article **Redshift stretches a spectrum and dust reshapes it**](https://sandboxphysics.com/stories/galaxy-colors/dust-and-moving-spectra/)
4. [Article **Keep both answers when a redshift distribution has two peaks**](https://sandboxphysics.com/stories/galaxy-colors/when-redshift-has-two-answers/)
5. [Article **Reproduce redshift distributions for twenty-four real SDSS galaxies**](https://sandboxphysics.com/stories/galaxy-colors/sdss-five-band-tutorial/)
6. [Article **Read EAZY and a Euclid calibration paper with the selection visible**](https://sandboxphysics.com/stories/galaxy-colors/reading-photoz-reliability/)

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)
