skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.43k stars 213 forks source link

Vector.at getting stuck indefintely #270

Closed seanwatson closed 5 years ago

seanwatson commented 5 years ago

Every so often a call to vector_object.at() will get stuck and leave one CPU core pinned at 100%.

It doesn't happen every time, so I've added logging to record what the argument is before making the call. I'll update with a problematic argument value next time it happens.

Stack trace:

File "/...lib/python3.6/site-packages/skyfield/vectorlib.py", line 74, in at                                                                                                                                                                                                                           
    p, v, observer_data.gcrs_position, message = self._at(t)                                                                                                                                                                                                                                                                    
  File "/.../lib/python3.6/site-packages/skyfield/vectorlib.py", line 184, in _at                                                                                                                                                                                                                         
    p2, v2, gcrs_position, message = segment._at(t)                                                                                                                                                                                                                                                                             
  File "/.../lib/python3.6/site-packages/skyfield/sgp4lib.py", line 154, in _at                                                                                                                                                                                                                           
    rGCRS, vGCRS = ITRF_to_GCRS2(t, rITRF, vITRF)                                                                                                                                                                                                                                                                               
  File "/.../lib/python3.6/site-packages/skyfield/positionlib.py", line 523, in ITRF_to_GCRS2                                                                                                                                                                                                             
    spin = rot_z(t.gast * tau / 24.0)                                                                                                                                                                                                                                                                                           
  File "/.../lib/python3.6/site-packages/skyfield/descriptorlib.py", line 12, in __get__                                                                                                                                                                                                                  
    value = self.method(instance)                                                                                                                                                                                                                                                                                               
  File "/.../lib/python3.6/site-packages/skyfield/timelib.py", line 680, in gast                                                                                                                                                                                                                          
    return self.gmst + self._earth_tilt[2] / 3600.0                                                                                                                                                                                                                                                                             
  File "/.../lib/python3.6/site-packages/skyfield/descriptorlib.py", line 12, in __get__                                                                                                                                                                                                                  
    value = self.method(instance)                                                                                                                                                                                                                                                                                               
  File "/.../lib/python3.6/site-packages/skyfield/timelib.py", line 684, in _earth_tilt                                                                                                                                                                                                                   
    return earth_tilt(self)
  File "/.../lib/python3.6/site-packages/skyfield/nutationlib.py", line 60, in earth_tilt
    dp, de = t._nutation_angles
  File "/.../lib/python3.6/site-packages/skyfield/descriptorlib.py", line 12, in __get__
    value = self.method(instance)
  File "/.../lib/python3.6/site-packages/skyfield/timelib.py", line 688, in _nutation_angles
    return iau2000a(self.tt)
  File "/.../lib/python3.6/site-packages/skyfield/nutationlib.py", line 264, in iau2000a
    arg = napl_t.dot(a)

Versions:

Name: skyfield
Version: 1.10

Name: jplephem
Version: 2.9

Name: sgp4
Version: 1.4

Name: numpy
Version: 1.16.4
brandon-rhodes commented 5 years ago

Thanks for the report! That's a very bad behavior in Skyfield that I'd not encountered myself and that I'd like to correct. Let us know when you've discovered what arguments cause it to happen.

seanwatson commented 5 years ago

It got stuck again, but at a different dot product. Trying to reproduce it with the same inputs doesn't cause the hang up. I'm pretty convinced its a numpy problem at this point so I'll close it out here.

brandon-rhodes commented 5 years ago

Feel free to open again if you have any indication that Skyfield could fix the problem! That must be frustrating — I hope you're able to find a solution.