From: Johan <lis...@ce...> - 2009-06-26 14:13:22
|
Hello there, I recently started using MH (again) and I noticed the moonphase is wrongly calculated. Upon startup on June 26th 2009, MH displays: Latitude: 123.45, Longitude: 54.321, Time Zone: 0 sunrise=6:26 sunset=22:58 sunrise twilight=5:40 sunset twilight=23:44 The moon is One-Quarter Waxing, 20% bright, and 4 days old The next full moon is on Thursday, August 6th As a moonmonth lasts a little less than a normal month, it is very strange the next full moon is being calculated to be on August 6th. According to several different sources, it should be July 7th. So, I investigated... This bug is present in the current stable release, and in the latest SVN version. In bin/mh there is a function "set_moon_data", and is says: my @phases = Astro::MoonPhase::phasehunt($Time + 3600*24*30); So the parameter is $Time plus 1 month. I changed it to: my @phases = Astro::MoonPhase::phasehunt($Time); And it "seems" to be OK for now: Latitude: 123.45, Longitude: 54.321, Time Zone: 0 sunrise=6:26 sunset=22:58 sunrise twilight=5:40 sunset twilight=23:44 The moon is One-Quarter Waxing, 20% bright, and 4 days old The next full moon is on Tuesday, July 7th As I don't understand the code and I don't know why the parameter is 1 month in the future, I don't know if this is a good fix. It might break other stuff... Cheers, Johan. |