diff options
author | Mattias Andrée <maandree@kth.se> | 2016-06-13 01:22:07 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-06-13 01:22:07 +0200 |
commit | 2f9adec0d06221ebcc504406a23779d584554fa8 (patch) | |
tree | feef4733353254847a4e1f42f4fd2e00a8a77292 /src/solar_python.py | |
parent | m doc (diff) | |
download | solar-python-2f9adec0d06221ebcc504406a23779d584554fa8.tar.gz solar-python-2f9adec0d06221ebcc504406a23779d584554fa8.tar.bz2 solar-python-2f9adec0d06221ebcc504406a23779d584554fa8.tar.xz |
Improve solar_prediction2.3
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | src/solar_python.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/solar_python.py b/src/solar_python.py index 0c380be..e316c96 100644 --- a/src/solar_python.py +++ b/src/solar_python.py @@ -528,7 +528,7 @@ def solar_prediction(delta, requested, fun, epsilon = 0.000001, span = 0.01, t = @param requested:float The value returned by `fun` for which to calculate the time point of occurrence @param fun:(t:float)→float Function that calculate the data of interest - @param epsilon:float Error tolerance for `requested` + @param epsilon:float The tolerance for the result @param span:float The number of Julian Centuries (0,01 for one year) to restrict the search to @param t:float? The time in Julian Centuries, `None` for @@ -561,7 +561,7 @@ def solar_prediction(delta, requested, fun, epsilon = 0.000001, span = 0.01, t = v2 = fun_(t2) vm = fun_(tm) if abs(v1 - v2) < epsilon: - return tm if abs(vm) < epsilon else None + return tm if v1 < v2: if 0 < vm: t2 = tm @@ -572,7 +572,7 @@ def solar_prediction(delta, requested, fun, epsilon = 0.000001, span = 0.01, t = t2 = tm else: t1 = tm - return None + return tm |