aboutsummaryrefslogtreecommitdiffstats
path: root/src/solar_python.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-06-05 05:46:09 +0200
committerMattias Andrée <maandree@operamail.com>2014-06-05 05:46:09 +0200
commit02453025886776d4c414cecfdaff0dc87b3a3808 (patch)
treee087473b799b5647196877c95156dff128dd1432 /src/solar_python.py
parentcannibalise blueshift (diff)
downloadsolar-python-02453025886776d4c414cecfdaff0dc87b3a3808.tar.gz
solar-python-02453025886776d4c414cecfdaff0dc87b3a3808.tar.bz2
solar-python-02453025886776d4c414cecfdaff0dc87b3a3808.tar.xz
m doc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/solar_python.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/solar_python.py b/src/solar_python.py
index bce8beb..f1c172c 100644
--- a/src/solar_python.py
+++ b/src/solar_python.py
@@ -525,6 +525,8 @@ def solar_prediction(delta, requested, fun, epsilon = 0.000001, span = 0.01, t =
t = julian_centuries() if t is None else t
t1 = t2 = t
v1 = v0 = fun(t)
+
+ # Predicate time point to within a small time span
while True:
if abs(t2 - t) > span:
return None
@@ -536,6 +538,8 @@ def solar_prediction(delta, requested, fun, epsilon = 0.000001, span = 0.01, t =
break
t1 = t2
v2 = v1
+
+ # Binary search the small time span for the exact time point
for _itr in range(1000):
tm = (t1 + t2) / 2
v1 = fun(t1)