From 22ef168e1cf51f060ca5a2ccd97e0197c8357c35 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 6 Jul 2016 14:21:25 +0200 Subject: The sun is not visible at sunset/sunrise + add SOLAR_ELEVATION_PRESUNSET_POSTSUNRISE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/info/solar-python.texinfo | 18 +++++++++++------- src/solar_python.py | 18 ++++++++++++------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/doc/info/solar-python.texinfo b/doc/info/solar-python.texinfo index be6765e..96a3ac7 100644 --- a/doc/info/solar-python.texinfo +++ b/doc/info/solar-python.texinfo @@ -88,9 +88,13 @@ constants available: @item SOLAR_APPARENT_RADIUS = 32 / 60 Approximate apparent size of the Sun in degrees. -@item SOLAR_ELEVATION_SUNSET_SUNRISE = 0.0 -The Sun's elevation at sunset and sunrise, measured -in degrees. +@item SOLAR_ELEVATION_PRESUNSET_POSTSUNRISE = 32 / 60 +The Sun's elevation at beginning of sunset +and end of sunrise, measured in degrees. + +@item SOLAR_ELEVATION_SUNSET_SUNRISE = -32 / 60 +The Sun's elevation at (end of) sunset and +(beginning of) sunrise, measured in degrees. @item SOLAR_ELEVATION_CIVIL_DUSK_DAWN = -6.0 The Sun's elevation at civil dusk and civil dawn, @@ -112,19 +116,19 @@ amateur astronomical dawn, measured in degrees The Sun's lowest and highest elevation during all periods of twilight, measured in degrees -@item SOLAR_ELEVATION_RANGE_CIVIL_TWILIGHT = (-6.0, 0.0) +@item SOLAR_ELEVATION_RANGE_CIVIL_TWILIGHT = (-6.0, -32 / 60) The Sun's lowest and highest elevation during civil twilight, measured in degrees -@item SOLAR_ELEVATION_RANGE_NAUTICAL_TWILIGHT = (-12.0, -0.0) +@item SOLAR_ELEVATION_RANGE_NAUTICAL_TWILIGHT = (-12.0, -32 / 60) The Sun's lowest and highest elevation during nautical twilight, measured in degrees -@item SOLAR_ELEVATION_RANGE_ASTRONOMICAL_TWILIGHT = (-18.0, -0.0) +@item SOLAR_ELEVATION_RANGE_ASTRONOMICAL_TWILIGHT = (-18.0, -32 / 60) The Sun's lowest and highest elevation during astronomical twilight, measured in degrees -@item SOLAR_ELEVATION_RANGE_AMATEUR_ASTRONOMICAL_TWILIGHT = (-15.0, -18.0) +@item SOLAR_ELEVATION_RANGE_AMATEUR_ASTRONOMICAL_TWILIGHT = (-15.0, -32 / 60) The Sun's lowest and highest elevation during amateur astronomical twilight, measured in degrees @end table diff --git a/src/solar_python.py b/src/solar_python.py index daa2330..a01f947 100644 --- a/src/solar_python.py +++ b/src/solar_python.py @@ -22,10 +22,16 @@ SOLAR_APPARENT_RADIUS = 32 / 60 ''' -SOLAR_ELEVATION_SUNSET_SUNRISE = 0.0 +SOLAR_ELEVATION_PRESUNSET_POSTSUNRISE = 32 / 60 ''' -:float The Sun's elevation at sunset and sunrise, - measured in degrees +:float The Sun's elevation the beginning of sunset and + end of sunrise, measured in degrees +''' + +SOLAR_ELEVATION_SUNSET_SUNRISE = -32 / 60 +''' +:float The Sun's elevation the (end of) at sunset and + (beginning of) sunrise, measured in degrees ''' SOLAR_ELEVATION_CIVIL_DUSK_DAWN = -6.0 @@ -58,19 +64,19 @@ SOLAR_ELEVATION_RANGE_TWILIGHT = (-18.0, 0.0) all periods of twilight, measured in degrees ''' -SOLAR_ELEVATION_RANGE_CIVIL_TWILIGHT = (-6.0, 0.0) +SOLAR_ELEVATION_RANGE_CIVIL_TWILIGHT = (-6.0, SOLAR_ELEVATION_SUNSET_SUNRISE) ''' :(float, float) The Sun's lowest and highest elevation during civil twilight, measured in degrees ''' -SOLAR_ELEVATION_RANGE_NAUTICAL_TWILIGHT = (-12.0, 0.0) +SOLAR_ELEVATION_RANGE_NAUTICAL_TWILIGHT = (-12.0, SOLAR_ELEVATION_SUNSET_SUNRISE) ''' :(float, float) The Sun's lowest and highest elevation during nautical twilight, measured in degrees ''' -SOLAR_ELEVATION_RANGE_ASTRONOMICAL_TWILIGHT = (-18.0, 0.0) +SOLAR_ELEVATION_RANGE_ASTRONOMICAL_TWILIGHT = (-18.0, SOLAR_ELEVATION_SUNSET_SUNRISE) ''' :(float, float) The Sun's lowest and highest elevation during astronomical twilight, measured in degrees -- cgit v1.2.3-70-g09d2