Why can one patch of sky have so many different images?

One image shows a grainy grey patch; another reveals bright stars and coloured clouds. Must the second telescope have collected more light? Perhaps. But the two images could come from the same numbers, corrected for systematic contributions and displayed in different ways.

An astronomical image is a way to display measurements. Calibration accounts for the instrument’s response, registration links coordinates, stacking combines exposures, and a colour map assigns visible colours to numbers. None of these steps by itself turns something unmeasured into a measurement. We need to examine the whole path, beyond the appeal of the final picture.

We will follow that path using a real, openly available fragment of a Palomar CCD frame. Separate synthetic examples clarify noise and outliers; they are explicitly labelled and do not replace observations. A useful prerequisite is detectors and scientific instruments. Visible branches add algebra, while the main answer remains readable without it.

From plate to file: an observation can be read again

Photography made it possible to preserve a celestial scene after the observer stepped away from the telescope. The development of dry gelatin plates in the 1870s made astronomical photography easier; archives preserved material for later comparisons. Yet the density of a darkened emulsion is not already a calibrated linear flux scale: the recording method also needs to be understood. Harvard Wolbach: collection history.

An electronic array directly provides a grid of numbers that can be processed arithmetically and stored with accompanying parameters. Another problem emerged: how could they be transferred between incompatible computers? The basic FITS agreement was developed in 1979; institutions successfully exchanged files that year, and Wells, Greisen and Harten published the description in 1981. NASA: the origins of FITS.

FITS stores numerical arrays or tables together with headers describing the data. These can hold a two-dimensional frame, a spectrum, a cube or an event list. A JPEG generally stores an already selected display, often with losses. The attractive picture file and the file used to check a measurement therefore serve different purposes. The FITS format itself does not guarantee correct calibration. NASA: what FITS contains.

Our example has named authors, a date and limits

We use Erik Tollerud and Matthew Craig, Palomar LFC chip 0, DOI 10.5281/zenodo.3254683, published on 24 June 2019 under CC BY 4.0. These are real raw bias, dark, flat and science frames selected for teaching. We show our reduction of a small fragment; the dataset authors made the original observations. Dataset and reuse rights, Astropy’s example description.

The science file ccd.037.0.fits contains a field named vv124_1, filter g′, and an exposure of 300.062 s from 16 January 2016. The original array contains 2080×4128 samples. We take a 32×32 region: x from 378 inclusive to 410 exclusive, y from 776 to 808, counting from zero. The same rectangle remains at every stage; the first row is displayed at the top without claiming that it points north.

The dataset has only one science exposure each in g′ and i′. We will not average them as repeated exposures in one filter. The dark frames were obtained in March, later than the January sky exposure, and the relevant headers contain no temperature. This lets us reproduce the documented teaching procedure, but does not establish camera stability or the accuracy of absolute photometry. An honest example has precisely that limit. Astropy: dataset contents and calibration sequence.

A pixel count is not yet the flux from a star

Light creates charge, the electronics read it, and a converter records a count in ADU, units of digital code. Sky, dark current, electronic offset and random fluctuations contribute alongside the useful signal. Pixel sensitivity and illumination through the optics are also uneven. A brighter raw pixel therefore does not always mean a brighter patch of sky. Astropy: the components of a CCD image.

The file’s encoding is a separate issue. In our FITS file, a stored signed 16-bit number is transformed using BSCALE=1, BZERO=32768. This represents nonnegative counts; it is not the camera’s physical bias. Subtracting BZERO as “extra light” after correctly reading the file would damage the data. Astropy: scaled FITS data.

We continue in ADU and do not invent a more precise conversion to electrons or energy. The header contains a nominal gain of 1.1 e⁻/ADU, but we have not independently measured it. Even after calibration, an individual pixel includes both star and sky; it is not a finished stellar luminosity measurement.

A service region provides a reference for the electronic zero

Part of a CCD’s readout array is not used as an ordinary sky image. A suitable overscan region helps estimate the electronic level for that readout. It has noise too, so a single random sample should not be treated as the exact zero of the whole camera.

