summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-02-24 19:11:29 +0100
committerMattias Andrée <maandree@operamail.com>2014-02-24 19:11:33 +0100
commitccf530eeb04592379f86fea25d42921e4bcbe1ee (patch)
tree40d06385f9a8d042383259532cde219c9b6c5386 /src
parentstylo (diff)
downloadblueshift-ccf530eeb04592379f86fea25d42921e4bcbe1ee.tar.gz
blueshift-ccf530eeb04592379f86fea25d42921e4bcbe1ee.tar.bz2
blueshift-ccf530eeb04592379f86fea25d42921e4bcbe1ee.tar.xz
and twilight solar elevation constants
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r--src/solar.py43
1 files changed, 43 insertions, 0 deletions
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