skyfielders / python-skyfield

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

Ephemeris before 1969 #622

Closed qn222ad closed 3 years ago

qn222ad commented 3 years ago

I got this error as I tried the planetary position before 1969: skyfield.errors.EphemerisRangeError: ephemeris segment only covers dates 1969-07-29 23:59:18Z through 17191-03-14 23:58:51Z UT Can I ask is there anyway to work around to obtain the data? Thanks

brandon-rhodes commented 3 years ago

What ephemeris are you using, and which object are you trying to access? Without knowing the circumstances and the full traceback, Skyfield contributors will lack the information they need to help diagnose your situation.

brandon-rhodes commented 3 years ago

I'm going to close this as there's not enough information for folks to help out, but if you want to add information later, feel free to re-open.

DSblizzard commented 2 years ago

eph = load('de441.bsp') sun_eph, moon_eph, v_eph, e_eph, j_eph, s_eph, u_eph, neph = eph['sun'], eph['moon'], eph['venus'], eph['earth'], eph['jupiter barycenter'], eph['saturn barycenter'], eph['uranus barycenter'], eph['neptune barycenter'] , vlon, = sun_eph.at(t).observe(v_eph).frame_latlon(ecliptic_frame) # !!! ERROR

skyfield.errors.EphemerisRangeError: ephemeris segment only covers dates 1969-07-29 23:59:18Z through 17191-03-14 23:58:51Z UT

brandon-rhodes commented 2 years ago

@DSblizzard — You have downloaded an incomplete copy of DE441, which is often distributed in 2 files instead of 1:

https://github.com/skyfielders/python-skyfield/issues/682

Could you share the URL from which you downloaded it? You are the second person to have a file named simply de441.bsp but that only has half of the ephemeris, and it would be nice to know who is distributing it without "part-1" or "part-2" in the filename. Thanks!

DSblizzard commented 2 years ago

I just used line eph = load('de441.bsp') in Python 2.7. Download was automatic from unknown URL.

pnoumenon commented 1 year ago

I just encountered the exact same issue. I would naturally also expect simply load('de441.bsp') to download the entire ephemeris, but apparently it's only the first half, or at least it says that's all that's covered (from 1969 to 17191); strangely, the size of it is ~3.3 GB, which is roughly the same as listed here.

I'm using the latest version of both Python and Skyfield, for what it's worth. The complete error is this (although I doubt that really yields any additional information at this point, it's the same as the above):

skyfield.errors.EphemerisRangeError: ephemeris segment only covers dates 1969-07-29 23:59:18Z through 17191-03-14 23:58:51Z UT

brandon-rhodes commented 1 year ago

@pnoumenon — Looking back at this issue, I'm going to update my guess: I think you're actually getting the whole ephemeris, hence the large file size, but the ephemeris inside has two different segments for each planet rather than one. Here's an open issue about it:

691

See this comment about a possible workaround:

https://github.com/skyfielders/python-skyfield/issues/691#issuecomment-1250013049

Here's how you can list the segments in the file you downloaded to double-check whether it's the same issue:

https://github.com/skyfielders/python-skyfield/issues/691#issuecomment-1017726898