Skip to main content

Module auto

Module auto 

Source
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:

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§

Hypothesis
One scale hypothesis: centre × SCALE_STEP^step.
Plan
A SolveRequest with every decision made, for an image of a given size.
SolveRequest
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_with reports while it runs.
ScaleSearch
When the catalogue search tries other pixel scales.

Constants§

ASTAP_EXTS
File extensions of the star database formats, with the number of sky cells each layout has: .1476 and .290 tile the sky, .001 is 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).
INACCURATE_SCALE
The fraction by which a solved scale may differ from the one the solve started from before the solution says so (inaccurate_scale_warning), as astap_cli.
LADDER_FIELDS
How far round the hint each hypothesis is searched, in fields of that hypothesis: the hint’s own position and the ring of eight round it. The search at the assumed scale then continues out to -r, as it always has.
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.
SCALE_STEP
Ratio between neighbouring hypotheses: astrometry.net’s index scales step by the same factor.
SOURCES
Databases an index can be built from, deepest first: an index built from an earlier one is preferred when a directory holds several.
UNKNOWN_STEPS
Steps of SCALE_STEP below and above 1″/px searched when nothing gives the scale: 0.25″/px to 64″/px, from a long focal length binned to a camera lens. The blind index searches 0.3–60″/px for the same case.
WRONG_STEPS
Steps either side of a scale that was given (or read from the header) and did not solve, with ScaleSearch::AlsoIfWrong: a quarter to four times it.

Functions§

available_dbs
Every database prefix present in db_path, in any supported format, sorted.
choose_binning
The binning factor: requested if 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 db in SOURCES (deeper is smaller); unknown names sort last.
find_arcsec_index
The arcsec blind index path names: the file itself, or the first *.arcsecix in a directory. None when there is none (the path may still hold Astrometry.net files).
has_star_database
Whether dir holds 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, …).
inaccurate_scale_warning
astap_cli’s warning when the solved scale is not the one it started from: Warning scale was inaccurate! Set FOV=1.00d, scale=1.2", printed after the solution and written to the .ini as WARNING.
index_files
Every arcsec blind index (*.arcsecix) directly in dir, sorted by name. Empty when there are none or dir cannot be read.
ladder
The hypotheses centre × √2^k for k in lo..=hi, most likely first.
preferred_index
The readable arcsec index in dir the solver uses: the one built from the deepest database (by SOURCES), then by file name. None if there is none.
select_db_for_fov
Pick the installed database best suited to a fov_deg field (the longer side, degrees): the densest whose published range contains it, else the nearest. None when db_path holds 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°.