For this LFC, the documentation recommends taking the median of 25 columns x=2055…2079 in each row, subtracting it from that row’s pixels and removing the service columns from the image. The nominal BIASSEC in the header starts earlier, but its first columns are contaminated by light leakage. Blindly following the header here is less reliable than checking documentation and the frame’s profile. Astropy: examining LFC overscan, ccdproc’s row-median definition.

In our check pixel’s row, the median is 1116 ADU. The raw value of 3338 ADU becomes 2222 ADU after this correction. The star is not being “amplified”: the zero point is changing. This rule applies to this dataset; another camera may have unusable overscan or an entirely different readout scheme.

Branch · With equationsOptional: algebra explains the units and limits of the corrections.

Why subtract an offset but divide by a flat?

For a simple linear detector, let the raw count R and bias B be in ADU, dark-signal rate d in ADU/s, time t in s, and relative response F dimensionless. The estimated signal including sky is then:

C = (R − B − td)/(F).

Offset and dark signal are added to the count, so we subtract them. The response multiplies the light contribution, so we divide by it. At F = 1 the flat changes nothing; at F = 0 division cannot recover a signal the detector did not measure. This model excludes saturation, nonlinearity, detector memory and correlations among all corrections. Astropy: calibration equations.

Our procedure uses row overscan O and combined dark D instead of separate B and td. The combined dark already contains the residual bias after its own overscan correction. The equation becomes C = (R − O − D)/F. A separate bias is not subtracted again, and a whole dark containing bias is not scaled in proportion to time. Scaling requires a different, consistent procedure with bias separated first.

If R,O,D,F are treated as independent, with A = R − O − D, first-order propagation of small errors gives:

(σ_(A))^(2) = (σ_(R))^(2) + (σ_(O))^(2) + (σ_(D))^(2),; (σ_(C))^(2) ≈ ((σ_(A))^(2))/((F)^(2)) + ((A)^(2)(σ_(F))^(2))/((F)^(4)).

All terms have units of ADU²; the flat uncertainty is multiplied by the squared signal. In real reduction, shared reference frames, normalisation and overscan create correlations, requiring covariance terms as well. This is a teaching equation, not a completed estimate of the full uncertainty in our frame.

Dark frames and flats must match the measurement

A dark is taken without scene light to estimate contributions from the detector and electronics. For our science frame, we take three 300 s dark frames, subtract each one’s overscan and calculate their mean. The three g′ flats have their own three 70 s dark frames. Following the guide, we accept exposure differences up to 0.062 s as a small teaching approximation without scaling the darks. EXPTIME and the separate DARKTIME header keyword describe different quantities; this procedure uses EXPTIME.

A flat images an approximately uniformly illuminated field through the relevant optical system and filter. It records relative unevenness: sensitivity, vignetting and dust shadows. The flat itself must first be corrected for additive contributions. Otherwise, we would be trying to correct light sensitivity using an electronic offset. Astropy: calibrating this dataset’s flats.

In our small example, we divide each corrected flat by its mean within the same 32×32 rectangle, then average the three relative maps. This is our local normalisation, not the guide’s full pipeline with normalisation and outlier rejection across the whole detector. The mean response becomes 1; we have not measured overall quantum efficiency or telescope losses. Different filters require separate flats. Astropy: combining flats.

Follow the same rectangle instead of swapping the picture

We now have the raw crop, the crop after row overscan, after combined dark, and after division by the flat. The first four panels use one shared linear scale of 0–4000 ADU. Small corrections really do look small: the figure does not magnify them with hidden, separate automatic stretches. The fifth panel changes only how the final numbers are displayed, making faint levels easier to distinguish.

One real fragment at every stage

1. Raw counts

