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); - which pixel scales to try when the scale is not known (
ScaleSearch,ladder); - 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§
- Hypothesis
- One scale hypothesis:
centre × SCALE_STEP^step. - 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. - Scale
Search - 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:
.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).
- 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), asastap_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_STEPbelow 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:
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, …). - 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.iniasWARNING.- index_
files - Every arcsec blind index (
*.arcsecix) directly indir, sorted by name. Empty when there are none ordircannot be read. - ladder
- The hypotheses
centre × √2^kforkinlo..=hi, most likely first. - 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°.