Files
sky-cam/bootstrap.sh
T
Claude 5fb7ff09a3 Add nightly moon-track timelapse and monthly moon-phase composites
Two new jobs operate on the SUNRISE_CAM, sharing three Python helpers
(moon_phase, moon_detect, moon_composite) and one cached lunar texture:

- moon-track.sh: nightly batch detects the moon in each east frame,
  crops a 480x480 box around it, stitches into an mp4 that holds the
  moon roughly centred while clouds and stars drift past.

- moon-phase-monthly.sh: daily check that runs whichever phase composite
  is due that day. Handles full moon (posts D+3), first quarter (D+2,
  best-effort due to daytime-only geometry from east), and third quarter
  (D+2). Picks the frame closest in time to the exact phase moment that
  meets quality / altitude / illumination thresholds, then composites
  the cached lunar texture into it -- sky/halo/parallactic-angle/timing
  real from east, surface detail borrowed from the reference image.

Honest-by-design: a 38-px white blob from a wide-field IP camera cannot
be enhanced into crater detail by software. The composite makes the
borrowing explicit and constrains everything else (when, where, sky,
orientation) to match what east actually saw.

install.sh now downloads the skyfield ephemeris (de421.bsp) and the
default lunar reference (Wikipedia CC BY-SA full-moon photo) on first
run. Both can be overridden via .env.

https://claude.ai/code/session_015PBVDESC3KLMbq1LpA6qLn
2026-04-30 11:40:11 +00:00

40 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# bootstrap.sh — download and unpack sky-cam from GitHub.
#
# Usage:
# bash bootstrap.sh [TARGET_DIR]
#
# Downloads the latest sky-cam from GitHub into TARGET_DIR (default: ./sky-cam),
# then tells you what to do next.
set -euo pipefail
TARGET="${1:-sky-cam}"
REPO="outis1one/sky-cam"
BRANCH="main"
URL="https://github.com/$REPO/archive/refs/heads/$BRANCH.tar.gz"
echo "Downloading sky-cam from GitHub..."
curl -fL "$URL" | tar xz
mv "sky-cam-$BRANCH" "$TARGET"
echo ""
echo "Done. Next steps:"
echo " 1. Install system packages (if not already present):"
echo " sudo apt install ffmpeg bc fonts-dejavu"
echo " pip3 install suntime pytz requests"
echo " pip3 install skyfield Pillow numpy scipy # moon jobs (moon-track, moon-phase-monthly)"
echo ""
echo " 2. Edit $TARGET/sky-cam.conf"
echo " — SCRIPT_DIR full path to the directory you'll run scripts from"
echo " — BASE_DIR where your camera images live"
echo " — MUSIC_DIR path to your Vivaldi Four Seasons audio files"
echo " — CAMERAS list of camera names, e.g. (east) or (east north south west)"
echo " — SUNRISE_CAM which camera faces east (gets the sunrise video job)"
echo " — LATITUDE / LONGITUDE / TIMEZONE your location"
echo ""
echo " 3. cd $TARGET && ./install.sh"
echo " This generates .env.example — copy it to .env and add credentials:"
echo " cp $TARGET/.env.example $TARGET/.env"
echo " nano $TARGET/.env"