Raw counts · Data: Erik Tollerud and Matthew Craig, Palomar LFC chip 0, CC BY 4.0; our local reduction. Science ccd.037.0.fits, g′, 300.062 s, 16 January 2016. A 32×32 crop: zero-based x378:410, y776:808, upper bounds excluded. First row at the top; not north-up. The first four panels share a linear 0–4000 ADU → black–white mapping; the fifth shows the same final numbers using asinh(10q)/asinh(10). Enlarged pixels without interpolation. Sky remains; not absolute photometry. The flat is normalised only within this crop; darks are from March and headers lack temperature. These are limits of the teaching example, not evidence of camera stability.

Linear · 0–4000 ADU

2. Row overscan removed

Row overscan removed · Data: Erik Tollerud and Matthew Craig, Palomar LFC chip 0, CC BY 4.0; our local reduction. Science ccd.037.0.fits, g′, 300.062 s, 16 January 2016. A 32×32 crop: zero-based x378:410, y776:808, upper bounds excluded. First row at the top; not north-up. The first four panels share a linear 0–4000 ADU → black–white mapping; the fifth shows the same final numbers using asinh(10q)/asinh(10). Enlarged pixels without interpolation. Sky remains; not absolute photometry. The flat is normalised only within this crop; darks are from March and headers lack temperature. These are limits of the teaching example, not evidence of camera stability.

Linear · 0–4000 ADU

3. Combined dark removed

Combined dark removed · Data: Erik Tollerud and Matthew Craig, Palomar LFC chip 0, CC BY 4.0; our local reduction. Science ccd.037.0.fits, g′, 300.062 s, 16 January 2016. A 32×32 crop: zero-based x378:410, y776:808, upper bounds excluded. First row at the top; not north-up. The first four panels share a linear 0–4000 ADU → black–white mapping; the fifth shows the same final numbers using asinh(10q)/asinh(10). Enlarged pixels without interpolation. Sky remains; not absolute photometry. The flat is normalised only within this crop; darks are from March and headers lack temperature. These are limits of the teaching example, not evidence of camera stability.

Linear · 0–4000 ADU

4. Flat corrected

Flat corrected · Data: Erik Tollerud and Matthew Craig, Palomar LFC chip 0, CC BY 4.0; our local reduction. Science ccd.037.0.fits, g′, 300.062 s, 16 January 2016. A 32×32 crop: zero-based x378:410, y776:808, upper bounds excluded. First row at the top; not north-up. The first four panels share a linear 0–4000 ADU → black–white mapping; the fifth shows the same final numbers using asinh(10q)/asinh(10). Enlarged pixels without interpolation. Sky remains; not absolute photometry. The flat is normalised only within this crop; darks are from March and headers lack temperature. These are limits of the teaching example, not evidence of camera stability.

Linear · 0–4000 ADU

5. Same data · asinh

Same data · asinh · Data: Erik Tollerud and Matthew Craig, Palomar LFC chip 0, CC BY 4.0; our local reduction. Science ccd.037.0.fits, g′, 300.062 s, 16 January 2016. A 32×32 crop: zero-based x378:410, y776:808, upper bounds excluded. First row at the top; not north-up. The first four panels share a linear 0–4000 ADU → black–white mapping; the fifth shows the same final numbers using asinh(10q)/asinh(10). Enlarged pixels without interpolation. Sky remains; not absolute photometry. The flat is normalised only within this crop; darks are from March and headers lack temperature. These are limits of the teaching example, not evidence of camera stability.

Nonlinear · 0–4000 ADU

Data: Erik Tollerud and Matthew Craig, Palomar LFC chip 0, CC BY 4.0; our local reduction. Science ccd.037.0.fits, g′, 300.062 s, 16 January 2016. A 32×32 crop: zero-based x378:410, y776:808, upper bounds excluded. First row at the top; not north-up. The first four panels share a linear 0–4000 ADU → black–white mapping; the fifth shows the same final numbers using asinh(10q)/asinh(10). Enlarged pixels without interpolation. Sky remains; not absolute photometry. The flat is normalised only within this crop; darks are from March and headers lack temperature. These are limits of the teaching example, not evidence of camera stability. Data and method

