Astro::Sunrise gives me an error of "Sun never sets!!" each year for
leap years, e.g. March 19 2012, but not for other dates. Location does
not appear to affect result. Is the problem in iteration? Any
suggestions? Thank you.
#!/usr/bin/perl -w
#
use Astro::Sunrise;
$y=2012;
$m=03;
$d=19;
$long=-86;
$lati=37
$Zone=-5;
$DST=1;
$ALT=-0.8333;
($sunrise, $sunset)=sunrise($y,$m,$d,$long,$lati,$Zone,$DST,$ALT,1);
print $sunrise,"\n";
print $sunset,"\n";
I am using Fedora-11, perl-5.10.0-69.fc11.i586,Astro::Sunrise was
downloaded from cpan on 17 June 2009.
PS I did not use Bitcard because "This Connection is Untrusted"!
--
Please reply to: rayner.2@osu.edu
John N Rayner, Geography/Atmospheric Sciences, Ohio State Univ.
1035 Derby Hall, 154 N. Oval Mall, Columbus, OH 43210-1361, USA
From j2n-forget@orange.fr on 2009-06-22 05:26:40
:
This has nothing to do with the iteration parameter. See
http://rt.cpan.org/Public/Bug/Display.html?id=34770
for a similar bug in DateTime::Event::Sunrise.
This is due to a confusion between variables $sr and $sRA,
which are the Sun-to-Earth distance (in astronomical units)
and the Sun's right ascension (in degrees).
From j2n-forget@orange.fr on 2013-07-05 05:08:20
:
Here is a patch to fix the 19/20/21 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.
Migrated from rt.cpan.org#47049 (status was 'resolved')
Requestors:
Attachments:
From rayner.2@osu.edu on 2009-06-17 13:44:40 :
From j2n-forget@orange.fr on 2009-06-22 05:26:40 :
From j2n-forget@orange.fr on 2013-07-05 05:08:20 :