Skip to main content

Astronomical source matching and cross-catalog orchestration

Project description

AstroBridge

AstroBridge is a compact astronomical source matching pipeline that combines three pieces:

  • type-safe source models for catalogs and coordinates
  • intelligent query routing for catalog selection
  • Bayesian cross-matching for candidate association

The repository also includes an async orchestration layer and a runnable demo so new users can see the full flow quickly.

Recent additions include confidence scoring for every match and optional proper-motion-aware epoch matching.

Quick Start

Create a virtual environment, install the package, then run the demo or tests.

python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]

Run the demo:

astrobridge-demo

Or run it directly:

python demo.py

Run the test suite:

pytest

Run the web frontend:

pip install -e .[web]
astrobridge-web

Then open http://127.0.0.1:8000 in your browser.

What You Get

Matching Features

The probabilistic matcher now supports:

  • confidence scoring with human-readable rationale (astrometric, photometric, and ambiguity-aware)
  • optional proper-motion-aware matching across catalogs observed at different epochs
  • deterministic scoring behavior for reproducible runs and testing

Example usage with proper motion support:

from astrobridge.matching import BayesianMatcher

matcher = BayesianMatcher(proper_motion_aware=True)
matches = matcher.match(ref_sources, candidate_sources)

API-level matcher controls are also available through QueryRequest:

  • proper_motion_aware (bool)
  • match_epoch (datetime)
  • astrometric_weight (0-1)
  • photometric_weight (0-1)
  • weighting_profile (balanced, position_first, photometry_first)

These are applied by the orchestrator before query execution so callers can tune matching behavior per request.

The web console includes these controls directly in the UI so users can run interactive experiments without writing Python code.

Demo Flow

The demo script walks through the core phases in order:

  1. canonical models
  2. intelligent routing
  3. Bayesian matching
  4. async orchestration

It uses synthetic data so it can run without external catalog access.

Development Notes

The test suite uses pytest-asyncio, which is included in the dev extra.

Simbad and NED currently use deterministic local datasets for fast, reliable development and CI validation.

Live SIMBAD TAP Adapter

SIMBAD exposes a TAP service, and AstroBridge includes a live adapter for it: SimbadTapAdapter in astrobridge/connectors.py. AstroBridge also includes NedTapAdapter for NED TAP-style access in the same module.

Install live adapter dependency:

pip install -e .[live]

Example usage:

import asyncio
from astrobridge.connectors import SimbadTapAdapter
from astrobridge.models import Coordinate

async def main():
	adapter = SimbadTapAdapter()

	by_name = await adapter.query_object("Prox Cen")
	print("name hits:", len(by_name))

	around = await adapter.cone_search(
		Coordinate(ra=217.429, dec=-62.680),
		radius_arcsec=60,
	)
	print("cone hits:", len(around))

asyncio.run(main())

NED adapter usage follows the same shape:

from astrobridge.connectors import NedTapAdapter

adapter = NedTapAdapter()

Default TAP endpoint used:

  • https://simbad.cds.unistra.fr/simbad/sim-tap
  • https://ned.ipac.caltech.edu/tap

Test Coverage For Adapter Steps

Every adapter development step should include tests under tests/. Current live-adapter unit coverage is in tests/test_live_adapters.py using injected fake TAP services so tests stay deterministic and network-independent. This suite now includes retry, timeout, and malformed-row fallback scenarios for both TAP adapters.

Project Layout

Status

The repository currently passes its full test suite (98/98) in the default virtual environment when the dev dependencies are installed.

Handoff Notes

Use WORKLOG.md as the running implementation journal for future contributors. Store run/test validation artifacts in logs/ for reproducible handoff checkpoints.

The next major step is implementing real catalog connectors and unskipping integration tests that currently depend on live connector behavior. Simbad and NED now include deterministic local implementations for query_object and cone_search, and integration matching tests run without skips.

The next major step is adding multi-attribute weighted matching controls (for example spatial + photometric weighting profiles) and exposing these controls through the API layer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astrobridge-0.1.0.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astrobridge-0.1.0-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file astrobridge-0.1.0.tar.gz.

File metadata

  • Download URL: astrobridge-0.1.0.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for astrobridge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 38ba4b4963b4f4fa548ebc622d56d851fd0816dc48cdba96a5b9feb5804e0756
MD5 08cca62742b5bc8e4f128afb38005c61
BLAKE2b-256 6c82fa0c3352737f8e116e81ceaa8dbb82902ad91b4f1322b88b5960f2bd9b10

See more details on using hashes here.

File details

Details for the file astrobridge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: astrobridge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for astrobridge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7805131f44074f1af4a500769aa213d2796c72bcffa48621133ee64f6d5f401c
MD5 74bb801757d695f4099bea62648a995b
BLAKE2b-256 6837a7b99abce5dcb191f12998e936177f05603a698b08d5f9a967c2c66f9228

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page