Following the creation of RT ticket
https://rt.cpan.org/Public/Bug/Display.html?id=132336
I have decided to implement the proper precise algorithm in
DateTime::Event::Sunrise (already implemented in Astro::Sunrise) and
to check the values with NOAA's solar calculator and with Stellarium.

After I have implemented the proper precise algorithm, there are still
differences between the values obtained by Stellarium and the NOAA on
one side and by DT::E::S on the other side. I have found that these
differences are the caused by the "magic" values 15 and 15.04107 used
in the module.

15.04107 is the angular speed of Earth's spin, while 15 is the
combination of Earth's spin with the orbital speed of the
Sun-Earth system. According to Paul Schlyter 's description of
the precise algorithm, we should use 15.04107, but I have found
that using 15 instead gives results closer to Stellarium.

More abstractly, the problem is: when you are an low-level
amateur astronomer, who is an authoritative source for you?
Whom do you trust? Paul Schlyter or the Stellarium team or
the NOAA?

I have decided to defer this question to the module user. There is a
new parameter, "algo", which lets the user choose between trusting
Paul Schlyter more than Stellarium or trusting Stellarium more
than Paul Schlyter.

Now you may code either

  my $sunriseset = DateTime::Event::Sunrise->new(
                     latitude  => 42.3358,
                     longitude => -71.2044,
                     altitude  => '-0.833',
                     precise   => 1,
                     algo      => 'Schlyter');

or

  my $sunriseset = DateTime::Event::Sunrise->new(
                     latitude  => 42.3358,
                     longitude => -71.2044,
                     altitude  => '-0.833',
                     precise   => 1,
                     algo      => 'Stellarium');

Can you think of a better name for the new option? The creator of
ticket 132336 suggests
          spin => 15.04107,
or
          spin => 15,

The problem is that the "magic" value 15.04107 is not easy to remember,
especially if the module user knows even less astronomy than myself.
While "Schlyter" and "Stellarium" are easier to remember.

I will release the new version of DT::E::S to CPAN next week.
If you have a better idea for the name of the new parameter, please
tell me before this release.

In the meantime, the updated code is available on Github.

Thank you for your advice,

By the way, this is the second attempt to write this message
to the datetime mailing list. As it happened already, my first
attempt was lost somewhere and did not reach you or the websites
https://www.nntp.perl.org/group/perl.datetime/
and https://www.mail-archive.com/datetime@perl.org/.

Jean Forget

Reply via email to