Freeze the input before doing the calculation
The input is gaia-dr3-sample.csv, retrieved on 28 October 2026 through ARI’s Gaia TAP service and cross-checked against the same query at ESA. The saved query.adql selects the first twenty-four source identifiers in a fixed interval with five-parameter solutions. It makes no parallax-sign or RUWE quality cut.
This deterministic selection creates a small exercise, not a sample for estimating the Galactic distance distribution, star counts or the population frequency of negative parallaxes. All three negative-parallax rows remain in both input and output.
The provenance file and result retain the input SHA-256 checksum. The script checks the row count, negative-parallax count and positive definiteness of every reconstructed five-parameter covariance. Use the repository checkout for the exact folder layout shown below.
python3 scripts/astronomy/ac01/reproduce-gaia-distances.py
python3 scripts/astronomy/ac01/reproduce-gaia-distances.py --check
Reading: ARI Gaia Services — TAP documentation · Lindegren et al.
Read the units and reconstruct the correlations
Treat source_id as a string. Its many digits can exceed the exact-integer range of floating-point storage. The ra and dec columns give ICRS directions in degrees at J2016.0. Parallax and its error use milliarcseconds. The pmra and pmdec columns use milliarcseconds per year.
The pmra value already includes the cosine of declination. The ra_error column describes the tangent quantity in milliarcseconds; it cannot simply be added to an RA value in degrees. Five standard errors and ten correlations reconstruct the full astrometric covariance.
As one application, propagate the eastward tangent-position uncertainty twenty years. Include the initial position variance, proper-motion variance and their cross term. The output also gives the result after omitting the cross term, so you can compare the consequence. This is linear tangent propagation without radial acceleration.
Reading: Lindegren et al.
Start with a precise positive parallax
Source 3200000263315829632 has measured parallax about . Its inverse gives about 179.8 parsecs. Since the error is small compared with the measured parallax, changing the prior has little effect on this star’s inferred distance.
Source 3200000224659857664 instead has . Direct inversion gives about 22,860 parsecs. That apparently precise number is extremely sensitive to a small measurement change. Move the parallax towards zero and the inverse diverges; move it through zero and the inverse becomes negative.
For this weak measurement, describe noise in parallax space. At each proposed positive distance, predict a parallax and calculate how likely the observed value would be. This probability density for the data conditional on the parameter is the likelihood.
Reading: Bailer-Jones
Weight positive distances and vary the prior
The script uses an easily tested teaching prior with density proportional to . The squared-distance term reflects spherical-shell volume; the exponential gradually suppresses very large distances. This is not the direction-dependent Galactic prior used for the Bailer-Jones EDR3 distance catalogue.
Multiply the prior by the Gaussian parallax likelihood and normalize to obtain a posterior distribution. The script uses and saves the sixteenth, fiftieth and eighty-fourth percentiles for each. Quantiles retain the asymmetry that a single symmetric error bar would hide.
The numerical grid is uniform in log distance. Its cells do not have equal widths in distance, so integration weights include . Omitting this factor silently changes the calculation.
Reading: Bailer-Jones · Bailer-Jones et al. · Lindegren et al.
Inspect negative parallaxes and spatial coordinates
Source 3200000259019600000 has measured parallax about minus 0.131 milliarcseconds with standard error 0.425. Its inverse-distance output is null, but its positive-distance posterior is calculated normally. With prior scale 1,350 parsecs, the median is about 4,463 parsecs and the central sixty-eight-percent interval about 2,741 to 7,060. Changing the prior scale moves this weakly constrained result.
The output also projects each radial median along its ICRS direction into three spatial coordinates. These are positions at the chosen radial median, not exact locations or complete joint three-dimensional distributions. A population map requires the distance distributions and observational selection as well as the plotted points.
Finally run --check. It compares the recomputed output with the frozen result and halves the grid resolution to check convergence. When the parallax likelihood becomes essentially constant in distance, the posterior must approach a Gamma distribution with shape three. Its analytic cumulative probability independently checks the numerical quantiles.
For a different Gaia sample, inspect release, epoch, units and solution type first. Then examine covariances, the applicable zero-point calibration and the sample selection. A single point in a distance map carries all of that information behind it.
Reading: Bailer-Jones · Lindegren et al.