The ordinary mean of three calibration frames reduces some random uncertainty, but does not make a reference noiseless or guarantee freedom from outliers. We do not present it as a production master with a complete mask and robust rejection. Building a reliable pipeline also means preserving algorithm versions, parameters, rejected-data lists and diagnostic comparisons. Original frames should not be overwritten by finished pictures.

The path of one measured pixel

Quantity / operationValueUnit
Raw value R3338ADU
Row median O1116ADU
R − O2222ADU
Combined dark D4.667ADU
R − O − D2217.333ADU
Normalised response F0.998176636dimensionless
(R − O − D) / F2221.384ADU
Divide by 300.062 s7.403ADU/s
The same original pixel x394,y792, zero-based. The row’s 25 overscan samples at x2055:2080 have a median of 1116 ADU. Dark is the mean of three 300 s frames after their own row corrections, retaining residual bias; no second separate bias subtraction. Flat is the mean of three cleaned, locally normalised g′ flats. The value includes sky; ADU/s is not physical flux. Exposure differences up to 0.062 s are accepted following the teaching guide, without dark scaling. Data and method

Branch · Numerical checkOptional: these calculations use real counts, not a synthetic star.

Recompute one pixel all the way to ADU per second

At coordinate x394,y792, overscan subtraction leaves 2222 ADU, the mean dark is D = 14/3 ADU and local response is F = 0.9981766364. Therefore:

C = (2217.333333)/(0.9981766364),; C ≈ 2221.384 ADU.

Dividing by the actual exposure gives:

C/t = (2221.383723)/(300.062),; C/t ≈ 7.40308 ADU/s.

This is the accumulation rate of a pixel including sky. Stellar flux requires background estimation, spatial integration or response fitting, and photometric calibration. The nearly unity flat should not arbitrarily double the count here: this is a simple sanity check. Independently reducing the same original counts with two numerical implementations gives agreeing results; that checks arithmetic, not the camera temperature that is missing.

A bad pixel needs a mask, not an invented measurement

A dead pixel, an unstable hot pixel and a saturated star present different problems. A mask records which value was rejected and why. Zero means a measured zero on a particular scale; a missing entry means no usable measurement is available. Replacing a missing entry with zero before averaging systematically darkens the result.

Even “divide only when 0.5<F<1.5” is not a complete pixel check. It is only a teaching response bound; it rejected none of the 1024 pixels in our crop. That does not establish the absence of saturation, a transient defect or a particle hit. A real instrument needs its quality flags and diagnostics.

A particle can leave a sharp local trace absent from another exposure. Yet a variable celestial object may also be absent in a repeat. We therefore seek consistent evidence: trace shape, repeatability, behaviour in detector and sky coordinates, known defects and other observations. Astropy: cosmic rays and the prerequisites for finding them.

Check an outlier against another exposure

Third exposurewith added outlier498 ADUIndependent repeatfirst exposure100 ADUOrdinary mean4 measurements200 ADUMasked mean3 here, 4 elsewhere100.667 ADUMarked coordinate x1,y1
Synthetic control example, not Palomar frames or a confirmed cosmic ray. Four registered 9×9 arrays: background 100, central pixel 300, neighbours 150 ADU; common additions 0,+2,−2,0. A known 400 ADU is added only to pixel x1,y1 of frame three. Common scale 0–500 ADU. At that coordinate: 100,102,498,100; ordinary mean 200, mean excluding the known outlier 100.667 ADU from three measurements. Other coordinates use four. New stars cannot automatically be dismissed as artifacts; independent evidence and a reasoned mask are needed. Data and method

In this synthetic example, the added outlier’s location is known in advance. An unmasked mean retains a bright spot; three measurements independent of that contamination show ordinary background. This is not an automatic rule to “remove everything bright”. If no usable repeat exists, interpolation can be used for display, but a flag must remain: the inserted number has not become an observation.

A small telescope shift puts a star on different pixels. Averaging identical indices without registration smears it. First, corresponding features are identified or a verified coordinate description is used. Shift, rotation, scale and any required distortions are estimated; the data are then transferred to a consistent grid. Errors are checked through residual stellar positions, beyond the impression of smoothness.

