Fixed Equinox and Solstice dates in Calculator
ClosedPublic

Authored by paritosh on Fri, Feb 14, 4:36 PM.

Details

Summary

This patch uses a revised version of the algorithm from Astronomical algorithms - Jean Meeus to calculate the correct dates of Equinox and Solstice in Calculator.
BUG: 387929

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
paritosh created this revision.Fri, Feb 14, 4:36 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptFri, Feb 14, 4:36 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
paritosh requested review of this revision.Fri, Feb 14, 4:36 PM
mutlaqja requested changes to this revision.Sun, Feb 16, 5:38 AM
mutlaqja added a subscriber: mutlaqja.

Nice bug fix! I haven't tested the changes yet, just please check the commit and update accordignly.

kstars/tools/modcalcvizequinox.h
51

What's n? use a better variable name.

Also what's the range for n? for year, we prefer to use uint32_t, int32_t...etc, not just int, short.

Add a comment block on top to explain what the function does ..etc in the standard doxygen format we use.

This revision now requires changes to proceed.Sun, Feb 16, 5:38 AM
paritosh updated this revision to Diff 75802.Sun, Feb 16, 9:46 PM

Added comment block and removed choice variable with a single function call to compute all Solstices and Equinoxes.

Great job! I doubled checked with other sources and we are very close. However, it appears all the times we have are almost exactly 1 minute later. Not sure what is causing this. Perhaps as a "hack" solution, we subtract 60 seconds from the final results?

paritosh updated this revision to Diff 75889.Tue, Feb 18, 8:57 AM
paritosh marked an inline comment as done.

The offset thing wouldn't have worked. I looked through some corrections in chapter 10 of the book and this makes it the closest to the online calculators. If we reduce the time by huge numbers(say 800 years), even the online versions produce different results.

mutlaqja accepted this revision.Tue, Feb 18, 8:58 AM
This revision is now accepted and ready to land.Tue, Feb 18, 8:58 AM
This revision was automatically updated to reflect the committed changes.

Thanks, great job on your first PR to KStars!