Skip to content

About

One-button astrophotography: capture, stack and deliver a finished photo from a DSLR/mirrorless camera.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

AstroPhoto

One tap → a finished astro photo. Connect your camera, press GO on your phone, and the software does the rest: connect, focus check, exposure planning, framing, capture a stack of subs, reject bad ones, calibrate, register, stack, stretch, and hand you a JPEG/TIFF.

It runs today, with no hardware via a built‑in camera simulator (a "Try the demo" button), and the real Sony A7 III driver is wired in for when you connect the camera (final on‑camera validation via the soak test is pending real hardware).

How you connect (be clear‑eyed about the A7 III): the Sony A7 III has no wireless computer control — its PC Remote mode is USB‑only (no firmware ever added Wi‑Fi tethering; Bluetooth is shutter/geotag only). So the camera connects by a short USB‑C cable to the machine running this app, and you control that wirelessly from your phone over its Wi‑Fi — exactly the ASIAIR/smart‑telescope appliance model. Wi‑Fi (PTP/IP) is included as an experimental, best‑effort option for other/newer bodies that support it; it is not RAW‑capable on the A7 III. The web UI runs in any phone browser (installable as a PWA where the browser allows it).

                 ┌─────────────── phone (PWA) ───────────────┐
                 │  GO · live preview · status · download    │
                 └───────────────▲───────────────────────────┘
                       REST + WebSocket │  (Pi/N100 Wi‑Fi hotspot, offline)
   ┌───────────────────────────────────┴────────────────────────────────┐
   │ FastAPI orchestrator ── one‑button STATE MACHINE ── SQLite journal   │
   │   connect→identify→mode→focus→meter→frame→capture→finalize→deliver   │
   └───┬───────────────────┬────────────────────────┬────────────────────┘
       │ Unix socket        │                        │
 ┌─────▼───────┐   ┌────────▼────────┐    ┌──────────▼──────────────────┐
 │ CAMERA      │   │ PLATE SOLVE     │    │ PROCESSING                  │
 │ BROKER      │   │ ASTAP (opt.)    │    │ Siril (opt.) or pure‑Python │
 │ *separate   │   └─────────────────┘    │ calibrate→register→stack→   │
 │  process*   │                          │ gradient→stretch→JPEG/TIFF  │
 │ libgphoto2  │                          │ → success|degraded|failed   │
 │ / simulator │                          └─────────────────────────────┘
 └─────┬───────┘
   Sony A7 III (USB‑C / PC Remote)  ·  [tracker/mount via INDI — later]

Why this shape (the short version)

  • Wrap, don't reinvent. libgphoto2 for the A7 III (Sony's SDK doesn't support this body), Siril for stacking, ASTAP for solving — each an isolated subprocess (GPL‑safe). We build only the glue: the one‑button state machine, camera abstraction, live preview, and phone UI.
  • The camera is a separate process. A native libgphoto2 crash takes down the broker, not the app; it restarts and the session reconnects.
  • Honest UX. On a tripod there's no way to move the sky, so it's "aim + focus (with assist) → one tap." Plate‑solve confirms/labels where you're pointed; a test sub measures real star trailing instead of trusting a formula.

See docs: the plan and the code comments for the full reasoning (validated with a Codex design review).

The interface

One screen, three moments (real screenshots, phone-sized — same UI on the laptop browser):

1 · Connect 2 · Capturing (live stack) 3 · Done
connect capturing delivered
  • Connect: auto-detects the camera over USB ("✓ Sony A7 III detected — press GO"); Wi-Fi and a no-hardware ▶ Try the demo as alternatives.
  • Capturing: the live-stacked preview visibly improves as subs come in; counters for subs/kept/SNR/ETA; Finish now always yields a photo, Cancel aborts cleanly.
  • Done: final stacked image, an honest quality note (success/degraded), one-tap ⬇ Download photo, and GO ready for the next run.

Quick start (no camera needed)

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[science]"          # numpy/scipy/astropy/astroalign
astrophoto simulate --subs 20 --sub-seconds 8      # headless end‑to‑end → prints image path
astrophoto serve                     # open http://localhost:8000 and press GO

With your Sony A7 III

  1. Camera: USB = PC Remote, Manual, RAW, explicit ISO, Long‑Exposure NR off (details: deploy/install-macos.md / deploy/install-raspberrypi.md).
  2. pip install -e ".[camera]" (needs libgphoto2 installed).
  3. Run the P0 gate first: astrophoto soak --driver gphoto --count 300 — this is the real "is capture reliable?" test (hundreds of exposures, reconnects, aborts, restarts; checks for duplicate/stale/missing frames + metadata). Pass it before an imaging night.
  4. astrophoto serve, open the page on your phone over the hotspot, press GO.

Commands

Command What it does
astrophoto serve API + web UI (auto‑opens the browser; phone can join over Wi‑Fi)
astrophoto run full capture from the terminal — no browser, one device (laptop‑only)
astrophoto demo open the app and auto‑run a simulated session
astrophoto simulate headless one‑button run against the simulator
astrophoto soak P0 camera‑reliability soak test (the MVP gate)
astrophoto capture-test single capture diagnostic
astrophoto broker run the standalone camera broker (usually auto‑spawned)

Two ways to drive it from one laptop: open the web UI (astrophoto serve → browser) for the visual live‑preview experience, or stay in the terminal (astrophoto run --driver gphoto --minutes 15). Both do the identical capture→stack flow; the phone/Wi‑Fi is just an optional extra screen for later (e.g. a Raspberry Pi at the mount).

Layout

astrophoto/
  cameras/      base interface · simulator · gphoto (A7 III) · registry
  broker/       standalone camera process: protocol · service · client
  exposure/     NPF/500 exposure planning + measured trailing check
  session/      SQLite WAL journal (resumable, no orphaned frames)
  pipeline/     quality gate · stack (pure‑python) · siril adapter · finalize
  platesolve/   ASTAP adapter
  orchestrator/ the one‑button state machine
  api/          FastAPI + WebSocket + static PWA serving
  soak/         the P0 soak‑test harness
web/            phone‑first PWA (vanilla JS, no build step)
deploy/         udev rule · systemd units · macOS & Pi install guides

Status & roadmap

Implemented: full one‑button flow end‑to‑end (simulator + real‑camera driver), QA gating, calibration (darks/flats/bias), pure‑Python + Siril stacking, ASTAP solving, resumable journal, phone UI, soak harness. Next: OpenLiveStacker‑backed live preview, INDI mount GoTo + autofocus + dithering (tracked deep‑sky), calibration‑library reuse, other camera brands.

Built for a Sony A7 III + FE 24‑105 F4 G OSS; generalizes to other bodies via the CameraDriver interface.

About

One-button astrophotography: capture, stack and deliver a finished photo from a DSLR/mirrorless camera.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages