DateTime-Event-Sunrise
view release on metacpan or search on metacpan
lib/DateTime/Event/Sunrise.pm view on Meta::CPAN
=item * B<0> degrees
Center of Sun's disk touches a mathematical horizon
=item * B<-0.25> degrees
Sun's upper limb touches a mathematical horizon
=item * B<-0.583> degrees
Center of Sun's disk touches the horizon; atmospheric refraction accounted for
=item * B<-0.833> degrees
Sun's supper limb touches the horizon; atmospheric refraction accounted for
=item * B<-6> degrees
Civil twilight (one can no longer read outside without artificial illumination)
=item * B<-12> degrees
Nautical twilight (navigation using a sea horizon no longer possible)
=item * B<-15> degrees
Amateur astronomical twilight (the sky is dark enough for most astronomical observations)
=item * B<-18> degrees
Astronomical twilight (the sky is completely dark)
=back
=head2 Notes on the Precise Algorithm
The original method only gives an approximate value of the Sun's rise/set times.
The error rarely exceeds one or two minutes, but at high latitudes, when the Midnight Sun
soon will start or just has ended, the errors may be much larger. If you want higher accuracy,
you must then select the precise variant of the algorithm. This feature is new as of version 0.7. Here is
what I (module creator) have tried to accomplish with this.
=over 4
=item a)
Compute sunrise or sunset as always, with one exception: to convert LHA from degrees to hours,
divide by 15.04107 instead of 15.0 (this accounts for the difference between the solar day
and the sidereal day.
=item b)
Re-do the computation but compute the Sun's RA and Decl, and also GMST0, for the moment
of sunrise or sunset last computed.
=item c)
Iterate b) until the computed sunrise or sunset no longer changes significantly.
Usually 2 iterations are enough, in rare cases 3 or 4 iterations may be needed.
=back
However, I (second module maintainer) have checked with a few external
sources, to obtain test data. And actually, using the value 15.0 gives
results closer to what Stellarium and the NOAA solar calculator give.
So I will use value 15.0, unless I find a bug in the precise algorithm
as presently implemented.
=head2 Notes on polar locations
If the location is beyond either polar circle, and if the date is near
either solstice, there can be midnight sun or polar night. In this
case, there is neither sunrise nor sunset, and the module C<carp>s
that the sun never rises or never sets. Then, it returns the time at
which the sun is at its highest or lowest point.
When computing twilights instead of sunrises / sunsets, the limit for
polar locations extends a little beyond the polar circle. For example,
for nautical twilights (12 degrees below the horizon), the limits
where midnight sun might happen is 12 degrees southward of the Arctic
Circle and 12 degrees northward of the Antarctic Circle, that is,
about 54° latitude instead of 66°33â².
=head1 DEPENDENCIES
This module requires:
=over 4
=item *
DateTime
=item *
DateTime::Set
=item *
DateTime::Span
=item *
Params::Validate
=item *
Set::Infinite
=item *
POSIX
=item *
Math::Trig
=back
( run in 0.657 second using v1.01-cache-2.11-cpan-71847e10f99 )