Skip Menu |

This queue is for tickets about the Astro CPAN distribution.

Report information
The Basics
Id: 119232
Status: open
Priority: 0/
Queue: Astro

People
Owner: Nobody in particular
Requestors: msb [...] vex.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Negative or other early Julian Dates don't convert correctly
Date: Tue, 13 Dec 2016 22:22:50 -0500 (EST)
To: bug-Astro [...] rt.cpan.org
From: msb [...] vex.net (Mark Brader)
I have "perl 5, version 22, subversion 2 (v5.22.2) built for x86_64-linux-thread-multi" running on Fedora 23 Linux. I downloaded Astro::Time from cpan within the last 24 hours. I don't know how to check which version of it that is. This program: use Astro::Time; foreach my $jd ( -10 .. 420 ) { my ($d, $m, $y, undef) = mjd2cal(jd2mjd($jd)); printf "%6d => year %4d month %02d day %02d\n", $jd, $y, $m, $d; } produces results that don't even appear like a valid progression of dates until Julian Day 97. For example, part of the output reads: 91 => year -4712 month 03 day -3 92 => year -4712 month 03 day -2 93 => year -4712 month 03 day -1 94 => year -4712 month 03 day 00 95 => year -4712 month 03 day 01 96 => year -4712 month 03 day 01 97 => year -4712 month 03 day 01 98 => year -4712 month 03 day 02 99 => year -4712 month 03 day 03 100 => year -4712 month 03 day 04 And even then the dates are wrong, since that day should be in April, not March, of year -4712. In fact it shows thirteen months in -4712 (00 to 12), followed on JD 403 by the first day of -4711. -- Mark Brader | "I'm a little worried about the bug-eater", she said. Toronto | "We're embedded in bugs, have you noticed?" msb@vex.net | -- Niven, "The Integral Trees"
Subject: Re: [rt.cpan.org #119232] Negative or other early Julian Dates don't convert correctly
Date: Wed, 14 Dec 2016 05:08:33 +0000
To: <bug-Astro [...] rt.cpan.org>
From: <Chris.Phillips [...] csiro.au>
Hi I'm not sure what you are doing - I'm not sure you do either! Just to be sure - are you aware 0 MJD is 17/11/1858 and 0 JD is January 1, 4713 BC? I have no idea what the algorithms for date conversion do for negative MJD. Evidently they don't work. Sorry, I have no intention on following this up. If you can supply *clean* code and a test script which verifies it does not break current usage I will look at updating the code base. Regards Chris Phillips Show quoted text
________________________________________ From: msb@vex.net via RT <bug-Astro@rt.cpan.org> Sent: Wednesday, 14 December 2016 2:23 PM Subject: [rt.cpan.org #119232] Negative or other early Julian Dates don't convert correctly Tue Dec 13 22:23:02 2016: Request 119232 was acted upon. Transaction: Ticket created by msb@vex.net Queue: Astro Subject: Negative or other early Julian Dates don't convert correctly Broken in: (no value) Severity: (no value) Owner: Nobody Requestors: msb@vex.net Status: new Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=119232 > I have "perl 5, version 22, subversion 2 (v5.22.2) built for x86_64-linux-thread-multi" running on Fedora 23 Linux. I downloaded Astro::Time from cpan within the last 24 hours. I don't know how to check which version of it that is. This program: use Astro::Time; foreach my $jd ( -10 .. 420 ) { my ($d, $m, $y, undef) = mjd2cal(jd2mjd($jd)); printf "%6d => year %4d month %02d day %02d\n", $jd, $y, $m, $d; } produces results that don't even appear like a valid progression of dates until Julian Day 97. For example, part of the output reads: 91 => year -4712 month 03 day -3 92 => year -4712 month 03 day -2 93 => year -4712 month 03 day -1 94 => year -4712 month 03 day 00 95 => year -4712 month 03 day 01 96 => year -4712 month 03 day 01 97 => year -4712 month 03 day 01 98 => year -4712 month 03 day 02 99 => year -4712 month 03 day 03 100 => year -4712 month 03 day 04 And even then the dates are wrong, since that day should be in April, not March, of year -4712. In fact it shows thirteen months in -4712 (00 to 12), followed on JD 403 by the first day of -4711. -- Mark Brader | "I'm a little worried about the bug-eater", she said. Toronto | "We're embedded in bugs, have you noticed?" msb@vex.net | -- Niven, "The Integral Trees"
Subject: Re: [rt.cpan.org #119232] Negative or other early Julian Dates don't convert correctly
Date: Wed, 14 Dec 2016 01:47:36 -0500 (EST)
To: bug-Astro [...] rt.cpan.org
From: msb [...] vex.net (Mark Brader)
Show quoted text
> I'm not sure what you are doing - I'm not sure you do either! Just to be > sure - are you aware 0 MJD is 17/11/1858 and 0 JD is January 1, 4713 BC?
Yes. 4713 BC is the same as year -4712. I had a source that gave dates of astronomical events over a long time span both past and future, in the form of JDs, some of which were negative. I thought Astro::Time would be a convenient way to convert them to dates. But it's not important. Show quoted text
> I have no idea what the algorithms for date conversion do for negative > MJD. Evidently they don't work.
For negative MJD, not just for negative JD! I didn't think of that being a limitation. You might want to document it. Show quoted text
> Sorry, I have no intention on following this up.
As you wish. I drop the matter now. Thanks for writing back. -- Mark Brader "Nicely self-consistent. (Pay no attention to Toronto that D-floating number behind the curtain!)" msb@vex.net -- Chris Torek, on pasta