During resampling, neighbouring input pixels may jointly contribute to new ones. Noise correlations and the effective response therefore change. At the edges, some images have no data: the result needs a map of accepted exposure counts or weights, and a mask. A total sum is conserved only under the conditions specified by the method and geometry; cropping or an edge may change it.

Stacking requires comparable quantities. For unequal exposure times, counts can be converted to ADU/s with appropriate weights and uncertainties. Adding different filters without explanation mixes spectral measurements. Our real g′/i′ pair therefore remains two separate channels; stacking noise is considered separately below. Astropy: why frames are combined.

Branch · DeeperOptional: a simple one-dimensional resampling example, not the Palomar pipeline.

Smoother noise may become correlated

Imagine independent errors in neighbouring pixels x_(i), each with variance (σ)^(2). For a half-pixel shift, a simple linear example takes:

y_(i) = (x_(i) + x_(i − 1))/(2).

Each new value has variance (σ)^(2)/2, but neighbours share one original pixel:

Cov⁡(y_(i),y_(i + 1)) = (σ)^(2)/4.

Less grain on screen therefore does not automatically mean more independent information. In the tested teaching model with a periodic boundary, the sum of all values is preserved; real resampling with clipped edges requires separate coverage accounting. This explains why aperture uncertainty cannot always be calculated from a pixel count and one “noise per pixel” value.

More exposures help when errors are not repeated together

In repeated equal exposures, a constant celestial signal remains while independent random deviations partly cancel. The mean keeps the signal on a single-exposure scale but reduces its random uncertainty. A sum increases both useful signal and absolute noise; what matters is their ratio, SNR.

An error in one shared dark, an incorrect flat or unremoved stray background can enter every frame in the same way. These do not disappear simply because we have repeated the addition a hundred times. Nor can new independent data be obtained by copying one file. Astropy: calibration noise.

Independent and common noise decrease differently

σ of mean · ADU024681014163264N · number of framesIndependent noiseWith common error
NIndependent σ · ADUσ with common error · ADU
11010.198
455.385
162.5003.202
641.2502.358
Our model of the mean of equal exposures: independent σ=10 ADU per frame; a common additive error σc=2 ADU shared by all frames. Blue: 10/√N; rust: √(100/N+4), not linear addition of σ. Mean useful signal is 100 ADU in this example. N counts accepted frames, not seconds. No changing scene, weights, clipping or measured LFC noise estimate. The common term does not disappear through stacking. Data and method

Branch · With equationsOptional: independent, identically distributed exposures of a constant scene.

When does SNR really grow as the square root of N?

For N measurements X_(i) with the same mean signal S, variance (σ)^(2) and zero pairwise covariances:

\begin{gathered} \bar X=\frac1N\sum_{i=1}^N X_i,\\ \sigma_{\bar X}=\frac{\sigma}{\sqrt N}. \end{gathered}

Then \mathrm{SNR}_{\bar X}=S\sqrt N/\sigma. For the sum, the signal becomes NS, noise √(N)σ, and SNR is the same. This law assumes independent comparable exposures without unaccounted variability or nonlinearity. Those conditions matter more than memorising the word “root”. Astropy: image combination.

Add an additive error with standard deviation σ_(c), independent of the random noise but common to all frames. Now:

\sigma_{\bar X}=\sqrt{\frac{\sigma^2}{N}+\sigma_c^2}.

With S = 100 ADU, σ = 10 ADU and N = 16, independent noise in the mean is 2.5 ADU and SNR=40. With a common σ_(c) = 2 ADU, total uncertainty becomes about 3.202 ADU and SNR≈31.23. For large N, the shared 2 ADU contribution remains. This is our synthetic budget, not measured LFC noise. Outlier rejection, unequal weights and correlated exposures require corresponding statistics.

A calibrated pixel still needs interpretation before a scientific conclusion

Sky is real light recorded by the instrument as well. To measure a star, local background is estimated from suitable neighbouring regions, separated from the object, and the estimate’s uncertainty is included. If the background has a gradient, one number for the whole frame may be a poor model. If a faint nebula fills almost the entire field, aggressive “background flattening” may subtract part of the nebula itself.

The object’s signal is then summed within an aperture or fitted with a spatial response model. Comparisons between instruments need a photometric scale, spectral band, atmospheric conditions for ground-based data, units and method-specific corrections. Our 7.40308 ADU/s in one pixel cannot replace those steps. We have not subtracted sky or obtained a published flux for VV124. Astropy: limits of minimum calibration.

Artificial sharpening or deconvolution also requires a response model and residual checks. Existing information can be used better, but unknown spatial detail does not become established simply because an algorithm draws a crisp edge. Repeated observations and an independent reduction method are particularly useful for checking such a conclusion.

Colour is honest when its relationship to the numbers is known

A monochrome camera behind a filter measures intensity within a particular spectral band. Several such maps can be displayed in a screen’s red, green and blue channels. In the visible range, that choice may approximate a familiar appearance; in infrared or narrow bands, colour can reveal an invisible range or differences in emission. NASA explicitly explains this approach to Hubble imagery. NASA: filters and assigned colours.

Channels are measured; colours are assigned

Measurement channelHypothetical valueDisplay colour
Shorter0.2Blue · B
Middle0.5Green · G
Longer1Red · R

Synthetic mixture · RGB (255, 128, 51)

Explicit teaching map for three hypothetical normalised channels: shorter → blue B, middle → green G, longer → red R. Values 0.2,0.5,1 produce RGB=(255,128,51) after rounding. Synthetic assigned colour, not three measured bands of our two-channel dataset or a naked-eye view. Wavelength order is retained; a real image description also needs filters, stretch, normalisation, masks and a legend. Assigning colour does not measure a missing channel. Data and method

Assigned colour does not mean a fabricated measurement when the map is declared and based on data. Calling a synthetic channel measured would, however, be wrong. Our LFC dataset contains g′ and i′; the three-channel map shown here is a separate synthetic illustration, without an invented “third filter”.

Similarly, calibration and stretch are distinct. A linear display preserves proportional levels within its range; a nonlinear display lifts faint details relative to bright ones. Lower and upper limits can clip values for display. The resulting PNG on screen should not replace the original numerical array in a measurement. Brightness and colour also depend on the display and chosen settings.

Radio and gamma-ray images begin with different measurements

In an interferometer, radio signals from different antennas are combined with timing and phase information. The data represent particular spatial scales rather than an already formed optical frame. Baseline configuration, amplitude and phase calibration, and reconstruction method affect the result; additional measurements also matter for overall brightness. Filling missing scales with an attractive texture does not recover them. ALMA: interferometry, the course’s interferometer explanation.

For Fermi LAT, analysis links a gamma-ray sky model to expected detected events through the detector response; parameters are fitted using the data likelihood. A spot in a counts map, a model of expected counts and a statistical-significance map are different products. Few events and a broad response do not disappear through colourisation. NASA FSSC: likelihood and response.

The optical bias/dark/flat recipe is therefore not mechanically transferred to every event list or radio visibility. The shared logic is broader: know the measured quantity, instrument response, data quality, reconstruction assumptions and display method.

How to read a beautiful image and check its path

Start with the caption: which telescope, instrument, date, filters and data source? Then establish what you are looking at: counts, flux, a model, a statistical map or an artistic illustration. Checking requires input files and parameters; interpreting requires masks, coverage, units, a scale and a colour map.

Our example can be followed backwards: from enhanced contrast to the same calibrated numbers, from those to the flat and combined dark, and then to row overscan and the original 3338 ADU. The numerical fragment comes from the named FITS file; the reduction panels are built from those numbers. The separate artistic preview and synthetic diagrams are not observations. Unknown camera stability and full photometric uncertainty remain unknown.

A good astronomical image can be both scientifically sound and expressive. Traceable data and honest transformations make it checkable. To understand where the numbers come from before processing, return to detectors, spectrographs and polarimeters.