[Remind-Fans] Sunrise, Sunset (Swiftly Flow the Days) ...

A. Klostermaier remind-fan at klostermaier.de
Mon May 2 09:56:21 EDT 2005


Bezugnehmend auf Ihr E-Mail/Referring to your e-mail
vom/from 02.05.2005 um/at 5:38 Uhr:

>I'm running into a little bit of a problem with my sunset and sunrise 
>times, and I'm wondering if some knowledgeable experts here could point 
>out the flaw in my .reminders file.
>
>-------------[code begins here]-------------
>
>fset _srtd() coerce("STRING", _no_lz(_am_pm(sunrise(today()))))
>
>fset _sstd() coerce("STRING", _no_lz(_am_pm(sunset(today()))))
>
>fset _srtm() coerce("STRING", _no_lz(_am_pm(sunrise(today()+1))))
>
>fset _sstm() coerce("STRING", _no_lz(_am_pm(sunset(today()+1))))
>
>MSG Sunset today at [_sstd()].  Sun's up tomorrow from [_srtm()] to 
>[_sstm()].%"%"%
>
>MSG The next full moon is on [mon(moondate(2))] [day(moondate(2))], 
>[year(moondate(2))].%"%"%
>
>--------------[code ends here]--------------
>
>_no_lz is no leading zero, _am_pm formats it in the appropriate time and 
>date.
>
>The problem is that it didn't account for the change in Daylight Savings 
>Time, it appears.  I've also often noticed that the estimates are 
>slightly different than the Chicago Tribune's estimates, but I'm 
>guessing that's based on the fact that the above is most likely just 
>generated by an algorithm.


I am not really an expert in this, but as I had to struggle with deviating values for sunrise/sunset myself, maybe I can help a little.

For testing you should first examine sunset(today()) and sunrise(today()) alone, without any other further formating. Just drop it in the banner and look at the plain values.
I have set up my banner like this:

BANNER +--------------------------------------------------------------+ %_Datum    : %w, %d%s %m %y %_Ort      : [$Location],  N [$LatDeg]-[$LatMin]'[$LatSec]''  E [$LongDeg]-[$LongMin]'[$LongSec]'' %_Mondphase: [moonphase(today(),now())*100/360] %% (Neumond zu Neumond; Vollmond = 50%%) %_Vollmond : [moondate(2)] [moontime(2)] Uhr%_Neumond  : [moondate(0)] [moontime(0)] Uhr %_Sonne    : von [sunrise(today())] Uhr bis [sunset(today())] Uhr 

Then it is extremely important to set up the correct latitude and longitude of your home site. I used my GPS to get my coordinates and entered them in the beginning of my .reminders-file like this:

Set $Location "myPlace"
Set $LatDeg   47
Set $LatMin   56
Set $LatSec   32
Set $LongDeg  -11
Set $LongMin  -34
Set $LongSec  -37

Notice, that East-longitudes and South-latitudes are negative!

With this setup my sunrise/sunset-Values are EXACTLY the same values that my Garmin-GPS receiver calculates for the given coordinates! The maximum deviation is one minute, which is due to the lazy precision of my coordinates and maybe roundings. If you have the correct coordinates, the value will still differ from the newspapers value (as they are most probably not calculating the values in your living room ;-). The newspaper probably gets the values from a wheather station, most likely from an airport or from a commercial service that calculates to some place in Chicago. But the deviation should be within a few minutes.

I cannot remember by heart, but it is also possible that the coordinates are integers and you get strange values when putting float-values in there - I have to check the manual for that...

If you have these basics right, you can wrap your sunrise/sunset-calls into the other formatting stuff....

Andreas
(using remind under OSX)



More information about the Remind-fans mailing list