Expand description
Catalogue management for the arcsec plate solver.
arcsec solves against star databases (ASTAP’s D05 … W08) and, for blind solving, a blind index built from one of them or Astrometry.net index files. This crate is everything about those files that is not solving:
- what can be installed, and how to recognise it on disk (
registry); - where catalogues live (
default_dir) and which database suits a field (select_db_for_fov, re-exported fromarcsec_core::auto, which the solver itself uses); - downloading and unpacking them (
install,fetch; thedownloadfeature); - removing and checking them (
remove,verify); - planning, costing and building arcsec’s own blind index (
index).
Nothing here prints or exits: results and errors are typed. Long operations
(a download, an index build) report through a callback, and stop early when the
thread’s arcsec_core::cancel token is cancelled, as a solve does.
use arcsec_catalogue::{default_dir, registry, select_db_for_fov};
let dir = default_dir();
for e in registry::REGISTRY {
let state = if registry::is_installed(&dir, e) { "installed" } else { "-" };
println!("{:<10} {:<10} {state}", e.id, e.purpose.label());
}
println!("for a 1.5° field: {:?}", select_db_for_fov(&dir, 1.5));§Features
download(default):fetchandinstall, over HTTPS withureqandrustls, and zip, tar and xz extraction. Without it the crate pulls in no network or TLS code; everything else still works.
The arcsec command line is built on this crate; its API follows that user and
may change between minor versions.
Modules§
- fetch
- Downloading and unpacking catalogues: resumable HTTPS downloads, and zip and
.deb(ar, tar, xz) extraction that cannot write outside its destination. - index
- arcsec’s own blind index: which one to build for the databases installed, what
it will cost, whether the one there is current, and building it. See
docs/offline-index.mdin the arcsec repository. - registry
- Every catalogue arcsec knows how to install, and how to recognise its files on disk.
- sys
- What the machine has to spare: free disk space and memory, for the checks made before building a blind index or downloading a catalogue.
Structs§
- Catalogue
Check verify’s finding for one installed catalogue.- Index
Check verify’s finding for one blind index file.- Install
Options - Options for
install. - Installed
- What
installinstalled. - Removed
- What
removeremoved. - Verification
- What
verifyfound in a directory.
Enums§
- Error
- A catalogue operation that failed. The
Displaytext is a complete sentence fragment naming the file or download concerned, fit to show a user. - Index
Health - The state of a blind index file.
- Install
Event - What
installreports while it runs, in order. - Problem
- Something wrong with an installed catalogue.
Constants§
- ASTAP_
EXTS - Choosing a star database. These live in
arcsec_core::autobecause a solve makes the same choice when it is not told; they are re-exported here so that a program managing catalogues finds them in one place. 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 - Choosing a star database. These live in
arcsec_core::autobecause a solve makes the same choice when it is not told; they are re-exported here so that a program managing catalogues finds them in one place. 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).
Functions§
- available_
dbs - Choosing a star database. These live in
arcsec_core::autobecause a solve makes the same choice when it is not told; they are re-exported here so that a program managing catalogues finds them in one place. Every database prefix present indb_path, in any supported format, sorted. - default_
db_ path - Choosing a star database. These live in
arcsec_core::autobecause a solve makes the same choice when it is not told; they are re-exported here so that a program managing catalogues finds them in one place. The star database directory to use when none is named. - default_
dir - Where catalogues are kept and the solver looks by default:
$ARCSEC_CATALOG_DIR, else the platform’s data directory (~/.local/share/arcsec/catalogson Linux). Seearcsec_core::auto::default_catalog_dirfor the full rules. The directory may not exist yet. - download_
disk - Disk an install of
eneeds at its peak: an archive and its extracted files side by side (assumed no smaller than the archive), or the loose files. - duration
- A duration rounded the way a person would say it:
under 10 s,~20 s,~13 min,~1 h 30 min. - gigabytes
0.6 GB, or90.0 MBbelow 0.1 GB.- has_
star_ database - Choosing a star database. These live in
arcsec_core::autobecause a solve makes the same choice when it is not told; they are re-exported here so that a program managing catalogues finds them in one place. Whetherdirholds 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, …). - human_
bytes - Bytes, in decimal units, to one decimal place:
901.3 MB. - install
- Download catalogue
eintodir(created if need be) and unpack it there, reporting progress toon_event. - recommend
- The catalogue to suggest for
purposeand a fieldfov_degdegrees across: the smallest download whose published range covers the field, so the advice does not push a gigabyte on someone who does not need it.Noneif none covers it. - remove
- Delete every file of catalogue
efromdir. Blind indexes built from it are not touched; seecrate::index::indexes_removed_with. - select_
db_ for_ fov - Choosing a star database. These live in
arcsec_core::autobecause a solve makes the same choice when it is not told; they are re-exported here so that a program managing catalogues finds them in one place. Pick the installed database best suited to afov_degfield (the longer side, degrees): the densest whose published range contains it, else the nearest.Nonewhendb_pathholds no star database at all. - verify
- Check that every catalogue installed in
dirlooks structurally sound: no truncated files and the right number of them, and every blind index readable, intact and built from the database now installed.
Type Aliases§
- Result
- A catalogue operation’s result.