[RndTbl] Cron entries for sunrise and sunset
Troy Denton
trdenton at gmail.com
Sun Jul 5 10:45:58 CDT 2020
>
> That's a really cool idea. Looks like you're doing it all with math
> and no external (web) lookups? How long does just the math way stay
> accurate? Don't you need to account for wobble and things that may
> subtly change over time (assuming they do, I thought something did)?
Yep, it's all math-based - the calculations used "[...] are theoretically
accurate to within a minute for locations between +/- 72° latitude, and
within 10 minutes outside of those latitudes.". That's via
https://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html, which is used
by "sunrise.c" (original available here
<http://souptonuts.sourceforge.net/code/sunrise.c.html>). The explanation
claims that the calculation is valid until the year 3000! I'm not clear if
it handles wobble and other things - the calculations are mostly a black
box for me.
Anecdotally it seems to be working fine on my box :)
You should crisp it up as much as possible and submit it to the cron
> upstream! Has to be self-contained, clean and accurate though
> (probably).
I might do this at some point, it could use more cleanup - I have just
noticed that debian's cron package is a major version behind the upstream
as well
Thanks for the feedback!
On Sun, Jul 5, 2020 at 3:59 AM Trevor Cordes <trevor at tecnopolis.ca> wrote:
> On 2020-07-04 Troy Denton wrote:
> > A fun side project of mine - I've patched the Debian 'cron' source to
> > provide @sunrise and @sunset, similar to @reboot
>
> That's a really cool idea. Looks like you're doing it all with math
> and no external (web) lookups? How long does just the math way stay
> accurate? Don't you need to account for wobble and things that may
> subtly change over time (assuming they do, I thought something did)?
>
> You should crisp it up as much as possible and submit it to the cron
> upstream! Has to be self-contained, clean and accurate though
> (probably).
>
> Good clean code layout. Nice. Extra hero cookie for C.
> _______________________________________________
> Roundtable mailing list
> Roundtable at muug.ca
> https://muug.ca/mailman/listinfo/roundtable
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://muug.ca/pipermail/roundtable/attachments/20200705/fc9946be/attachment.htm>
More information about the Roundtable
mailing list