Expand description
Everything the arcsec command line decides for the user, as a library.
crate::pipeline::solve_image needs to be told everything: the field size in
radians, the binning, the database directory and name, the minimum star size in
(binned) pixels. A user — of the CLI, or of an application embedding arcsec —
knows less than that and expects the rest to be worked out the way the CLI does
it. This module is that working-out, shared by the arcsec binary and the C
library so the two cannot drift:
- where catalogues live (
default_catalog_dir,default_db_path); - which star database suits a field (
select_db_for_fov); - how far to bin (
choose_binning); - when to use a blind index, and how (
find_arcsec_index,collect_index_files); - and the whole solve built from those decisions: a
SolveRequestbecomes aPlan, andPlan::solveruns it.
use arcsec_core::auto::{Plan, SolveRequest};
let mut img = load();
img.normalize_for_detection();
let request = SolveRequest {
hint: Some((83.82_f64.to_radians(), (-5.39_f64).to_radians())),
pixel_scale: Some(1.1),
search_radius: 10.0_f64.to_radians(),
..SolveRequest::default()
};
let plan = Plan::new(&request, img.width, img.height)?;
let solved = plan.solve(&img)?;
println!("RA {:.4}°", solved.wcs.ra0.to_degrees());Structs§
- Plan
- A
SolveRequestwith every decision made, for an image of a given size. - Solve
Request - What the caller knows about an image and how it wants it solved, in the
caller’s terms. Every field has the CLI’s default (
SolveRequest::default). - Solved
- A solution from
Plan::solve.
Enums§
- Event
- Something
Plan::solve_withreports while it runs.
Constants§
- ASTAP_
EXTS - File extensions of the star database formats, with the number of sky cells
each layout has:
.1476and.290tile the sky,.001is one all-sky file. - DB_
FOV_ RANGES - Field-of-view range each ASTAP database is built for, and how much we prefer it when several are eligible (higher = denser, so a better fit).
- MIN_
SOLVE_ DIM - Smallest image side, in (binned) pixels, that reaches the solver. Detection cannot run on a one-pixel-wide image, and would otherwise panic on it.
- SOURCES
- Databases an index can be built from, deepest first: an index built from an earlier one is preferred when a directory holds several.
Functions§
- available_
dbs - Every database prefix present in
db_path, in any supported format, sorted. - choose_
binning - The binning factor:
requestedif given and non-zero, else automatic. - collect_
index_ files - Collect and rank astrometry.net index files for blind solving.
- default_
catalog_ dir - Where catalogues are kept, in priority order:
- default_
db_ path - The star database directory to use when none is named.
- depth_
rank - Position of
dbinSOURCES(deeper is smaller); unknown names sort last. - find_
arcsec_ index - The arcsec blind index
pathnames: the file itself, or the first*.arcsecixin a directory.Nonewhen there is none (the path may still hold Astrometry.net files). - has_
star_ database - Whether
dirholds any of the star databases arcsec knows (D05 … W08), judged by the file each ships for its first cell (d50_0101.1476,w08_0101.001, …). - index_
files - Every arcsec blind index (
*.arcsecix) directly indir, sorted by name. Empty when there are none ordircannot be read. - preferred_
index - The readable arcsec index in
dirthe solver uses: the one built from the deepest database (bySOURCES), then by file name.Noneif there is none. - select_
db_ for_ fov - Pick the installed database best suited to a
fov_degfield (the longer side, degrees): the densest whose published range contains it, else the nearest.Nonewhendb_pathholds no star database at all. - wants_
installed_ index - Whether a search with
template’s radius and field is wide enough that an installed index is consulted automatically: more than five fields, and at least 10°.