Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sidereal time

To point a telescope at a star, you need its hour angle: how far west of your meridian it is right now. Right ascension is fixed to the stars, so the hour angle is the right ascension subtracted from the local sidereal time, which is the right ascension crossing your meridian at that moment. Sidereal time is the Earth’s rotation measured against the stars instead of the Sun.

use celestial_core::location::Location;
use celestial_time::scales::conversions::utc_ut1::ToUT1WithDUT1;
use celestial_time::scales::conversions::{ToTAI, ToTT};
use celestial_time::scales::utc::UTC;
use celestial_time::sidereal::last::LAST;

let mauna_kea = Location::from_degrees(19.8207, -155.4681, 4205.0)?;

let utc: UTC = "2026-03-20T08:30:00Z".parse()?;
let tt = utc.to_tai()?.to_tt()?;
let ut1 = utc.to_ut1_with_dut1(0.0624)?; // UT1 - UTC, from IERS data

let last = LAST::from_ut1_tt_and_location(&ut1, &tt, &mauna_kea)?;
println!("{last}");

// Betelgeuse: RA 5h 55m 10.3s
let hour_angle = last.hour_angle_to_target(5.0 + 55.0 / 60.0 + 10.3 / 3600.0)?;
println!("hour angle {hour_angle:.4} h");
// LAST 9.994945h at (19.8207°, -155.4681°)
// hour angle 4.0754 h

hour_angle_to_target takes the right ascension in hours and returns the hour angle in hours, from -12 up to but not including +12. Positive means west of the meridian: the star has already transited. The example passes a catalog right ascension. For pointing to the arcsecond, pass the apparent right ascension that the coords apparent-place pages compute.

The rest of this page covers the two inputs, UT1 and TT, and the four kinds of sidereal time the crate computes.

UT1: where the Earth is pointing

Sidereal time follows the Earth’s actual rotation, and UT1 is the time scale that measures it. UT1 drifts against atomic time in ways nobody can predict far ahead, so the IERS measures it and publishes UT1 - UTC, called DUT1, in Bulletin A. Leap seconds keep DUT1 between -0.9 s and +0.9 s.

The crate ships no Earth orientation data, so you pass DUT1 yourself. Each second of UT1 error rotates the sky by about 15 arcseconds, and leaving DUT1 at zero can put you up to 13.5″ off. celestial-coords bundles IERS tables (see the coords Earth orientation pages), or you can read Bulletin A directly.

use celestial_time::scales::conversions::utc_ut1::ToUT1WithDUT1;
use celestial_time::scales::conversions::ut1_tai::ToUT1WithDeltaT;
use celestial_time::scales::tt::tt_from_calendar;
use celestial_time::scales::utc::UTC;

// Modern dates: DUT1 from IERS Bulletin A
let utc: UTC = "2026-03-20T08:30:00Z".parse()?;
let ut1 = utc.to_ut1_with_dut1(0.0624)?;

// Historical dates: Delta T = TT - UT1, from a table of past values
let tt = tt_from_calendar(1900, 1, 1, 0, 0, 0.0)?;
let ut1_1900 = tt.to_ut1_with_delta_t(-2.7)?;

For dates before UTC existed, or far in the future, you’ll find Earth rotation as Delta T (TT - UT1) instead. ToUT1WithDeltaT and ToTTWithDeltaT convert with it. A third pair, ToUT1WithOffset and ToTAIWithOffset, takes UT1 - TAI.

Four kinds of sidereal time

Two choices give four types:

Mean equinoxTrue equinox
At GreenwichGMSTGAST
At your longitudeLMSTLAST

Greenwich or local is only a longitude offset. The local types add your east longitude, and they keep the Location they were built with.

Mean or apparent is about which equinox the right ascension is measured from. Apparent sidereal time measures from the true equinox of date, which includes nutation. Mean sidereal time measures from the mean equinox, which leaves nutation out. To get the hour angle of an apparent place (the position after precession, nutation and aberration), use LAST. LMST is for comparing with older systems and published mean values.

The two differ by the equation of the equinoxes, about a second of time at most.

use celestial_core::constants::ARCSEC_PER_RAD;
use celestial_core::location::Location;
use celestial_time::scales::conversions::utc_ut1::ToUT1WithDUT1;
use celestial_time::scales::conversions::{ToTAI, ToTT};
use celestial_time::scales::utc::UTC;
use celestial_time::sidereal::gast::GAST;
use celestial_time::sidereal::gmst::GMST;

let mauna_kea = Location::from_degrees(19.8207, -155.4681, 4205.0)?;
let utc: UTC = "2026-03-20T08:30:00Z".parse()?;
let tt = utc.to_tai()?.to_tt()?;
let ut1 = utc.to_ut1_with_dut1(0.0624)?;

