From ccf530eeb04592379f86fea25d42921e4bcbe1ee Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 24 Feb 2014 19:11:29 +0100 Subject: and twilight solar elevation constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/solar.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src') diff --git a/src/solar.py b/src/solar.py index 6790c3e..8c79d79 100644 --- a/src/solar.py +++ b/src/solar.py @@ -18,6 +18,49 @@ import math import time + +SOLAR_ELEVATION_SUNSET_SUNRISE = 0.0 +''' +:float The Sun's elevation at sunset and sunrise, measured in degrees +''' + +SOLAR_ELEVATION_CIVIL_DUSK_DAWN = -6.0 +''' +:float The Sun's elevation at civil dusk and civil dawn, measured in degrees +''' + +SOLAR_ELEVATION_NAUTICAL_DUSK_DAWN = -12.0 +''' +:float The Sun's elevation at nautical dusk and nautical dawn, measured in degrees +''' + +SOLAR_ELEVATION_ASTRONOMICAL_DUSK_DAWN = -18.0 +''' +:float The Sun's elevation at astronomical dusk and astronomical dawn, measured in degrees +''' + +SOLAR_ELEVATION_RANGE_TWILIGHT = (-18.0, 0.0) +''' +:(float, float) The Sun's lowest and highest elevation during all periods of twilight, measured in degrees +''' + +SOLAR_ELEVATION_RANGE_CIVIL_TWILIGHT = (-6.0, 0.0) +''' +:(float, float) The Sun's lowest and highest elevation during civil twilight, measured in degrees +''' + +SOLAR_ELEVATION_RANGE_NAUTICAL_TWILIGHT = (-12.0, -6.0) +''' +:(float, float) The Sun's lowest and highest elevation during nautical twilight, measured in degrees +''' + +SOLAR_ELEVATION_RANGE_ASTRONOMICAL_TWILIGHT = (-18.0, -12.0) +''' +:(float, float) The Sun's lowest and highest elevation during astronomical twilight, measured in degrees +''' + + + def sun(latitude, longitude, t = None, low = -6.0, high = 3.0): ''' Get the visibility of the Sun -- cgit v1.2.3-70-g09d2