Remove all hardcoded deployment values; read from sky-cam.conf
- sunrise_video.10s.sh: use $TIMEZONE (was hardcoded America/New_York), $SUNRISE_PRE_MIN/$SUNRISE_POST_MIN for capture window, $SUNRISE_TARGET_SECS for output duration (was wrong value 8 in a script named 10s) - fullday-video.sh: remove hardcoded FULLDAY_FPS/RETENTION_DAYS; both now come from sky-cam.conf - 4-seasons.sh, montage-mvt.sh: export TIMEZONE after sourcing conf so season_info.py subprocess picks it up via env rather than falling back to its hardcoded America/New_York default - sky-cam.conf: add SUNRISE_PRE_MIN, SUNRISE_POST_MIN, SUNRISE_TARGET_SECS, FULLDAY_FPS, RETENTION_DAYS https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
@@ -28,11 +28,11 @@ fi
|
||||
# Output the sunrise time in UTC
|
||||
echo "Sunrise time (UTC): $sunrise_time"
|
||||
|
||||
# Set the time zone to Eastern US time (America/New_York)
|
||||
export TZ="America/New_York"
|
||||
# Export timezone so date and subprocesses use the configured local time.
|
||||
export TZ="$TIMEZONE"
|
||||
|
||||
# Convert sunrise time from UTC to Eastern Time (ET)
|
||||
sunrise_time_et=$(TZ="America/New_York" date -d "$sunrise_time" +"%H-%M-%S")
|
||||
# Convert sunrise time from UTC to local time.
|
||||
sunrise_time_et=$(TZ="$TIMEZONE" date -d "$sunrise_time" +"%H-%M-%S")
|
||||
|
||||
# Output the converted sunrise time in Eastern Time
|
||||
echo "Sunrise time (Eastern Time): $sunrise_time_et"
|
||||
@@ -46,9 +46,9 @@ time_to_seconds() {
|
||||
# Convert sunrise time (in Eastern Time) to seconds since midnight
|
||||
sunrise_seconds=$(time_to_seconds "$sunrise_time_et")
|
||||
|
||||
# Calculate the start and end times (60 minutes before sunrise and 15 minutes after sunrise)
|
||||
start_seconds=$((sunrise_seconds - 70 * 60)) # 60 minutes before sunrise
|
||||
end_seconds=$((sunrise_seconds + 10 * 60)) # 20 minutes after sunrise
|
||||
# Calculate the capture window around sunrise.
|
||||
start_seconds=$((sunrise_seconds - SUNRISE_PRE_MIN * 60))
|
||||
end_seconds=$((sunrise_seconds + SUNRISE_POST_MIN * 60))
|
||||
|
||||
# Output the start and end times in seconds for debugging
|
||||
echo "Start seconds: $start_seconds"
|
||||
@@ -110,8 +110,7 @@ echo "Initial video duration: $video_duration"
|
||||
IFS=':' read -r hours minutes seconds <<< $(echo $video_duration | cut -d '.' -f1) # Extract time
|
||||
total_seconds=$(($hours * 3600 + $minutes * 60 + $seconds)) # Convert to total seconds
|
||||
|
||||
# Target video duration: 10 seconds
|
||||
target_duration=8
|
||||
target_duration=$SUNRISE_TARGET_SECS
|
||||
|
||||
# Calculate the speed-up factor to make the video fit into the target duration of 10 seconds
|
||||
speed_up_factor=$(echo "scale=3; $total_seconds / $target_duration" | bc)
|
||||
|
||||
Reference in New Issue
Block a user