jonls/redshift — pull request #98 by maandree (2014-05-31 10:41:05+00:00)
Title: Display sunrise/sunset information in redshift-gtk

Because of some common code I based this patch on #97.

This patch adds the follow information to the info dialogue for redshift-gtk:
* Time of the previous sunrise/sunset
* Time of the next sunrise/sunset
* The time twilight (the transition period) started/ended
* The time twilight starts/ends

The time points are calculated an interative method and it will
say that the will never occur / has never occurred if no satisfying
point in time can be found within the span of one year.

This should close https://bugs.launchpad.net/redshift/+bug/998883.

As https://bugs.launchpad.net/redshift/+bug/998883 mentions there
is an sunrise equation. However the equation on Wikipedia seems
to be flawed (as also noted on that page) in several ways:
* The result is in accurate
* A bit ambiguous
* Does not really state if there is going to be problems with the algorithm
inside the polar circles, although it does state how one can check if
there could be problems
* When I did a calcuation I got the sunset of by a few minutes, but the
sunrise, which should have been supersimple to calculate at the point,
was way of, it as are really large negative number.
* Does state whether it will find the sunrise/sunset that same day, the
nearest sunrise/sunset or the next/previous sunrise/sunset.