简体   繁体   中英

Differences between Pyephem and Skyfield for calculating ancient phenomena

I'm trying to calculate ancient phenomena for Babylon before the year 0. And I'm able to get something that aligns with known records from Pyephem, but I'd like to use Skyfield since that seems to be the more modern library. However, when I try and translating working code from Pyephem to Skyfield I get radically different results. I'm not sure if there's an issue with the dates themselves, or if the calculations are wrong.

A quick Jupyter Notebook of the to procedures can be found here: https://gist.github.com/willismonroe/ae49480cd4cb1c21c5a214a70eb6f3d6

A rough back-of-the-envelope calculation would suggest that the Moon, circling the sky in 29 days, moves about 360° ÷ 29 ≈ 12½ degrees per day.

Your Skyfield script therefore has a problem: it only prints the date if the Moon's longitude relative to the sun is between 6° and 14°, a range only 14 − 6 = 8° wide. In some months, its 12½° jump happens to land in that narrow 8° range, and some months it jumps entirely over it instead. That is why the Skyfield script only prints some months but not others.

The PyEphem script, by contrast, takes the angle in radians and multiplies by 30, turning the range 0…6.28 into the range 0…188.4. Very roughly, the unit of measure you are using is a “double degree” with 188 of them to the full circle. The Moon only jumps about 6¼ “double degrees” per day, so it is guaranteed to land in your 6-to-14 range at least once each month, because a jump of 6¼ is not enough to jump fully over the range.

My guess is that you should try an approach of choosing an exact degree angle that's of interest to you, like 6°, and then write a little routine to find exactly the date and time it crosses that threshold each month. Here's an example that should hopefully get you started:

https://rhodesmill.org/skyfield/searches.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM