brandon-rhodes / python-jplephem

Python version of NASA DE4xx ephemerides, the basis for the Astronomical Alamanac
MIT License
108 stars 28 forks source link

jpltest fails for de421 #5

Closed astrojuanlu closed 11 years ago

astrojuanlu commented 11 years ago

It works nice with de405, but it fails with de421:

$ python -m jplephem.jpltest
de405 AU = 149597870.691 km
  7214 tests successful
de421 AU = 149597870.7 km
Traceback (most recent call last):
  File "/usr/lib/python3.3/runpy.py", line 160, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python3.3/runpy.py", line 73, in _run_code
    exec(code, run_globals)
  File "/home/juanlu/.local/lib/python3.3/site-packages/jplephem-1.0-py3.3.egg/jplephem/jpltest.py", line 111, in <module>
    test_all()
  File "/home/juanlu/.local/lib/python3.3/site-packages/jplephem-1.0-py3.3.egg/jplephem/jpltest.py", line 106, in test_all
    testpo(ephemeris, testpo_file)
  File "/home/juanlu/.local/lib/python3.3/site-packages/jplephem-1.0-py3.3.egg/jplephem/jpltest.py", line 30, in testpo
    cpos = _position(ephemeris, jed, center)
  File "/home/juanlu/.local/lib/python3.3/site-packages/jplephem-1.0-py3.3.egg/jplephem/jpltest.py", line 77, in _position
    return c('earthmoon', jed) + c('moon', jed) * ephemeris.moon_share
  File "/home/juanlu/.local/lib/python3.3/site-packages/jplephem-1.0-py3.3.egg/jplephem/ephem.py", line 96, in compute
    bundle = self.compute_bundle(name, tdb, 0.0)
  File "/home/juanlu/.local/lib/python3.3/site-packages/jplephem-1.0-py3.3.egg/jplephem/ephem.py", line 142, in compute_bundle
    % (self.name, jalpha, jomega))
jplephem.ephem.DateError: ephemeris DE421 only covers dates 2414992.5 through 2469808.5

Haven't tried others yet (de421 is not included in the original list). Right now I can't but I might try the other ephemerides as well.

brandon-rhodes commented 11 years ago

Well, how embarrassing! It looks like my original upload of DE421 got truncated, so that the package does not cover the full range of dates that it ought. I have just uploaded a correctly-built package. Could you un-install and re-install "de421" — it should now be 27 MB instead of just 14 MB — and see if the tests now pass?

brandon-rhodes commented 11 years ago

And: thanks VERY much for poking around and discovering this before too many other people were affected by it! Who knows when, if ever, I would have discovered the omission on my own?

astrojuanlu commented 11 years ago

Thanks to you for your work! This is why we like open source, don't we? : )

$ python -m jplephem.jpltest
de405 AU = 149597870.691 km
  7214 tests successful
de421 AU = 149597870.7 km
  3602 tests successful

problem solved, closing!