Fixed Equinox and Solstice dates in Calculator
ClosedPublic

Authored by paritosh on Feb 14 2020, 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
Lint Skipped
Unit
Unit Tests Skipped
paritosh created this revision.Feb 14 2020, 4:36 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptFeb 14 2020, 4:36 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
paritosh requested review of this revision.Feb 14 2020, 4:36 PM
mutlaqja requested changes to this revision.Feb 16 2020, 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–52

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.Feb 16 2020, 5:38 AM
paritosh updated this revision to Diff 75802.Feb 16 2020, 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.Feb 18 2020, 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.Feb 18 2020, 8:58 AM
This revision is now accepted and ready to land.Feb 18 2020, 8:58 AM
This revision was automatically updated to reflect the committed changes.

Thanks, great job on your first PR to KStars!