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
This commit is contained in:
@@ -5,6 +5,8 @@ Automated sky / timelapse camera scripts that produce:
|
||||
- **Daily sunrise clip** — a speed-adjusted video of the sunrise window, uploaded to Mattermost each morning
|
||||
- **Four Seasons timelapse** — daily clips sized to each Vivaldi movement's music duration, assembled automatically into per-movement montages (with music + attribution overlay) and a full-year video
|
||||
- **Full-day timelapse** — a fixed-fps timelapse of every image captured that day, kept for a configurable retention window
|
||||
- **Nightly moon-track timelapse** — every east night frame where the moon is visible is cropped around the moon and stitched into a short mp4 (the moon roughly held still while clouds and stars drift past)
|
||||
- **Monthly moon-phase close-ups** — one composite per phase (full moon, first quarter, third quarter), framed as if east took it through a 65× telephoto. The sky/halo/parallactic-angle/timing are real-from-east; the lunar surface texture is borrowed from a cached high-res reference (no software can recover detail your camera didn't capture). Posted to Mattermost.
|
||||
|
||||
---
|
||||
|
||||
@@ -15,6 +17,7 @@ Automated sky / timelapse camera scripts that produce:
|
||||
```bash
|
||||
sudo apt install ffmpeg bc fonts-dejavu curl python3-pip
|
||||
pip3 install suntime pytz requests
|
||||
pip3 install skyfield Pillow numpy scipy # moon jobs (moon-track + moon-phase-monthly)
|
||||
```
|
||||
|
||||
| Package | Purpose |
|
||||
@@ -24,6 +27,8 @@ pip3 install suntime pytz requests
|
||||
| `fonts-dejavu` | Text overlays (sunrise time, attribution) |
|
||||
| `python3` + `suntime pytz` | Astronomical sunrise calculation — pure math, no internet, works indefinitely |
|
||||
| `python3` + `requests` | Mattermost upload |
|
||||
| `python3` + `skyfield` | Moon phases + altitude/azimuth + parallactic angle (offline after first ephemeris download) |
|
||||
| `python3` + `Pillow numpy scipy` | Moon detection + phase compositing |
|
||||
|
||||
### 2. Download
|
||||
|
||||
@@ -262,6 +267,48 @@ Replace the date list with whatever range you need. Each run produces one `*-fi
|
||||
./year-end-join.sh 2025 east
|
||||
```
|
||||
|
||||
**Moon jobs**:
|
||||
```bash
|
||||
# Re-run last night's moon-track timelapse for east
|
||||
./moon-track.sh east
|
||||
|
||||
# Back-fill moon-track for a specific past night
|
||||
./moon-track.sh east 2026-04-15
|
||||
|
||||
# Auto mode — runs whichever phase composite is due today (no-ops otherwise)
|
||||
./moon-phase-monthly.sh
|
||||
|
||||
# Force a single phase, picking the most recent occurrence
|
||||
./moon-phase-monthly.sh --phase full
|
||||
./moon-phase-monthly.sh --phase first-quarter
|
||||
./moon-phase-monthly.sh --phase third-quarter
|
||||
|
||||
# Build but skip the Mattermost post
|
||||
./moon-phase-monthly.sh --phase full --no-upload
|
||||
|
||||
# Dry run — find best frame, log it, build nothing
|
||||
./moon-phase-monthly.sh --phase third-quarter --dry-run
|
||||
|
||||
# Back-fill a specific event by exact UTC moment
|
||||
./moon-phase-monthly.sh --phase full --target 2026-04-01T15:51:00Z
|
||||
|
||||
# Inspect any moon-related stats for a frame
|
||||
python3 moon_detect.py BASE_DIR/east/2026-04-29/21-07-00.jpg --debug /tmp/dbg.png
|
||||
python3 moon_phase.py info 2026-04-29T21:07:00Z
|
||||
```
|
||||
|
||||
**Posting schedule**:
|
||||
|
||||
| Job | When the timer fires | When the artifact actually appears |
|
||||
|---|---|---|
|
||||
| Sunrise video | `SCHEDULE_SUNRISE` (default 03:00 local) | A few minutes after sunrise + `SUNRISE_POST_MIN` |
|
||||
| Moon-track timelapse | `SCHEDULE_MOON_TRACK` (default 02:30 local) | ~5 min after the timer, covers the previous night |
|
||||
| 🌕 Full Moon composite | `SCHEDULE_MOON_PHASE` (default 09:30 local) | 3 days after exact full moon (configurable: `MOON_FULL_POST_DELAY_DAYS`) |
|
||||
| 🌓 First Quarter composite | same timer | 2 days after exact first quarter (configurable: `MOON_QUARTER_POST_DELAY_DAYS`) — best-effort, see geometry note below |
|
||||
| 🌗 Third Quarter composite | same timer | 2 days after exact third quarter |
|
||||
|
||||
The moon-phase timer fires every day; the script no-ops on days that aren't a post-day for any phase, so you'll see exactly three posts per lunar cycle in Mattermost (sometimes only two if first quarter detection fails — see geometry note in `sky-cam.conf`).
|
||||
|
||||
**Check capture status**:
|
||||
```bash
|
||||
systemctl --user status sky-cam-capture-east.service
|
||||
|
||||
Reference in New Issue
Block a user