Closed eguaio closed 4 years ago
I confirm I can reproduce with the latest released version:
>>> from datetime import datetime
>>> from orbit_predictor.predictors.numerical import J2Predictor
>>> start = datetime(2020, 9, 1)
>>> end = datetime(2020, 10, 1)
>>> alt_km = 470.0
>>> pred = J2Predictor.sun_synchronous(
... alt_km=470.0,
... ecc=0.001,
... ltan_h=19,
... ta_deg=0,
... date=start,
... )
>>> list(pred.eclipses_since(when_utc=start, limit_date=end))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/juanlu/.pyenv/versions/mbp38/lib/python3.8/site-packages/orbit_predictor/predictors/base.py", line 341, in eclipses_since
eclipse_start_delta_s = brentq(
File "/home/juanlu/.pyenv/versions/mbp38/lib/python3.8/site-packages/scipy/optimize/zeros.py", line 780, in brentq
r = _zeros._brentq(f, a, b, xtol, rtol, maxiter, args, full_output, disp)
ValueError: f(a) and f(b) must have different signs
However, with master
I get a different (trivial) error:
>>> from datetime import datetime
>>> from orbit_predictor.predictors.numerical import J2Predictor
>>> start = datetime(2020, 9, 1)
>>> end = datetime(2020, 10, 1)
>>> alt_km = 470.0
>>> pred = J2Predictor.sun_synchronous(
... alt_km=470.0,
... ecc=0.001,
... ltan_h=19,
... ta_deg=0,
... date=start,
... )
>>> list(pred.eclipses_since(when_utc=start, limit_date=end))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/juanlu/Development/delivery-platform/mission/orbit-predictor/orbit_predictor/predictors/base.py", line 322, in eclipses_since
minimum_illumination = minimize_scalar(
NameError: name 'minimize_scalar' is not defined
It's the same version, but one environment lacked SciPy. It looks like ImportWarning
is silenced by default in the interpreter: https://docs.python.org/3.7/library/warnings.html?highlight=importwarning#warning-categories
I confirm that there is an eclipse, and the problem is in our bracketing:
The following code raises an exception.