target-match
A pure-Rust library that identifies which catalogued sky object a telescope frame captured — from where the scope pointed and how much sky the frame covers.
- Coordinates, never names — matching is done purely by sky position. A frame's
OBJECTstring (written inconsistently by capture software) is never a search key; a designation may ride along on a result for display only. - Catalog-agnostic — the crate owns no catalogue data and does no I/O. You bring
your own objects (a database, a file, a SIMBAD resolver, a hand-built list) by
implementing one small trait;
target-matchdoes the geometry. - Pure Rust, dependency-light — one small runtime dependency (
thiserror), MSVC-safe. Optional off-by-defaultserde. - Flexible inputs — pointing and distances in decimal degrees or sexagesimal
(
HH:MM:SS/±DD:MM:SS); field of view from optics (focal length, pixel size x/y, binning x/y, sensor pixels), from a pixel scale, or given directly.
Status
Implemented and tested, extracted from the nightwatch-astro/alm
targeting pipeline. The angle, optics, and matcher modules are complete; the
specification lives under specs/001-target-match-core/
(SpecKit). See examples/identify.rs for a runnable demo.
Usage
use ;
// Your catalogue type — target-match owns no catalogue data, and never reads the name.
let catalog = ;
// Where the scope pointed (decimal degrees or sexagesimal)...
let pointing = parse_j2000.unwrap;
// ...and how much sky the frame covers (from optics, a pixel scale, or a direct FOV).
let field = from_optics.unwrap;
// Which catalogued object the frame captured, nearest first.
let hits = rank;
assert_eq!;
For a batch of frames against one catalogue, build the index once with
Matcher::from_objects(..) and call .query(pointing, constraint) repeatedly. Rectangular
in-frame membership (with optional camera rotation) and JNow→J2000 precession are supported;
see the module docs.
Features
serde(off by default) — deriveSerialize/Deserializeon the public coordinate and match types. Enable withtarget-match = { version = "…", features = ["serde"] }.
Development
Requires a stable Rust toolchain (pinned via rust-toolchain.toml) and, optionally,
just.
License
Licensed under the Apache License, Version 2.0.