rederikus / AllSky-Camera-Raspberry-Pi

A Raspberry Pi based Astronomy AllSky Camera
12 stars 1 forks source link

indentation suntimes.php #1

Open rwrw01 opened 4 years ago

rwrw01 commented 4 years ago

Hi,

i had to change the substrings in suntimes.php to:

$ADawn=substr($mtimes,1,5); $NDawn=substr($mtimes,21,6); $CDawn=substr($mtimes,27,6); $SRise=substr($mtimes,33,6); $SSet=substr($mtimes,39,6); $CSet=substr($mtimes,45,6); $NSet=substr($mtimes,51,6); $ASet=substr($mtimes,56,6); $VDay=substr($mtimes,81,6); $VNight=substr($mtimes,87,6);

$VidAM=substr($mtimes,94,6); $VidPM=substr($mtimes,100,6); $CamAM=substr($mtimes,94,6); $CamPM=substr($mtimes,100,6);

much thamks for the allsky package. Ralph

oldjiberjaber commented 4 years ago

What is the issue this aims to fix Ralph ?

oldjiberjaber commented 4 years ago

OK - just tried it, it picks up the timestamps correctly when there is no astrodark ? What happens when we get back in to astrodark will it work then? Before: image

After: image

oldjiberjaber commented 4 years ago

Also requires a change to line 64 in the webcam.php file to correct the sunset timestamp in the banner text

$SSet=substr($mtimes,39,5); // was 24,5 for sunset, this fixes astrodark issue.

oldjiberjaber commented 4 years ago

OK - I've tested the above and changing the substring locations only works in a location where there is no astro dark (i.e. the UK right now). As soon as the location still has astro dark (i.e. Pete's location) the text is messed up.

I suspected there needed to be an intervention earlier on in the process (i.e. where sunwait generates the data) and this has prompted me to modify the webcam script with some if statements, they detect the --:-- which is associated with the text Midnight Sun, this adds to the data and results in the offsets of text. Testing for this and removing it ensures the sunwait text remains consistent. This works for the cases where there is astrodark and no astrodark.

At lines 164 onwards:

Astronomical dawn and set. 18 degrees below horizon

AstroRise=$(sunwait list 1 astronomical rise offset $twiRise $lon $lat) if [[ $AstroRise == "--:--" ]]; then AstroRise='--:--' fi

AstroRiseReal=$(sunwait list 1 astronomical rise $lon $lat) if [[ $AstroRiseReal == "--:--" ]]; then AstroRiseReal='--:--' fi

AstroSetReal=$(sunwait list 1 astronomical set $lon $lat) if [[ $AstroSetReal == "--:--" ]]; then AstroSetReal='--:--' fi

AstroSet=$(sunwait list 1 astronomical set offset $twiSet $lon $lat) if [[ $AstroSet == "--:--" ]]; then AstroSet='--:--' fi