Next_new_Moon gives wrong date

Bug #554113 reported by Richard Hollands
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyEphem
Invalid
Medium
Unassigned

Bug Description

ephem.next_full_moon('2010')
gives:
2010/1/30 06:17:33
but
ephem.next_full_moon('2010-03-21')
gives
2009/9/4 16:02:34

ephem.previous_full_moon('2010')
gives
2009/12/31 19:12:43
but
ephem.previous_full_moon('2010-03-21')
gives
2009/8/6 00:54:50

But set:
d1 = ephem.next_equinox('2010') which makes d1 = 2010/3/20 17:32:09
and
ephem.next_full_moon(d1)
gives
2010/3/20 17:32:09

Revision history for this message
Brandon Rhodes (brandon-rhodes) wrote :

That's because the "ephem" library thinks that "2010-03" means the "negative 3" month of 2010 — the third-from-the-last-month of 2009, in other words. You can see this by constructing plain Date objects:

>>> ephem.Date('2010/03')
2010/3/1 00:00:00
>>> ephem.Date('2010-03')
2009/9/1 00:00:00

Are you asking for "-" to become a new date separator character? So far PyEphem has just supported "/", like the astronomy library it is built upon, and so we would have to think through the implications of changing it. I wonder if anybody has ever used the negative-number functionality? I wasn't even sure, until I saw this report, that I myself knew that "2010-03" was even a valid PyEphem date! :-)

Changed in pyephem:
status: New → Invalid
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.