aboutsummaryrefslogtreecommitdiffstats
path: root/src/solar_python.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/solar_python.py')
-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)