Add blind plate solving as the fallback when the seeded solver cannot match

The seeded solver starts from the header's pointing, scale and roll
angle and matches against Gaia. That works whenever the image and the
catalogue hold recognisably the same stars, and fails when they do not: a
single 60 second narrowband frame over a four degree field records a
sparse, shallow population that overlaps poorly with any magnitude slice
of Gaia, and no amount of window sliding fixes a population mismatch.

A blind solver does not care about any of that. It builds geometric
hashes from the image's own stars and looks them up in pre-built indexes,
so it needs no pointing, no scale and no orientation - only pixels.
blind.py drives nova.astrometry.net through astroquery, passing the plate
scale as a hint where one is known, which turns a search over every
possible scale into a search over one.

Two properties worth stating plainly. It needs a free API key, and
without one it says so clearly and the pipeline continues unsolved rather
than failing. And it uploads the image to a third-party service, which is
fine for these targets but is a fact worth knowing before pointing it at
something unpublished.

The result is verified rather than trusted. Whatever the service returns
is matched back against Gaia locally and put through the same gate as the
seeded solver - 40 stars and 1.5 px - so a solution has to be good, not
merely returned. A wrong WCS remains worse than no WCS whoever produced
it.
This commit is contained in:
laurence 2026-07-21 22:47:29 +01:00
parent 3c4ae5c77e
commit 2f268c7ca9
2 changed files with 191 additions and 0 deletions

View file

@ -84,6 +84,17 @@ def process(root, stages=STAGES, force=False, verbose=True):
# An unsolved session still produces images; record and go on.
print(f" solve failed: {type(exc).__name__}: {exc}")
results["solve"] = None
if not results.get("solve"):
# The seeded solver needs the image and the catalogue to hold
# recognisably the same stars. When they do not, a blind solve
# ignores the pointing entirely and works from the pixels.
import blind
try:
results["solve"] = blind.run(
s, scale_hint=s.scale, verbose=verbose)
except Exception as exc: # noqa: BLE001
print(f" blind solve failed: "
f"{type(exc).__name__}: {exc}")
if "colour" in stages:
import colour