sunrise.py: replace suntime with skyfield for accurate sunrise calculation
The suntime library uses a simplified approximation that degrades at high latitudes as sunrise approaches very early hours near the summer solstice. The computed sunrise drifted progressively earlier than the actual event, shrinking the capture window until today it ended before the sun rose. Switch to skyfield's sunrise_sunset almanac (DE421 ephemeris), which is accurate to within a second at any latitude — the same library already used by moon_phase.py for sun events. The search window is anchored to local midnight→midnight UTC so the correct calendar-day sunrise is always returned regardless of timezone offset. Also promote skyfield to the core pip install in bootstrap.sh (dropping suntime, which is no longer needed) and tidy the stale "suntime" hints in 4-seasons.sh and montage-mvt.sh error messages. https://claude.ai/code/session_01S4oUbU9xNj91cbV5bj5NRn
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ echo "Processing: $yesterday"
|
||||
|
||||
# ── Season / movement info from astronomical calculation ──────────────────────
|
||||
_season_info="$(python3 "$SCRIPT_DIR/season_info.py" "$yesterday")" || {
|
||||
echo "Error: season_info.py failed — check Python dependencies (suntime pytz)"
|
||||
echo "Error: season_info.py failed — check Python dependencies (pytz)"
|
||||
exit 1
|
||||
}
|
||||
eval "$_season_info"
|
||||
|
||||
Reference in New Issue
Block a user