Skip to main content

HARP - Horizon-Aware Recommender and Planner for deep-sky astrophotography sessions

Project description

HARP

image the sky your balcony can actually see

Horizon-Aware Recommender and Planner

A CLI planner for deep-sky astrophotography sessions. Given a date, a site, your telescope + camera, the real horizon of your spot and the Moon, HARP ranks the targets you can actually image tonight — usable windows, Moon impact, and mosaic framing tailored to your rig.

Version CI Python GitHub issues

License: GPL v3 License: BSD-2 License: BSD-3 License: MIT

🧱 Horizon-aware visibility
Measure your site's obstructions once as an azimuth-dependent mask (.hrz, N.I.N.A.-compatible). A target counts as observable only when its altitude clears the ridge/wall in its own direction — not against an idealized flat horizon. Horizon guide
⏱️ Continuous imaging windows
Per target: total usable hours during astronomical darkness plus the longest continuous run before it enters a blocked sector — the number you actually size exposures and mosaic panels on. Reading the output
🏆 Desirability ranking
Every target gets a 0-100 score: a weighted geometric mean of continuous window, total hours, peak altitude (inverse-airmass), Moon verdict, and how well the object fills your field of view — so one hopeless factor sinks a target instead of averaging away. --sort hours restores the classic order.
🌙 Moon impact model
Phase and separation folded into a per-target verdict — none, ok(NB), low/med/high — with narrowband auto-derived from the object type: planetaries, supernova remnants and HII regions shrug at a Moon that ruins broadband RGB.
🖼️ Mosaic framing & panel coordinates
Your focal length + sensor decide 1 frame or mosaic NxM; harp mosaic then emits the actual per-panel RA/Dec centers (overlap-aware, position-angle rotated, correct at any declination) — plus single-frame crop suggestions for the monsters. Mosaic guide
🎯 N.I.N.A. integration
The same .hrz horizon drives both tools, and --nina exports ranked targets or mosaic panels as CSVs N.I.N.A.'s sequencer imports directly — verified against N.I.N.A.'s actual parser source. Plan in HARP, shoot in N.I.N.A., retype nothing. N.I.N.A. guide
🔭 Offline catalogues + your own
Curated large emission nebulae (deliberately not magnitude-filtered), full Messier/NGC/IC via pyongc (--catalogs M,NGC,IC), and a user targets file that overrides everything (--targets). Cross-identification dedup: M42 and NGC1976 are one object, M43 stays its own. No network at run time.
📈 Table, CSV, charts
A ranked terminal table, a CSV for your session log, and altitude charts with the horizon obstruction band and the usable window overlaid — one command, all artifacts, all greppable and scriptable.

Full documentation — installation, usage, horizon measuring, configuration


What HARP does

harp plan                                    # tonight, default site/optics from config
harp plan 2026-08-15 --site balcony --optics newton800
harp plan --catalogs M,NGC,IC --targets my_targets.yaml   # full catalog + your objects
harp plan --nina tonight.csv                 # export ranked targets for N.I.N.A.
harp mosaic IC1396 --pa 30 --nina panels.csv # per-panel coords -> N.I.N.A. sequencer
harp list                                    # sites and optics defined in the config
harp horizon points.yaml -o balcony.hrz      # measured vertices -> .hrz horizon file
=== Night 2026-08-15 | Castelli Balcony 41.7380,12.8899 ===
Astronomical darkness: 21:53 -> 04:32 local
Moon: ~12% illuminated  |  above horizon: below horizon all night
Setup: 800 mm + custom 23.5x15.7
Field of view: 101' x 67'  |  horizon: balcony.hrz

 # object                 score kind      const   hrs cont       window altMx   az moonSep   Moon  frame
--------------------------------------------------------------------------------------------------------
 1 NGC281 Pacman             99 Nebula    Cas     6.7  6.7  21:53-04:28    75    0     127   none  1 frame
 2 NGC7380 Wizard            99 Nebula    Cep     5.2  5.2  21:53-03:03    73    0     124   none  1 frame
 3 NGC1039                   99 Open Clus Per     6.7  6.7  21:53-04:28    71   78     128   none  1 frame
 4 IC59/63 Ghost of Cas      99 Nebula    Cas     6.7  6.7  21:53-04:28    71  360     122   none  1 frame
 5 Sh2-155 Cave              98 Nebula    Cep     5.8  5.8  21:53-03:38    69    0     121   none  1 frame

Altitude charts

The typical flow: measure the horizon once → generate the .hrz → load it in N.I.N.A. and in HARP → plan the night → export the ranked targets (or the mosaic panels) straight into N.I.N.A.'s sequencer. See examples/ for a working config, horizon file, and sample outputs.

The name

A harp is the celestial Lyre — the constellation Lyra, home of Vega and the Ring Nebula. And the acronym leads with the input most planners ignore: your horizon.

Installation

pip install harp-astro

The distribution is harp-astro (the bare PyPI name is squatted by an empty project; a PEP 541 request is pending) — the installed package and the CLI command are plain harp.

From source:

git clone https://github.com/szaghi/harp
cd harp
make dev

Configuration

Sites (position + .hrz + timezone) and optical setups (focal + sensor) live in sites.yaml, searched in the current directory and ~/.config/harp/. Precedence: CLI option > config value > built-in default. Details in the usage guide.

Development

make dev     # editable install with dev extras into .venv
make test    # pytest with coverage
make lint    # ruff check + format check (read-only)
make fmt     # ruff auto-fix + format

Releases: ./release.sh --major|--minor|--patch|X.Y.Z (trunk model on main; tag push triggers CI → PyPI).

Authors

Stefano Zaghi (@szaghi)

HPC/CFD researcher by day, balcony astrophotographer by night. Owns a Newton 200/800 f/4 and a balcony whose entire southern hemisphere is a wall. Measured the horizon with a phone compass while fending off a magnetized railing, then wrote a planner rather than accept that M8 belongs to the neighbours.

Claude (Anthropic)

Large language model, second author, zero telescopes. Has never seen the night sky — or anything else — yet computed where the Moon would be at 03:46 and was right. Refactored the whole toolkit between dusk and dawn, no coffee involved; accepts payment in tokens and byte-identical CSVs.

License

Multi-licensed under GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause, and MIT — choose the one that fits your use. See licensing/.

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

harp_astro-0.1.0.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

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

harp_astro-0.1.0-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: harp_astro-0.1.0.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for harp_astro-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c97860bbbc5b2a858228fe1467470ea7d964706757b89307c2e3944b85c96bc3
MD5 5d6ded30932f6d1a86456f4c514adc72
BLAKE2b-256 e9005ceed2b673db8a70c96f469f3ad5357350092fa8b65a7055b17bc3c3ff1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for harp_astro-0.1.0.tar.gz:

Publisher: ci.yml on szaghi/harp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: harp_astro-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for harp_astro-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 429259bf558308401ffe0b97c7edbbb29c70cf8a32d073eeb5a6714d45e5ff75
MD5 dc25ddf2096398623e6e9a5bd81beb0f
BLAKE2b-256 7b2122289fda6ee79e5d5b1b69efe6b98d123f1b5fba4d5a85e97c16ecc816bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for harp_astro-0.1.0-py3-none-any.whl:

Publisher: ci.yml on szaghi/harp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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