1. Identify the release and reproduce the selection
The input is a 6,162-byte response from the public SDSS DR17 SkyServer SQL service, saved with its exact query and SHA-256 hash. The query joins primary galaxy spectra to their best imaging objects, requires zero spectroscopic warning, clean imaging and a spectroscopic redshift between 0.02 and 0.8, then takes the first twenty-four spectrum identifiers in order. The actual selected range is 0.02122228 to 0.4482199.
This is a compact, bright, spectroscopically selected exercise, not a random sample of all imaging galaxies. It contains neighboring survey observations and cannot measure the redshift distribution of a faint imaging population. Spectroscopic values enter selection and final validation; they do not enter the flux likelihood or train the templates, priors or zero points.
Keep objID and specObjID as strings. These nineteen-digit identifiers exceed the exact integer range of ordinary JavaScript numbers. The query and original bytes let you identify every source without substituting an invented catalogue row.
mkdir -p galaxy-colors-reproduction
cd galaxy-colors-reproduction
curl -fSLO https://sandboxphysics.com/stories/galaxy-colors/reproduce-sdss.py
curl -fSLO https://sandboxphysics.com/stories/galaxy-colors/sdss-dr17.csv
curl -fSLO https://sandboxphysics.com/stories/galaxy-colors/photometry-grid.json
curl -fSLO https://sandboxphysics.com/stories/galaxy-colors/sdss-results.json
python3 reproduce-sdss.py --reference sdss-results.json
Reading: SDSS DR17 imaging fluxes and flux calibration · SDSS public-release use and acknowledgement policy
2. Read flux, inverse variance and foreground extinction
Each row contains five modelFlux values in nanomaggies and five modelFluxIvar values in inverse-square nanomaggies. The SDSS model fluxes use a common shape selected in r, which supports consistent galaxy colors. The inverse square root of each inverse variance gives its statistical standard deviation. All one hundred twenty inverse variances in this snapshot are positive.
The catalogue extinction fields are band-specific Milky Way foreground estimates. Multiply both flux and statistical standard deviation by the foreground correction. Next apply the frozen approximate AB zero-point shifts: minus 0.04 magnitude in u, plus 0.02 in z, and zero in the other bands. SDSS describes the z shift as tentative and these shifts as uncertain at roughly the hundredth-magnitude level. The tutorial reruns inference without the shifts as a sensitivity check.
Add three percent of the absolute corrected measured flux in quadrature to the statistical standard deviation, then hold that error fixed across models. This is a declared teaching error floor, not an inferred SDSS covariance or a guarantee of calibrated uncertainties. The snapshot supplies no cross-band covariance; the calculation assumes diagonal errors.
Reading: SDSS DR17 imaging fluxes and flux calibration · Hogg et al.
3. Follow a negative flux through the calculation
Row six has objID 1237650795146510903 and specObjID 299491876468189184. Its original u flux is minus 0.1949482 nanomaggies, with inverse variance 6.303689. The foreground extinction is 0.2578563 magnitude. After both corrections its u flux is minus 0.256485 with standard deviation 0.524073 nanomaggies.
The negative estimate is only about half a standard deviation below zero. It is compatible with a small positive physical flux and belongs in the Gaussian likelihood. Deleting it or treating it as an exact upper limit changes the statistical question. A second negative u flux occurs in row twenty-two; both are retained.
For row six the inferred highest peak is 0.415 and the central interval is approximately 0.2566 to 0.4699. Its spectroscopic redshift, read after the flux fit, is 0.4482199. The interval includes that value. The saved output includes all two hundred forty-one density values, so this comparison can be checked without opening the interactive Lab.
Reading: SDSS DR17 imaging fluxes and flux calibration · Brammer
4. Inspect failures before reducing the sample to one score
Row eighteen, objID 1237648721216405657, has spectroscopic redshift 0.08419658. Its highest photo-z peak is 0.130 and its central interval is 0.1028–0.1922: the interval misses the known redshift. Row twenty-three, objID 1237648720142336237, has spectroscopic redshift 0.06518305, highest peak 0.185 and interval 0.0911–0.1962. That interval misses too.
Row twenty-three is also a useful calibration diagnosis. Omitting the small approximate AB shifts moves its highest peak from 0.185 to the lower grid boundary at zero. The two posterior regions were competing; the zero-point changes swap their ranking. The shifts were fixed from the calibration documentation, not fitted to make the spectroscopic answer agree. The correct lesson is to inspect the distribution and calibration dependence before trusting the single peak.
The limited model has one metallicity, single-burst populations and no emission-line contribution. A poor or displaced fit could arise from those model limitations, measurement problems or calibration, and this small catalogue alone does not identify which explanation caused each failure. The residual vectors in the output show which bands disagree; follow-up spectra and richer templates would test the cause.
| Row | Spectroscopic redshift | Highest peak | Central 68% interval |
|---|---|---|---|
Reading: SDSS DR17 imaging fluxes and flux calibration · Bruzual & Charlot
5. Read the summary with its sample size attached
Twenty-two of twenty-four central 68 percent intervals contain the spectroscopic value. That fraction is about 92 percent for this particular sample. It is not a calibration certificate: the sample is small and selected, several distributions are broad, and the error floor is a teaching assumption. Neither a high inclusion fraction nor a small median offset proves that every posterior is informative.
Define normalized redshift error as below. The saved median error is 0.004414 and the centered normalized median absolute deviation is 0.05443. No object crosses the chosen catastrophic-error threshold of absolute normalized error greater than 0.15. The two missed intervals remain failures even though neither meets that coarser threshold.
For the next catalogue, keep the release, selection and flux/error units first; state how foreground and zero points were treated; keep the spectroscopic answers out of inference; inspect the full distributions, residuals and boundary mass; then report interval inclusion and a clearly defined outlier metric. To calibrate a survey redshift distribution, the validation sample must also represent that survey’s color, brightness and redshift selection.
Reading: Brammer · SDSS DR17 imaging fluxes and flux calibration