From 02453025886776d4c414cecfdaff0dc87b3a3808 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 5 Jun 2014 05:46:09 +0200 Subject: m doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/solar_python.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- cgit v1.2.3-70-g09d2