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

Point the Telescope with a Model

A fitted model is only useful once your mount driver applies it. Two questions come up at the telescope. Where do I send the mount so a target lands in the middle of the field? And where is the telescope really pointing, given what the encoders say? Pointer answers both from an OUTMOD model, your site and the time.

Find the mount reading for a target

This loads the model saved in Fit Your First Model and finds where to send the mount for Arcturus, on both sides of the pier:

use std::path::Path;
use std::sync::Arc;

use celestial_coords::eop::EopProvider;
use celestial_coords::frames::icrs::ICRSPosition;
use celestial_core::angle::Angle;
use celestial_core::constants::ARCSEC_TO_RAD;
use celestial_core::location::Location;
use celestial_pointing::astrometry::Refraction;
use celestial_pointing::frames::PierSide;
use celestial_pointing::model::Model;
use celestial_pointing::outmod::read_outmod;
use celestial_pointing::pointer::Pointer;
use celestial_pointing::sexagesimal::signed_sexagesimal;
use celestial_time::scales::utc::utc_from_calendar;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let outmod = read_outmod(Path::new("warp.mod"))?;
    let pointer = Pointer {
        model: Model::new(outmod.terms)?,
        site: Location::from_degrees(39.0072, -104.881, 1840.0)?,
        refraction: Refraction::new(
            outmod.refraction_a * ARCSEC_TO_RAD,
            outmod.refraction_b * ARCSEC_TO_RAD,
        )?,
        eop: Some(Arc::new(EopProvider::bundled()?)),
    };

    // Arcturus, ICRS
    let arcturus = ICRSPosition::new(
        Angle::from_hours(14.0 + 15.0 / 60.0 + 39.672 / 3600.0),
        Angle::from_degrees(19.0 + 10.0 / 60.0 + 56.67 / 3600.0),
    )?;
    let utc = utc_from_calendar(2026, 4, 22, 5, 30, 0.0)?;

    let bare = Pointer { model: Model::default(), ..pointer.clone() };
    let plain = bare.mount_for(&arcturus, &utc, PierSide::Normal)?;
    println!(
        "no model: HA {} Dec {}",
        signed_sexagesimal(Angle::from_radians(plain.h()).hours(), 1)?,
        signed_sexagesimal(Angle::from_radians(plain.d()).degrees(), 0)?,
    );

    for side in [PierSide::Normal, PierSide::BeyondPole] {
        let reading = pointer.mount_for(&arcturus, &utc, side)?;
        println!(
            "{side:?}: HA {} Dec {}",
            signed_sexagesimal(Angle::from_radians(reading.h()).hours(), 1)?,
            signed_sexagesimal(Angle::from_radians(reading.d()).degrees(), 0)?,
        );
        let back = pointer.sky_for(reading, &utc)?;
        println!(
            "  points at {:.3}\" from the target",
            arcturus.angular_separation(&back).arcseconds()
        );
    }
    Ok(())
}
no model: HA -01 45 15.0 Dec +19 03 44
Normal: HA -01 53 14.9 Dec +17 06 07
  points at 0.000" from the target
BeyondPole: HA +10 03 49.8 Dec +158 53 39
  points at 0.000" from the target

mount_for takes the target from ICRS to its apparent place at the site and time, adds refraction, and runs the model backwards to find the mount reading that puts the star on the optical axis. With an empty model you get the refracted apparent place, and the difference between the first two lines is the model’s correction: eight minutes of hour angle and two degrees of declination, most of it the index errors.

sky_for goes the other way. Given a mount reading, it returns the ICRS direction the telescope points at. Here it returns Arcturus to within a thousandth of an arcsecond, because it’s the inverse of mount_for. Use it to show the telescope’s true position in a planetarium program, or to turn the encoders’ position into the center of a frame.

The parts of a Pointer

  • model is the fitted model. Model::new checks every term name, so a model with a term the crate doesn’t support fails here, not at the telescope.
  • site is the observatory’s location. The model was fitted at one latitude, so use it at that site.
  • refraction holds the refraction constants A and B in radians. The OUTMOD statistics record stores the ones the fit used, in arcseconds, and using the same ones at the telescope keeps the model consistent with its fit.
  • eop gives UT1−UTC and polar motion for each time. With None they’re taken as zero, which moves the hour angle by up to about 0.9 seconds of time. A time outside the provider’s table is an error. Earth Orientation Parameters covers the bundled table and how to refresh it.

Pier sides and mount readings

A German equatorial mount can reach most stars from either side of the pier. mount_for doesn’t choose: you pass PierSide::Normal or PierSide::BeyondPole, because the choice depends on your mount’s limits and where it is now.

A MountReading holds the hour angle and the mechanical declination in radians. Beyond the pole, the mechanical declination is past ±90°, and the hour angle is about twelve hours away from the star’s. That’s why the second reading above is +10 03 49.8 and +158 53 39 for a star at declination +19°. reading.pier_side() tells you which side a reading is on.

Raw encoder readings

When you record observations for the next fit, record the raw encoder reading, with no pointing model applied, neither this one nor the mount’s own. A fit measures the mount’s errors from scratch. If the readings already include a correction, the fit measures what’s left of the errors after that correction, and the new model can’t stand on its own.

Next steps