jforget / Astro-Sunrise

Astro-Sunrise: computing the time of sunrise and sunset for a given location on Earth and a given date
https://metacpan.org/pod/Astro::Sunrise
Other
2 stars 3 forks source link

wrong time values at march, 20th 2013 [rt.cpan.org #83394] #11

Closed jforget closed 3 years ago

jforget commented 3 years ago

Migrated from rt.cpan.org#83394 (status was 'resolved')

Requestors:

Attachments:

From heinrichdederichs@googlemail.com on 2013-02-17 17:14:46 :

To whom it may concern,

os: ubuntu 12.04, kernel 3.2.0-37-generic-pae
module : Astro-Sunrise-0.91.tar.gz<http://search.cpan.org/CPAN/authors/id/R/RK/RKHILL/Astro-Sunrise-0.91.tar.gz>

error:
calculating the time values for 2013 the following result will be seen:

19.Mar    06:36    18:39        06:30    18:33        06:20    18:23
20.Mar    05:14    20:01        04:54    20:08        03:13    21:29
21.Mar    06:28    18:46        06:22    18:40        06:10    18:31

produced by the following code:
#######################################################
#!/usr/bin/perl -w
#Sonnenauf- und Untergang

use strict;
use Astro::Sunrise;
#Eitorf
my $lat = 50 + 46/60;
my $lon = 7 + 27/60;
#Tübingen
my $lat1 =48 + 31/60;
my $lon1 = 9 + 3/60;
#Hojby
my $lat2 =55 + 54/60;
my $lon2 = 11 + 36/60;

my $month = 1;
my $day = 1;
my @name = qw(Jan Feb Mar Apr Mai Jun Jul Aug Sep Oct Nov Dec);#
Monatsname, für print
my @max = (31,28,31,30,31,30,31,31,30,31,30,31); #Tage im Monat

printf("%6u",1);
print "\t Eitorf \t\t Tübingen \t\t Hojby\n";

foreach $month(1..12){

    foreach my $k (1..$max[$month-1]){
        ($Astro::Sunrise::sunrise, $Astro::Sunrise::sunset) =
sunrise(2013,$month,$k,$lon,$lat,1,0); #Eitorf
        printf("%2u", $k);
        print "." ,$name[$month-1], "\t",$Astro::Sunrise::sunrise,
"\t",$Astro::Sunrise::sunset,"\t";

        ($Astro::Sunrise::sunrise, $Astro::Sunrise::sunset) =
sunrise(2013,$month,$k,$lon1,$lat1,1,0);#Tübingen
        print "\t",$Astro::Sunrise::sunrise,
"\t",$Astro::Sunrise::sunset,"\t";

        ($Astro::Sunrise::sunrise, $Astro::Sunrise::sunset) =
sunrise(2013,$month,$k,$lon2,$lat2,1,0);#Hojby
        print "\t",$Astro::Sunrise::sunrise,
"\t",$Astro::Sunrise::sunset,"\n";}

    }

#######################################################################################

Heinrich Dederichs

From http://vwegert.myopenid.com/ on 2013-05-20 07:52:42 :

I can confirm this. For Berlin, the module refuses to determine a sunset at all:

use strict;
use Astro::Sunrise;

my ($sunrise, $sunset) = sunrise(2013, 03, 20, 13.3833, 52.5166, +1, 1, 1);

Result: 

Sun never sets!!
 at bug-demo.pl line 4.

From http://vwegert.myopenid.com/ on 2013-05-20 08:27:23 :

Trying to contact the author, I got 

<rkhill@firstlight.net>: host mail2.firstlight.net[216.86.201.22] said: 554
   5.7.1 <rkhill@firstlight.net>: Relay access denied (in reply to RCPT TO
   command)

Maybe someone else could try this?

From j2n-forget@orange.fr on 2013-06-17 20:38:08 :

This problem has already been reported 4 years
ago by J Rainer
https://rt.cpan.org/Ticket/Display.html?id=47049

And it is the same problem that three persons
(including me) have reported in DateTime::Event::Sunrise.
See
https://rt.cpan.org/Ticket/Display.html?id=34770
https://rt.cpan.org/Ticket/Display.html?id=55762
https://rt.cpan.org/Ticket/Display.html?id=75927

I have offered a patch (to DT::E::Sunrise, not Astro::Sunrise)
five years ago and it is still not installed.

From j2n-forget@orange.fr on 2013-07-05 05:04:20 :

Le Lun 20 Mai 2013 04:27:23, http://vwegert.myopenid.com/ a écrit :
> Trying to contact the author, I got 
> 
> <rkhill@firstlight.net>: host mail2.firstlight.net[216.86.201.22] said: 554
>    5.7.1 <rkhill@firstlight.net>: Relay access denied (in reply to RCPT TO
>    command)
> 
> Maybe someone else could try this?

I have sent a message to the author, copy to the DateTime mailing-list. Included
in this message is my proposal for co-maintenance of this module and its twin
DateTime::Event::Sunrise. I have no reply from the author. On the other hand,
my proposal for co-maintenance has been forwarded to the perl.modules mailing-list

http://www.nntp.perl.org/group/perl.datetime/2013/07/msg7933.html
http://www.nntp.perl.org/group/perl.modules/2013/07/msg86617.html

Here is a patch to fix the 20 March problem.
To install it:

Download Astro-Sunrise-0.91.tar.gz and astro-sunrise.patch into the same directory

tar -zxvf Astro-Sunrise-0.91.tar.gz
mv Astro-Sunrise-0.91 Astro-Sunrise
patch -p0 < astro-sunrise.patch
cd Astro-Sunrise
perl Makefile.PL
make
make test
sudo make install

Or you can clone or download my Github repository:
https://github.com/jforget/Astro-Sunrise
and install with the usual "make" mantra.
jforget commented 3 years ago

Patch provided on Friday 2013-07-05 astro-sunrise.patch.txt

jforget commented 3 years ago

Tuesday 2013-07-09: issue is closed.