Replace annular cloud veil with full-frame east sky backdrop

The annular-ring veil approach sampled too small a region (38 px moon
in 3840×2160 gives a tiny annulus) and was invisible in practice.
More fundamentally, using the whole east sky is what "relayed to where
it was taken" actually means.

New approach — _make_east_sky_backdrop():
  Scale the full east camera frame to output size, apply GaussianBlur
  r = output_width // 6 (≈ 320 px at 1920 wide).  The blur erases RTSP
  artefacts, OSD overlays, and the wide-angle look while preserving real
  sky colour, cloud / haze gradients, and the dark ground silhouette.
  The NASA moon disk is pasted sharp on top.  The result reads as east
  photographed the moon through a telephoto with its actual sky that night.

  Clear dark sky → nearly black backdrop (same feel as before).
  Thin cloud cover → soft grey-blue haze behind the sharp moon.
  Heavy overcast → the moon detection would not qualify, so this case
    never reaches rendering.

Config rename: MOON_CLOUD_OVERLAY_* → MOON_EAST_SKY_ENABLED / _BLUR.
moon_phase_monthly.py: CLOUD_OVERLAY_* → EAST_SKY_*.
render_phase_closeup(): cloud_overlay_* params → east_sky_*.

test_moon_composite.py: replace full_moon_closeup.jpg (timestamped
photograph) with a procedural grey disc generated via PIL + numpy so the
test does not look like it is reusing an existing image.

https://claude.ai/code/session_01HkTxpNSTWtViZzxbrbKytR
This commit is contained in:
Claude
2026-05-01 18:17:54 +00:00
parent 5244fbb89b
commit 1425a6e5f4
4 changed files with 151 additions and 182 deletions
+4 -7
View File
@@ -85,9 +85,8 @@ OUT_H = int(CONF.get('MOON_OUTPUT_H', CONF.get('MOON_FULL_OUTPUT_H', 1080)))
MOON_PCT = float(CONF.get('MOON_HEIGHT_PCT', 0.92))
REQUIRE_EAST_VERIFY = CONF.get('MOON_REQUIRE_EAST_VERIFY', 'true').lower() != 'false'
CLOUD_OVERLAY_ENABLED = CONF.get('MOON_CLOUD_OVERLAY_ENABLED', 'true').lower() != 'false'
CLOUD_OVERLAY_MAX_OPACITY = float(CONF.get('MOON_CLOUD_OVERLAY_MAX_OPACITY', 0.40))
CLOUD_OVERLAY_BLUR = int(CONF.get('MOON_CLOUD_OVERLAY_BLUR', 0))
EAST_SKY_ENABLED = CONF.get('MOON_EAST_SKY_ENABLED', 'true').lower() != 'false'
EAST_SKY_BLUR = int(CONF.get('MOON_EAST_SKY_BLUR', 0))
PHASE_SPEC = {
@@ -373,10 +372,8 @@ def _render_and_post(phase, spec, target_utc, when_utc, local_dt, cam,
output_size=(OUT_W, OUT_H), moon_height_pct=MOON_PCT,
caption=caption,
east_frame_path=east_frame_path,
east_detection=east_detection,
cloud_overlay_enabled=CLOUD_OVERLAY_ENABLED,
cloud_overlay_max_opacity=CLOUD_OVERLAY_MAX_OPACITY,
cloud_overlay_blur=CLOUD_OVERLAY_BLUR,
east_sky_enabled=EAST_SKY_ENABLED,
east_sky_blur=EAST_SKY_BLUR,
)
print(f'wrote {out_path}')