summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWorachate Boonplod <41257965+worachate001@users.noreply.github.com>2022-03-12 21:23:49 +0700
committerGitHub <noreply@github.com>2022-03-12 21:23:49 +0700
commit24be2eea9a4eed2def1f844c484915049ee9bbb7 (patch)
tree8c6f7e3e762ce07546fe357059fd8837033d4606
parent3db0c2e57c369a2282e9751c868645260c544d58 (diff)
Fix bug in AstroCalc/Eclipses for local solar eclipses (#2345)
* Fix bug in AstroCalc/Eclipses when total/annular eclipses take place very close to the horizon To reproduce * Set the location to North Pole * Open 'AstroCalc/Local Solar Eclipses' tab * Set 2015 as the starting year The calculation shows that 2015 Mar 20 was a partial eclipse, contradicting to the magnitude at greatest eclipse of 1.013 (total eclipse). The bug happens because the total eclipse took place very close to the horizon. The same situation can be found on other dates when your location is at the start or end point of any central eclipses. * Update AstroCalcDialog.cpp
-rw-r--r--src/gui/AstroCalcDialog.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/AstroCalcDialog.cpp b/src/gui/AstroCalcDialog.cpp
index b8bc88353f..cecce524f7 100644
--- a/src/gui/AstroCalcDialog.cpp
+++ b/src/gui/AstroCalcDialog.cpp
@@ -3499,7 +3499,7 @@ void AstroCalcDialog::generateSolarEclipsesLocal()
}
double C3altitude = eclipseData.altitude;
- if (eclipseData.ce > 0. && ((C2altitude > 0.) || (C3altitude > 0.))) // Central eclipse occurs
+ if (eclipseData.ce > 0. && ((C2altitude > -.3) || (C3altitude > -.3))) // Central eclipse occurs
{
centraleclipse = true;
if (eclipseData.L2 < 0.)
@@ -3539,6 +3539,8 @@ void AstroCalcDialog::generateSolarEclipsesLocal()
treeItem->setData(SolarEclipseLocalDate, Qt::UserRole, JDmax);
treeItem->setText(SolarEclipseLocalType, eclipseTypeStr);
treeItem->setText(SolarEclipseLocalFirstContact, QString("%1").arg(localeMgr->getPrintableTimeLocal(JD1)));
+ if (centraleclipse && JD2<JD1) // central eclipse in progress at Sunrise
+ treeItem->setText(SolarEclipseLocalFirstContact, dash);
treeItem->setToolTip(SolarEclipseLocalFirstContact, q_("The time of first contact"));
if (centraleclipse)
@@ -3555,6 +3557,8 @@ void AstroCalcDialog::generateSolarEclipsesLocal()
treeItem->setText(SolarEclipseLocal3rdContact, dash);
treeItem->setToolTip(SolarEclipseLocal3rdContact, q_("The time of third contact"));
treeItem->setText(SolarEclipseLocalLastContact, QString("%1").arg(localeMgr->getPrintableTimeLocal(JD4)));
+ if (centraleclipse && JD3>JD4) // central eclipse in progress at Sunset
+ treeItem->setText(SolarEclipseLocalLastContact, dash);
treeItem->setToolTip(SolarEclipseLocalLastContact, q_("The time of fourth contact"));
if (centraleclipse)
treeItem->setText(SolarEclipseLocalDuration, durationStr);