1

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

labarna
  • 668
  • 1
  • 9
  • 16
  • If you could add a clarification, maybe by adding comments to your Python code: you perform the operation `phase = angle * 30` on what looks like an `angle` that’s in radians. What do you get when you multiply radians by 30? One problem might be that you intend a conversion to degrees there? – Brandon Rhodes Sep 12 '20 at 01:29
  • That's correct I was trying to degrees there, perhaps a very simple mistake? What's confusing though is that the pyephem calculations match the ancient records very well. – labarna Sep 12 '20 at 02:48

1 Answers1

1

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

Brandon Rhodes
  • 83,755
  • 16
  • 106
  • 147
  • Thanks so much, this was very helpful! I was able to make a small function that returned whether the sun was up AND if the moon phase was under 1°. It worked perfectly for modern data, and graphing (per your link) worked really well. It didn't line up with the ancient sources I was using (Parker and Dubberstein, "Babylonian Chronology"), but I suspect there may be errors in dating. The reason I'm doing all of this, is because I'm a historian of ancient astronomy, and I'd like to have handy methods to check ancient records of observations, and your library seems ideal! Thanks for the help. – labarna Sep 13 '20 at 22:10
  • @labarna — Skyfield uses the Gregorian calendar, while historians use the Julian calendar for early centuries. I am adding the Julian calendar to Skyfield and will comment here when the feature is ready! – Brandon Rhodes Sep 13 '20 at 23:26
  • Awesome, that'd be very useful! If you've got an issue for the feature on Github, I'd love to follow along there. – labarna Sep 14 '20 at 03:58
  • @labarna — There is not currently an issue open, feel free to create one! – Brandon Rhodes Sep 14 '20 at 18:56
  • @BrandonRhodes can you share your new code in skyfield please? – panjianom Jul 10 '21 at 11:57