let gmst = GMST::from_ut1_and_tt(&ut1, &tt)?;
let gast = GAST::from_ut1_and_tt(&ut1, &tt)?;
println!("{gmst}");
println!("{gast}");
println!("{}", gmst.to_lmst(&mauna_kea)?);
println!("{}", gast.to_last(&mauna_kea)?);

let equation_of_equinoxes = (gast.radians() - gmst.radians()) * ARCSEC_PER_RAD;
println!("GAST - GMST = {equation_of_equinoxes:.4}\"");
// GMST 20.359379h
// GAST 20.359485h
// LMST 9.994839h at (19.8207°, -155.4681°)
// LAST 9.994945h at (19.8207°, -155.4681°)
// GAST - GMST = 5.7374"

Each type reads back as hours(), degrees() or radians(), or as a SiderealAngle with angle(). All four have from_hours, from_degrees and from_radians too, for sidereal times you read from a mount controller or a log; the local types also take a &Location. Values wrap into 0 to 24 hours.

Going back is a longitude subtraction: LMST::to_gmst() and LAST::to_gast(). Moving between mean and apparent needs the date, so LAST::to_lmst(&tt) and LAST::to_gmst(&tt) take a &TT.

The Earth rotation angle

Sidereal time mixes two motions: the Earth spinning, and the equinox drifting along the equator with precession and nutation. The Earth rotation angle (ERA) is the spin alone. It’s a linear function of UT1:

use celestial_time::scales::conversions::utc_ut1::ToUT1WithDUT1;
use celestial_time::scales::utc::UTC;
use celestial_time::transforms::rotation::earth_rotation_angle;

let utc: UTC = "2026-03-20T08:30:00Z".parse()?;
let ut1 = utc.to_ut1_with_dut1(0.0624)?;

let era = earth_rotation_angle(&ut1.to_julian_date())?;
println!("ERA = {era:.9} rad");
// ERA = 5.324210701 rad

earth_rotation_angle takes the UT1 Julian date, not a UT1, and returns radians in 0 to 2π. The ERA is measured from the Celestial Intermediate Origin rather than the equinox. The CIO and the equinox explains the difference.

That’s also how the crate builds sidereal time from it, following the IAU 2006 definitions:

  • GMST is the ERA plus a polynomial in TT for the accumulated precession of the equinox. That’s why from_ut1_and_tt takes both scales.
  • GAST is the ERA minus the equation of the origins, the arc from the CIO to the true equinox. It computes that from the IAU 2006 precession and the IAU 2000A nutation, scaled for IAU 2006, using celestial-core’s CioSolution.

Both match ERFA’s eraGmst06 and eraGst06a to the last bit in the crate’s tests.

Nutation and precession from a TT

GAST needs nutation and precession for its TT date. The same calculations are available on any TT value, so you don’t have to split the date into jd1 and jd2 yourself:

use celestial_core::constants::ARCSEC_PER_RAD;
use celestial_time::scales::tt::tt_from_calendar;
use celestial_time::transforms::nutation::NutationCalculator;
use celestial_time::transforms::precession::PrecessionCalculator;

let tt = tt_from_calendar(2026, 1, 1, 0, 0, 0.0)?;

let nutation = tt.nutation()?;
println!(
    "{:?}: Δψ = {:.4}\"  Δε = {:.4}\"",
    nutation.model(),
    nutation.nutation_longitude() * ARCSEC_PER_RAD,
    nutation.nutation_obliquity() * ARCSEC_PER_RAD
);

let precession = tt.precession()?;
println!("{:?}", precession.model);
println!("{}", precession.bias_precession_matrix);
// IAU2006A: Δψ = 5.4206"  Δε = 8.0656"
// IAU2006
// RotationMatrix3:
//   [ 0.999979907 -0.005814188 -0.002526077]
//   [ 0.005814188  0.999983097 -0.000007278]
//   [ 0.002526077 -0.000007409  0.999996809]

nutation() uses IAU 2006A and precession() uses IAU 2006. The traits also have nutation_iau2000a, nutation_iau2000b and precession_iau2000 for matching older software. They call the celestial-core models described in Precession, nutation and obliquity.

Edge cases

  • GMST, GAST and the nutation and precession methods reject a TT date more than 20 centuries from J2000.0 with TimeError::InvalidEpoch, because the IAU polynomials aren’t valid there.
  • hour_angle_to_target returns -12 h, not +12 h, for a star exactly opposite the meridian.
  • A from_radians value in 0 to 2π is kept exactly as given, including 2π itself, so a value from ERFA’s anp reads back unchanged. hours() and degrees() still wrap it to 0.
  • With the serde feature, deserializing a sidereal angle goes through from_radians or from_hours, so a stored value outside 0 to 24 h wraps the same way.

Where next