Simplify moon phase: binary go/no-go, parallactic angle rotation, no atmosphere overlay

- moon_composite.py: remove _make_atmosphere_layer() and all atmosphere
  parameters from render_phase_closeup(); add when_utc parameter and apply
  parallactic angle rotation so the NASA disk is oriented to match east's sky

- moon_phase_monthly.py: change obs time default to 22:00 (aligns with NASA
  hourly renders); scan east frames in 22:00-23:00 window; binary go/no-go
  (quality >= MIN_QUALITY = post, no clear shot = skip entirely); remove
  _atmosphere_opacity_from_quality(), ATMOSPHERE_BLUR, CLOUDY_POST_ENABLED

- sky-cam.conf: update MOON_OBS_TIME_LOCAL to 22:00, remove
  MOON_OBS_WINDOW_MIN, remove the atmospheric overlay and cloudy fallback
  sections and their config variables

- test_moon_composite.py: single clean test — fetch NASA for 22:00 UTC on
  2026-04-29, verify east frame quality, render with parallactic angle; no
  procedural fallback

https://claude.ai/code/session_01HkTxpNSTWtViZzxbrbKytR
This commit is contained in:
Claude
2026-05-01 22:27:34 +00:00
parent 9e2852fd73
commit a6989a9ea8
4 changed files with 98 additions and 268 deletions
+11 -40
View File
@@ -492,20 +492,18 @@ MOON_TRACK_CRF=24 # output mp4 CRF
MOON_TRACK_RETENTION_DAYS=90 # delete tracker mp4s older than this; 0 = forever
# Observation time ────────────────────────────────────────────────────────────
# Local time used to select the east camera frame and the NASA Dial-a-Moon
# render for each phase post. The script looks at east frames within
# ±MOON_OBS_WINDOW_MIN of this time on the night of the exact phase event,
# picks the one closest to the target time, and uses it to:
# 1. Determine atmospheric conditions (clear / hazy / overcast)
# 2. Set the atmosphere overlay opacity on the NASA moon image
# 3. Round to the nearest hour for the NASA API call
# Local time that defines the observation window: MOON_OBS_TIME_LOCAL to
# MOON_OBS_TIME_LOCAL+1h. East frames in this window are checked for a clear
# moon detection (quality >= MOON_MIN_QUALITY). If any frame qualifies, the
# NASA Dial-a-Moon image for MOON_OBS_TIME_LOCAL UTC is fetched and posted.
# If no frame shows a clear moon, the month is skipped entirely.
#
# 22:30 works well for full moon and first quarter (both visible after dark).
# For third quarter (rises after midnight), consider 02:30 or leave at 22:30
# and accept that the moon may be below the horizon — the script will warn
# and post a clean NASA render instead.
MOON_OBS_TIME_LOCAL=22:30
MOON_OBS_WINDOW_MIN=30 # ±minutes around obs time to check east frames
# 22:00 aligns directly with NASA's hourly renders. Full moon and third
# quarter both rise after dark and are visible at this hour. First quarter
# is up only until ~midnight from a new-moon start, so it may not be visible
# at 22:00 depending on the exact date — set MOON_FIRST_QUARTER_ENABLED=false
# if first-quarter posts are consistently missed.
MOON_OBS_TIME_LOCAL=22:00
# Post delay ──────────────────────────────────────────────────────────────────
# How many days after the exact phase to run the post. The post delay gives
@@ -537,33 +535,6 @@ MOON_HEIGHT_PCT=0.92 # moon disk fills this fraction of frame heig
MOON_DIALAMOON_TARGET_PX=2048 # cached PNG longest side; downsampled on save
MOON_DIALAMOON_TIMEOUT_SEC=30
# Atmospheric overlay ─────────────────────────────────────────────────────────
# East's camera frame is scaled to output size, blurred, and composited OVER
# the NASA moon disk. This is physically correct: clouds sit between the
# observer and the moon, so they occlude the disk rather than appear behind it.
#
# Opacity is derived from the moon detection quality in that frame:
# quality ≥ 0.85 → 0% (clear sky — pure NASA render)
# quality 0.70 → 20% (light haze)
# quality 0.55 → 40% (notable cloud, moon still detected)
# quality < 0.55 → 4065% (overcast fallback — see MOON_CLOUDY_POST_ENABLED)
# no detection → 68% (heavy overcast)
#
# blur radius: 0 = auto (output_width / 10); set in px to override.
#MOON_ATMOSPHERE_BLUR=0
#
# Cloudy-month fallback ───────────────────────────────────────────────────────
# If no frame in the collection window passes the quality + illumination
# thresholds, the script normally skips posting that month. With
# MOON_CLOUDY_POST_ENABLED=true it instead finds the above-horizon frame
# closest to the exact phase moment, applies a heavy atmospheric overlay
# (opacity 0.450.68), and posts the month anyway — the moon shows as a faint
# glow behind cloud rather than being absent entirely.
#
# This applies to all three phases: full, first-quarter, third-quarter.
# Caption will read "cloud cover — YYYY-MM-DD — NASA SVS Dial-a-Moon".
MOON_CLOUDY_POST_ENABLED=true
# ── Mattermost — daily sunrise upload ─────────────────────────────────────────
# mattermost_url, access_token, channel_id go in .env (see bottom of this file).