简体   繁体   English

Pyephem 和 Skyfield 计算古代现象的区别

[英]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.我正在尝试计算 0 年之前巴比伦的古代现象。我能够从 Pyephem 获得与已知记录一致的东西,但我想使用 Skyfield,因为它似乎是更现代的图书馆。 However, when I try and translating working code from Pyephem to Skyfield I get radically different results.然而,当我尝试将工作代码从 Pyephem 翻译到 Skyfield 时,我得到了完全不同的结果。 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可以在此处找到 to 程序的快速 Jupyter Notebook: 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.粗略的粗略计算表明,月球在 29 天内环绕天空,每天移动大约 360°÷29≈12½ 度。

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.因此,您的 Skyfield 脚本有一个问题:它仅在月球相对于太阳的经度在 6° 到 14° 之间时才打印日期,范围只有 14 − 6 = 8° 宽。 In some months, its 12½° jump happens to land in that narrow 8° range, and some months it jumps entirely over it instead.在某些月份,它的 12½° 跳跃恰好落在 8° 的狭窄范围内,而在某些月份,它会完全跳过它。 That is why the Skyfield script only prints some months but not others.这就是为什么 Skyfield 脚本只打印几个月而不是其他月份的原因。

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.相比之下,PyEphem 脚本采用弧度为单位的角度并乘以 30,将范围 0…6.28 变为范围 0…188.4。 Very roughly, the unit of measure you are using is a “double degree” with 188 of them to the full circle.粗略地说,您使用的度量单位是“双度数”,其中 188 个为整圈。 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.月亮每天只跳大约 6¼“双度”,所以它保证每个月至少一次落在你的 6 到 14 范围内,因为 6¼ 的跳跃不足以完全跳过这个范围。

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.我的猜测是,您应该尝试一种方法,选择您感兴趣的精确度数角,例如 6°,然后编写一个小程序,以准确找到每个月超过该阈值的日期和时间。 Here's an example that should hopefully get you started:这是一个希望可以帮助您入门的示例:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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