Skip to main content

citra_solve/
lib.rs

1//! # citra-solve
2//!
3//! Efficient lost-in-space astrometric plate solver for embedded systems.
4//!
5//! citra-solve uses geometric hashing of 4-star patterns (quads) to achieve
6//! fast, memory-efficient plate solving suitable for wide field-of-view
7//! systems with significant optical distortion.
8//!
9//! ## Features
10//!
11//! - **Low memory footprint**: ~16KB runtime heap, memory-mapped indices
12//! - **Wide FOV support**: 10+ degree fields with SIP distortion modeling
13//! - **Robust matching**: Handles false stars (noise) and missing stars
14//! - **Fast solving**: O(1) hash table lookups, early termination
15//!
16//! ## Quick Start
17//!
18//! ```no_run
19//! use citra_solve::{Solver, SolverConfig, DetectedStar, Index};
20//!
21//! // Load a pre-built index
22//! let index = Index::open("hipparcos.idx").unwrap();
23//!
24//! // Create solver with default config
25//! let solver = Solver::new(&index, SolverConfig::default());
26//!
27//! // Your detected stars from image
28//! let stars = vec![
29//!     DetectedStar { x: 512.0, y: 384.0, flux: 1000.0 },
30//!     // ... more stars
31//! ];
32//!
33//! // Solve!
34//! match solver.solve(&stars, 1024, 768) {
35//!     Ok(solution) => println!("Solved: RA={}, Dec={}", solution.center.ra_deg(), solution.center.dec_deg()),
36//!     Err(e) => eprintln!("Failed to solve: {}", e),
37//! }
38//! ```
39
40pub mod bench;
41pub mod catalog;
42pub mod core;
43pub mod pattern;
44pub mod solver;
45pub mod wcs;
46
47#[cfg(feature = "extract")]
48pub mod extract;
49
50// Re-export main types for convenience
51pub use crate::catalog::index::Index;
52pub use crate::core::types::{DetectedStar, RaDec, Vec3};
53pub use crate::solver::solution::Solution;
54pub use crate::solver::solver::{Solver, SolverConfig};
55pub use crate::wcs::Wcs;
56
57#[cfg(feature = "extract")]
58pub use crate::extract::{extract_stars, ExtractionConfig};
59
60/// Error types for the library
61pub mod error {
62    pub use crate::catalog::error::CatalogError;
63    pub use crate::solver::error::SolveError;
64}