Star positions

Meeus, Astronomical Algorithms · checked against USNO and Skyfield

What it is

A star’s catalogue entry says where it was at the start of 2000, against the stars’ own frame. To find it in tonight’s sky, move it by its own motion across the sky, turn the sky for the slow wobble of the Earth’s axis, allow for the Earth’s speed bending its light, and turn the result to the place’s horizon at the instant. Refraction is the air bending light near the horizon: a star sitting on it is really about half a degree below.

  • A catalogue gives a star where it was at J2000. Precession has turned the sky about 22′ since, and nutation and the Earth’s own speed move each star by up to 20″ more.
  • Refraction is its own operation, so the sun, the moon, the planets and the stars can all be lifted the same way. The sun, moon and planets positions are geometric, like this one.
  • Drawing thousands of stars: most of the work is the same for every star at an instant. Build one matrix from J2000 to the place’s horizon, add the Earth’s velocity to each star’s unit vector, and multiply. Cases without proper motion or parallax are graded that way.
  • It builds on astronomical time: the Julian day and sidereal time.

Operations

OperationGives
position A catalogue star's azimuth and altitude from a placeIn: rightAscensionInHours, declinationInDegrees, properMotionEastInArcsecondsPerYear, properMotionNorthInArcsecondsPerYear, parallaxInArcseconds, latitudeInDegrees, longitudeInDegrees, instantUtc
Out: azimuthInDegrees, altitudeInDegrees
refraction How much the air lifts a body at a geometric altitudeIn: altitudeInDegrees
Out: refractionInDegrees

Fields

FieldMeaning
rightAscensionInHoursThe star's catalogue right ascension, J2000 (ICRS) at epoch J2000.0: 0 up to 24. Outside, outOfRange.
declinationInDegreesThe star's catalogue declination, J2000 at epoch J2000.0: −90 to 90
properMotionEastInArcsecondsPerYearOptional, 0 when left out. How fast the star moves east across the sky: the proper motion in right ascension times the cosine of the declination, as BSC5 and Hipparcos give it
properMotionNorthInArcsecondsPerYearOptional, 0 when left out. How fast it moves north: the proper motion in declination
parallaxInArcsecondsOptional, 0 when left out. Annual parallax, 0 up to 1. Outside, outOfRange.
latitudeInDegrees−90 to 90, north positive
longitudeInDegrees−180 to 180, east positive
instantUtcAn instant, ISO 8601 with Z, read as UT1
azimuthInDegrees0 up to 360, clockwise from north. Left out above 75° altitude, where 2″ on the sky is more than the tolerance in azimuth.
altitudeInDegreesAs an input to refraction, −90 to 90. As an output, −90 to 90 up from the horizon, of the star's apparent place (precession, nutation, annual aberration, proper motion and parallax), geometric: no refraction
refractionInDegreesHow much higher the air shows a body at a geometric altitude, at 10 °C and 1010 hPa: add it to the altitude. Meeus 16.4 (Sæmundsson) or Bennett's formula inverted. Below −1°, the refraction at −1°, so a body sinking below the horizon never jumps.

Edge cases

CaseWhat it tests
skyfield-position-61-cyg-a-1900position61 Cygni A, 5″ a year: a century before the catalogue's epoch it was 8′ away.
skyfield-position-61-cyg-a-2050position61 Cygni A half a century on, 4′ from its catalogue place.
skyfield-position-61-cyg-a-2050-no-motionpositionThe same star with proper motion and parallax left out: the per-instant frame alone, 4′ from where it really is.
skyfield-position-arcturus-1900positionArcturus, the fastest of the bright stars, 2.3″ a year.
skyfield-position-groombridge-1830-2050positionGroombridge 1830, 7″ a year, the fastest star in BSC5.
skyfield-position-alpha-centauri-a-2050positionα Centauri A: the largest parallax in the catalogue, 0.75″.
skyfield-position-polaris-near-the-polepositionPolaris from 89.9° north: near the zenith, so only the altitude counts.
skyfield-position-polaris-from-the-equatorpositionPolaris from the equator, under a degree above the horizon.
skyfield-position-sigma-octantis-south-polepositionσ Octantis, the south pole star, from the south pole.
skyfield-position-sirius-below-horizonpositionBelow the horizon: USNO doesn't list it, Skyfield answers.
skyfield-position-canopus-at-the-horizonpositionCanopus grazing the horizon from southern Spain.
skyfield-position-vega-near-zenithpositionVega near the zenith: azimuth left out.
skyfield-position-date-linepositionA place on the date line.
skyfield-refraction-minus-90refractionStraight down: still the refraction at −1°.
skyfield-refraction-minus-2refractionBelow −1°, the refraction at −1°: a body sinking below the horizon never jumps.
skyfield-refraction-0refractionAt the horizon: about 29′, nearly the sun's width.
skyfield-refraction-90refractionAt the zenith: none.
invalid-position-parallax-negativepositionA negative parallax is refused, though some catalogues print one.

Their inputs and expected values are in vectors.json; search for the case's id.

For agents

Follow Meeus, Astronomical Algorithms: proper motion and annual parallax first, then precession from J2000 by 21.2 and 21.3, nutation by chapter 22’s main terms, annual aberration (23) from the Earth’s velocity, and apparent sidereal time (12) to the place’s horizon. Work in unit vectors: one matrix for the instant and place, the Earth’s velocity over the speed of light added to each star’s vector before it. Read the instant as UT1. Give the altitude geometric, with no refraction. For refraction, use Sæmundsson’s 16.4 at the geometric altitude, or Bennett’s 16.3 inverted, at 10 °C and 1010 hPa, and below −1° the value at −1°. An optional input left out of a case is 0. Pass every case in vectors.json within its tolerance.

To check by hand against the book, 2nd edition (1998): example 21.b for θ Persei’s precession and 23.a for its apparent place. They work in dynamical time and give right ascension and declination, so they check a step, not a case in this file.

Test data

vectors.json holds 449 cases, published 2026-11-22. Earth model: WGS84 latitude and longitude; UT1 read from the UTC given. How to read it: Test data format.

OperationCases
position 392281 published · 104 reference · 14 edge · 7 invalid
refraction 5730 published · 25 reference · 3 hand · 3 edge · 2 invalid

Tags say where each value came from: what they mean.

FieldTolerance
azimuthInDegrees± 0.003
altitudeInDegrees± 0.003
refractionInDegrees± 0.01

Every other field is compared exactly.

Implementations

ImplementationStatus
gshaw/algorithms-swiftSwift Passes
gshaw/algorithms-typescriptTypeScript Passes

Each implementation's CI grades it against this page's test data on every push, and again when the data changes. The code isn't public yet. See how implementations work.

Source

Position and refractionAstronomical Applications API 4.0.1: Celestial Navigation Data, Hc, Zn and refractionUS Naval Observatory, for the 57 navigational stars above the horizon. Its Hc is geometric, and its refraction is for a body at Hc. Every request and response is in /stars/sources/usno.jsonl · Public domain
Position and refractionSkyfield 1.55's Star and refract, on JPL's DE421Brandon Rhodes. For stars USNO doesn't list, below the horizon, and with proper motion from 1900 to 2050; refraction at 10 °C and 1010 hPa. Checked against USNO on every navigational star. Every call is in /stars/sources/skyfield.txt · MIT
Each star's catalogue entryYale Bright Star Catalogue, 5th revised edition (BSC5), HEASARC's heasarc_bsc5p tableHoffleit and Warren, 1991, through NASA's HEASARC, pinned by SHA-256. The records used are in /stars/sources/bsc5.tdat, verbatim · Public, as HEASARC publishes it
MethodAstronomical Algorithms, 2nd edition, 1998, chapters 12, 13, 16, 21, 22 and 23Jean Meeus. The method to follow; no value in the file comes from it