Skip to content

Add allsky_skyquality: calibrated mag/arcsec² Sky Quality Meter - #339

Open
benhartwich wants to merge 1 commit into
AllskyTeam:masterfrom
benhartwich:add-allsky-skyquality
Open

Add allsky_skyquality: calibrated mag/arcsec² Sky Quality Meter#339
benhartwich wants to merge 1 commit into
AllskyTeam:masterfrom
benhartwich:add-allsky-skyquality

Conversation

@benhartwich

Copy link
Copy Markdown

allsky_skyquality — calibrated mag/arcsec² Sky Quality Meter

Adds a new module allsky_skyquality.

What it does

Reports night sky brightness in mag/arcsec² and writes a rolling skyquality.json
for time-series charting — no database or external sensor required.

How it differs from the bundled allsky_sqm

allsky_sqm reports a raw ROI mean ADU. Because Allsky auto-exposes and
auto-gains at night
, raw ADU is not comparable between frames (a darker sky just
gets a longer exposure and lands at a similar ADU). This module normalises first:

signal = mean_ADU / exposure_s / gain_factor      gain_factor = 10^(gain / gain_scale)
mag    = offset − 2.5 · log10(signal)

so the reading tracks true sky brightness. offset is a one-time per-camera
calibration constant. It also records three sensor-free extras: template-matched
star count, a cloud index (star-deficit grid) and a candidate aurora index
(green excess on the north horizon).

Notes

  • Night event only; fast (single grayscale pass + optional template match).
  • Uses only cv2 + numpy (already shipped with Allsky) — no extra requirements.
  • Full README, calibration guide and a ready-made charting dashboard:
    https://github.com/benhartwich/allsky-skyquality
  • Approach inspired by indi-allsky.

Tested live on a ZWO 4K fisheye camera (astronomy.garden): monotonic night curve,
darkest reading ≈ 20.8 mag/arcsec² after calibration.

An advanced alternative to the bundled allsky_sqm module: reports sky brightness
in mag/arcsec2 with exposure/gain normalisation (Allsky auto-exposes at night, so
raw ADU is not comparable between frames), plus sensor-free star-count, cloud and
aurora indices. Writes a rolling skyquality.json for charting. Night event only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant