diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-06-05 03:44:10 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-06-05 03:44:10 +0200 |
commit | d17542d63cc51e407fe39c3f1c346085b63e32d7 (patch) | |
tree | 8b16e7bbfebd368eb66106ca301b51c3e9652065 /src/solar.py | |
parent | add solar_prediction and use it for future_past_equinox and future_past_elevation (diff) | |
download | blueshift-d17542d63cc51e407fe39c3f1c346085b63e32d7.tar.gz blueshift-d17542d63cc51e407fe39c3f1c346085b63e32d7.tar.bz2 blueshift-d17542d63cc51e407fe39c3f1c346085b63e32d7.tar.xz |
add solstice prediction
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/solar.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/solar.py b/src/solar.py index aceacfc..028330c 100644 --- a/src/solar.py +++ b/src/solar.py @@ -513,6 +513,23 @@ def past_equinox(t = None): return future_past_equinox(0.01 / -2000, t) +# TODO document +def future_past_solstice(delta, t = None): + e = 0.0001 + fun = lambda t : (solar_declination(t - e) - solar_declination(t + e)) / 2 + return solar_prediction(delta, 0, fun, t = t) + + +# TODO document +def future_solstice(t = None): + return future_past_solstice(0.01 / 2000, t) + + +# TODO document +def past_solstice(t = None): + return future_past_solstice(0.01 / -2000, t) + + def future_past_elevation(delta, latitude, longitude, elevation, t = None): ''' Predict the time point of the next or previous time the Sun reaches or reached a specific elevation @@ -574,3 +591,8 @@ def sunrise_equation(latitude, longitude, t = None): sunrise = 2 * solar_transit - sunset return (julian_day_to_julian_centuries(sunset), julian_day_to_julian_centuries(sunrise)) + +def ptime(t): + import datetime + print(str(datetime.datetime.fromtimestamp(int(julian_centuries_to_epoch(t))))) + |