pytroll / pyorbital

Orbital and astronomy computations in python
http://pyorbital.readthedocs.org/
GNU General Public License v3.0
224 stars 77 forks source link

Runtime error in get_next_passes #63

Closed jschultz closed 4 years ago

jschultz commented 4 years ago

I see a similar error has been reported and fixed previously in #36

The following code:

from pyorbital.orbital import Orbital
from dateutil import parser
orb = Orbital("Suomi-NPP", 
              line1="1 37849U 11061A   19292.84582509  .00000011  00000-0  25668-4 0  9997", 
              line2="2 37849  98.7092 229.3263 0000715  98.5313 290.6262 14.19554485413345")
next_passes = orb.get_next_passes(parser.parse("2019-10-21 16:00:00"), 12, 123.29736, -13.93763, 0)

produces the following output:

/home/jschultz/.local/lib/python3.8/site-packages/pyorbital/orbital.py:395: RuntimeWarning: invalid value encountered in double_scalars
  x = x - 0.5 * (((b - a) ** 2 * (f_b - f_c)
djhoese commented 4 years ago

I have confirmed this with pyorbital 1.5.0 and pyorbital 1.6.0 from conda-forge. I don't have any experience with these algorithms but wanted to add the extra data point that I also see this warning message.

mraspaud commented 4 years ago

@jschultz thanks for reporting this. PR #64 should solve this issue, can you confirm?

jschultz commented 4 years ago

Yes, PR #64 fixed this problem for me.