StelCore.cpp   StelCore.cpp 
skipping to change at line 87 skipping to change at line 87
, currentDeltaTAlgorithm(EspenakMeeus) , currentDeltaTAlgorithm(EspenakMeeus)
, position(NULL) , position(NULL)
, flagUseNutation(true) , flagUseNutation(true)
, flagUseTopocentricCoordinates(true) , flagUseTopocentricCoordinates(true)
, timeSpeed(JD_SECOND) , timeSpeed(JD_SECOND)
, JD(0.,0.) , JD(0.,0.)
, presetSkyTime(0.) , presetSkyTime(0.)
, milliSecondsOfLastJDUpdate(0.) , milliSecondsOfLastJDUpdate(0.)
, jdOfLastJDUpdate(0.) , jdOfLastJDUpdate(0.)
, flagUseDST(true) , flagUseDST(true)
, flagUseCTZ(false)
, deltaTCustomNDot(-26.0) , deltaTCustomNDot(-26.0)
, deltaTCustomYear(1820.0) , deltaTCustomYear(1820.0)
, deltaTnDot(-26.0)
, deltaTdontUseMoon(false)
, deltaTfunc(StelUtils::getDeltaTByEspenakMeeus)
, deltaTstart(-1999)
, deltaTfinish(3000)
, de430Available(false) , de430Available(false)
, de431Available(false) , de431Available(false)
, de430Active(false) , de430Active(false)
, de431Active(false) , de431Active(false)
{ {
setObjectName("StelCore"); setObjectName("StelCore");
registerMathMetaTypes(); registerMathMetaTypes();
toneReproducer = new StelToneReproducer(); toneReproducer = new StelToneReproducer();
milliSecondsOfLastJDUpdate = QDateTime::currentMSecsSinceEpoch(); milliSecondsOfLastJDUpdate = QDateTime::currentMSecsSinceEpoch();
skipping to change at line 179 skipping to change at line 185
location = locationMgr->locationForString(defaultLocationID) ; location = locationMgr->locationForString(defaultLocationID) ;
} }
if (!location.isValid()) if (!location.isValid())
{ {
qWarning() << "Warning: location" << defaultLocationID << "i s unknown."; qWarning() << "Warning: location" << defaultLocationID << "i s unknown.";
location = locationMgr->getLastResortLocation(); location = locationMgr->getLastResortLocation();
} }
position = new StelObserver(location); position = new StelObserver(location);
setCurrentTimeZone(conf->value("localization/time_zone", getCurrentL QString ctz = conf->value("localization/time_zone", "").toString();
ocation().timeZone).toString()); if (!ctz.isEmpty())
setUseCustomTimeZone(true);
else
ctz = getCurrentLocation().ianaTimeZone;
setCurrentTimeZone(ctz);
// Delta-T stuff // Delta-T stuff
// Define default algorithm for time correction (Delta T) // Define default algorithm for time correction (Delta T)
QString tmpDT = conf->value("navigation/time_correction_algorithm", "EspenakMeeus").toString(); QString tmpDT = conf->value("navigation/time_correction_algorithm", "EspenakMeeus").toString();
setCurrentDeltaTAlgorithmKey(tmpDT); setCurrentDeltaTAlgorithmKey(tmpDT);
// Define variables of custom equation for calculation of Delta T // Define variables of custom equation for calculation of Delta T
// Default: ndot = -26.0 "/cy/cy; year = 1820; DeltaT = -20 + 32*u^2 , where u = (currentYear-1820)/100 // Default: ndot = -26.0 "/cy/cy; year = 1820; DeltaT = -20 + 32*u^2 , where u = (currentYear-1820)/100
setDeltaTCustomYear(conf->value("custom_time_correction/year", 1820. 0).toFloat()); setDeltaTCustomYear(conf->value("custom_time_correction/year", 1820. 0).toFloat());
setDeltaTCustomNDot(conf->value("custom_time_correction/ndot", -26.0 ).toFloat()); setDeltaTCustomNDot(conf->value("custom_time_correction/ndot", -26.0 ).toFloat());
skipping to change at line 234 skipping to change at line 245
skyDrawer = new StelSkyDrawer(this); skyDrawer = new StelSkyDrawer(this);
skyDrawer->init(); skyDrawer->init();
propMgr->registerObject(skyDrawer); propMgr->registerObject(skyDrawer);
propMgr->registerObject(this); propMgr->registerObject(this);
setCurrentProjectionTypeKey(getDefaultProjectionTypeKey()); setCurrentProjectionTypeKey(getDefaultProjectionTypeKey());
updateMaximumFov(); updateMaximumFov();
// activate DE430/431
initEphemeridesFunctions();
// Register all the core actions. // Register all the core actions.
QString timeGroup = N_("Date and Time"); QString timeGroup = N_("Date and Time");
QString movementGroup = N_("Movement and Selection"); QString movementGroup = N_("Movement and Selection");
QString displayGroup = N_("Display Options"); QString displayGroup = N_("Display Options");
StelActionMgr* actionsMgr = StelApp::getInstance().getStelActionMana ger(); StelActionMgr* actionsMgr = StelApp::getInstance().getStelActionMana ger();
actionsMgr->addAction("actionIncrease_Time_Speed", timeGroup, N_("In crease time speed"), this, "increaseTimeSpeed()", "L"); actionsMgr->addAction("actionIncrease_Time_Speed", timeGroup, N_("In crease time speed"), this, "increaseTimeSpeed()", "L");
actionsMgr->addAction("actionDecrease_Time_Speed", timeGroup, N_("De crease time speed"), this, "decreaseTimeSpeed()", "J"); actionsMgr->addAction("actionDecrease_Time_Speed", timeGroup, N_("De crease time speed"), this, "decreaseTimeSpeed()", "J");
actionsMgr->addAction("actionIncrease_Time_Speed_Less", timeGroup, N _("Increase time speed (a little)"), this, "increaseTimeSpeedLess()", "Shif t+L"); actionsMgr->addAction("actionIncrease_Time_Speed_Less", timeGroup, N _("Increase time speed (a little)"), this, "increaseTimeSpeedLess()", "Shif t+L");
actionsMgr->addAction("actionDecrease_Time_Speed_Less", timeGroup, N _("Decrease time speed (a little)"), this, "decreaseTimeSpeedLess()", "Shif t+J"); actionsMgr->addAction("actionDecrease_Time_Speed_Less", timeGroup, N _("Decrease time speed (a little)"), this, "decreaseTimeSpeedLess()", "Shif t+J");
actionsMgr->addAction("actionSet_Real_Time_Speed", timeGroup, N_("Se t normal time rate"), this, "toggleRealTimeSpeed()", "K"); actionsMgr->addAction("actionSet_Real_Time_Speed", timeGroup, N_("Se t normal time rate"), this, "toggleRealTimeSpeed()", "K");
skipping to change at line 492 skipping to change at line 506
/************************************************************************* /*************************************************************************
Execute all the pre-drawing functions Execute all the pre-drawing functions
*************************************************************************/ *************************************************************************/
void StelCore::preDraw() void StelCore::preDraw()
{ {
// Init openGL viewing with fov, screen size and clip planes // Init openGL viewing with fov, screen size and clip planes
currentProjectorParams.zNear = 0.000001; currentProjectorParams.zNear = 0.000001;
currentProjectorParams.zFar = 500.; currentProjectorParams.zFar = 500.;
skyDrawer->preDraw(); skyDrawer->preDraw();
// Clear areas not redrawn by main viewport (i.e. fisheye square vie
wport)
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
} }
/************************************************************************* /*************************************************************************
Update core state after drawing modules Update core state after drawing modules
*************************************************************************/ *************************************************************************/
void StelCore::postDraw() void StelCore::postDraw()
{ {
StelPainter sPainter(getProjection(StelCore::FrameJ2000)); StelPainter sPainter(getProjection(StelCore::FrameJ2000));
sPainter.drawViewportShape(); sPainter.drawViewportShape();
} }
skipping to change at line 755 skipping to change at line 765
Vec3d StelCore::galacticToJ2000(const Vec3d& v) const Vec3d StelCore::galacticToJ2000(const Vec3d& v) const
{ {
return matGalacticToJ2000*v; return matGalacticToJ2000*v;
} }
Vec3d StelCore::supergalacticToJ2000(const Vec3d& v) const Vec3d StelCore::supergalacticToJ2000(const Vec3d& v) const
{ {
return matSupergalacticToJ2000*v; return matSupergalacticToJ2000*v;
} }
Vec3d StelCore::equinoxEquToJ2000(const Vec3d& v) const Vec3d StelCore::equinoxEquToJ2000(const Vec3d& v, RefractionMode refMode) c onst
{ {
return matEquinoxEquToJ2000*v; if (refMode==RefractionOff || skyDrawer==NULL || (refMode==Refractio
nAuto && skyDrawer->getFlagHasAtmosphere()==false))
return matEquinoxEquToJ2000*v;
Vec3d r(v);
r.transfo4d(matEquinoxEquToAltAz);
skyDrawer->getRefraction().backward(r);
r.transfo4d(matAltAzToJ2000);
return r;
} }
Vec3d StelCore::j2000ToEquinoxEqu(const Vec3d& v) const Vec3d StelCore::j2000ToEquinoxEqu(const Vec3d& v, RefractionMode refMode) c onst
{ {
return matJ2000ToEquinoxEqu*v; if (refMode==RefractionOff || skyDrawer==NULL || (refMode==Refractio
nAuto && skyDrawer->getFlagHasAtmosphere()==false))
return matJ2000ToEquinoxEqu*v;
Vec3d r(v);
r.transfo4d(matJ2000ToAltAz);
skyDrawer->getRefraction().forward(r);
r.transfo4d(matAltAzToEquinoxEqu);
return r;
} }
Vec3d StelCore::j2000ToJ1875(const Vec3d& v) const Vec3d StelCore::j2000ToJ1875(const Vec3d& v) const
{ {
return matJ2000ToJ1875*v; return matJ2000ToJ1875*v;
} }
Vec3d StelCore::j2000ToGalactic(const Vec3d& v) const Vec3d StelCore::j2000ToGalactic(const Vec3d& v) const
{ {
return matJ2000ToGalactic*v; return matJ2000ToGalactic*v;
skipping to change at line 920 skipping to change at line 942
matAltAzToEquinoxEqu = position->getRotAltAzToEquatorial(getJD(), ge tJDE()); matAltAzToEquinoxEqu = position->getRotAltAzToEquatorial(getJD(), ge tJDE());
matEquinoxEquToAltAz = matAltAzToEquinoxEqu.transpose(); matEquinoxEquToAltAz = matAltAzToEquinoxEqu.transpose();
// multiply static J2000 earth axis tilt (eclipticalJ2000<->equatori alJ2000) // multiply static J2000 earth axis tilt (eclipticalJ2000<->equatori alJ2000)
// in effect, this matrix transforms from VSOP87 ecliptical J2000 to planet-based equatorial coordinates. // in effect, this matrix transforms from VSOP87 ecliptical J2000 to planet-based equatorial coordinates.
// For earth, matJ2000ToEquinoxEqu is the precession matrix. // For earth, matJ2000ToEquinoxEqu is the precession matrix.
// TODO: rename matEquinoxEquToJ2000 to matEquinoxEquDateToJ2000 // TODO: rename matEquinoxEquToJ2000 to matEquinoxEquDateToJ2000
matEquinoxEquToJ2000 = matVsop87ToJ2000 * position->getRotEquatorial ToVsop87(); matEquinoxEquToJ2000 = matVsop87ToJ2000 * position->getRotEquatorial ToVsop87();
matJ2000ToEquinoxEqu = matEquinoxEquToJ2000.transpose(); matJ2000ToEquinoxEqu = matEquinoxEquToJ2000.transpose();
matJ2000ToAltAz = matEquinoxEquToAltAz*matJ2000ToEquinoxEqu; matJ2000ToAltAz = matEquinoxEquToAltAz*matJ2000ToEquinoxEqu;
matAltAzToJ2000 = matJ2000ToAltAz.transpose();
matHeliocentricEclipticToEquinoxEqu = matJ2000ToEquinoxEqu * matVsop 87ToJ2000 * Mat4d::translation(-position->getCenterVsop87Pos()); matHeliocentricEclipticToEquinoxEqu = matJ2000ToEquinoxEqu * matVsop 87ToJ2000 * Mat4d::translation(-position->getCenterVsop87Pos());
// These two next have to take into account the position of the obse rver on the earth/planet of observation. // These two next have to take into account the position of the obse rver on the earth/planet of observation.
// GZ tmp could be called matAltAzToVsop87 // GZ tmp could be called matAltAzToVsop87
Mat4d tmp = matJ2000ToVsop87 * matEquinoxEquToJ2000 * matAltAzToEqui noxEqu; Mat4d tmp = matJ2000ToVsop87 * matEquinoxEquToJ2000 * matAltAzToEqui noxEqu;
// Before 0.14 getDistanceFromCenter assumed spherical planets. Now uses rectangular coordinates for observer! // Before 0.14 getDistanceFromCenter assumed spherical planets. Now uses rectangular coordinates for observer!
if (flagUseTopocentricCoordinates) if (flagUseTopocentricCoordinates)
{ {
skipping to change at line 1204 skipping to change at line 1227
{ {
QDateTime local = universal.toLocalTime(); QDateTime local = universal.toLocalTime();
//Both timezones should be interpreted as UTC because secsTo () converts both //Both timezones should be interpreted as UTC because secsTo () converts both
//times to UTC if their zones have different daylight saving time rules. //times to UTC if their zones have different daylight saving time rules.
local.setTimeSpec(Qt::UTC); local.setTimeSpec(Qt::UTC);
shiftInSeconds = universal.secsTo(local); shiftInSeconds = universal.secsTo(local);
} }
else else
{ {
// The first adoption of a standard time was on December 1, 1847 in Great Britain // The first adoption of a standard time was on December 1, 1847 in Great Britain
if (tz->isValid() && loc.planetName=="Earth" && JD>=StelCore ::TZ_ERA_BEGINNING) if (tz->isValid() && loc.planetName=="Earth" && (JD>=StelCor e::TZ_ERA_BEGINNING || getUseCustomTimeZone()))
{ {
if (getUseDST()) if (getUseDST())
shiftInSeconds = tz->offsetFromUtc(universal ); shiftInSeconds = tz->offsetFromUtc(universal );
else else
shiftInSeconds = tz->standardTimeOffset(univ ersal); shiftInSeconds = tz->standardTimeOffset(univ ersal);
} }
else else
shiftInSeconds = (loc.longitude/15.f)*3600.f; // Loc al Mean Solar Time shiftInSeconds = (loc.longitude/15.f)*3600.f; // Loc al Mean Solar Time
if (tzName=="LTST") if (tzName=="LTST")
shiftInSeconds += getSolutionEquationOfTime(JD)*60; shiftInSeconds += getSolutionEquationOfTime(JD)*60;
} }
delete tz;
tz = NULL;
float shiftInHours = shiftInSeconds / 3600.0f; float shiftInHours = shiftInSeconds / 3600.0f;
return shiftInHours; return shiftInHours;
} }
QString StelCore::getCurrentTimeZone() const QString StelCore::getCurrentTimeZone() const
{ {
return currentTimeZone; return currentTimeZone;
} }
void StelCore::setCurrentTimeZone(const QString& tz) void StelCore::setCurrentTimeZone(const QString& tz)
skipping to change at line 1244 skipping to change at line 1270
{ {
return flagUseDST; return flagUseDST;
} }
void StelCore::setUseDST(const bool b) void StelCore::setUseDST(const bool b)
{ {
flagUseDST = b; flagUseDST = b;
StelApp::getInstance().getSettings()->setValue("localization/flag_ds t", b); StelApp::getInstance().getSettings()->setValue("localization/flag_ds t", b);
} }
bool StelCore::getUseCustomTimeZone() const
{
return flagUseCTZ;
}
void StelCore::setUseCustomTimeZone(const bool b)
{
flagUseCTZ = b;
}
double StelCore::getSolutionEquationOfTime(const double JDE) const double StelCore::getSolutionEquationOfTime(const double JDE) const
{ {
double tau = (JDE - 2451545.0)/365250.0; double tau = (JDE - 2451545.0)/365250.0;
double sunMeanLongitude = 280.4664567 + tau*(360007.6892779 + tau*(0 .03032028 + tau*(1./49931. - tau*(1./15300. - tau/2000000.)))); double sunMeanLongitude = 280.4664567 + tau*(360007.6892779 + tau*(0 .03032028 + tau*(1./49931. - tau*(1./15300. - tau/2000000.))));
// reduce the angle // reduce the angle
sunMeanLongitude = std::fmod(sunMeanLongitude, 360.); sunMeanLongitude = std::fmod(sunMeanLongitude, 360.);
// force it to be the positive remainder, so that 0 <= angle < 360 // force it to be the positive remainder, so that 0 <= angle < 360
sunMeanLongitude = std::fmod(sunMeanLongitude + 360., 360.); sunMeanLongitude = std::fmod(sunMeanLongitude + 360., 360.);
skipping to change at line 1751 skipping to change at line 1787
startupTimeMode = s; startupTimeMode = s;
} }
// return precomputed DeltaT in seconds. Public. // return precomputed DeltaT in seconds. Public.
double StelCore::getDeltaT() const double StelCore::getDeltaT() const
{ {
return JD.second; return JD.second;
} }
// compute and return DeltaT in seconds. Try not to call it directly, curre nt DeltaT, JD, and JDE are available. // compute and return DeltaT in seconds. Try not to call it directly, curre nt DeltaT, JD, and JDE are available.
double StelCore::computeDeltaT(const double JD) const double StelCore::computeDeltaT(const double JD)
{ {
double DeltaT = 0.; double DeltaT = 0.;
double ndot = 0.; if (currentDeltaTAlgorithm==Custom)
bool dontUseMoon = false; {
switch (getCurrentDeltaTAlgorithm()) // User defined coefficients for quadratic equation for Delt
aT may change frequently.
deltaTnDot = deltaTCustomNDot; // n.dot = custom value "/cy/
cy
int year, month, day;
StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
double u = (StelUtils::getDecYear(year,month,day)-getDeltaTC
ustomYear())/100;
DeltaT = deltaTCustomEquationCoeff[0] + u*(deltaTCustomEquat
ionCoeff[1] + u*deltaTCustomEquationCoeff[2]);
}
else
{
Q_ASSERT(deltaTfunc);
DeltaT=deltaTfunc(JD);
}
if (!deltaTdontUseMoon)
DeltaT += StelUtils::getMoonSecularAcceleration(JD, deltaTnD
ot, ((de430Active&&EphemWrapper::jd_fits_de430(JD)) || (de431Active&&EphemW
rapper::jd_fits_de431(JD))));
return DeltaT;
}
// set a function pointer here. This should make the actual computation sim
pler by just calling the function.
void StelCore::setCurrentDeltaTAlgorithm(DeltaTAlgorithm algorithm)
{
currentDeltaTAlgorithm=algorithm;
deltaTdontUseMoon = false; // most algorithms will use it!
switch (currentDeltaTAlgorithm)
{ {
case WithoutCorrection: case WithoutCorrection:
// Without correction, DeltaT is disabled // Without correction, DeltaT is disabled
DeltaT = 0.; deltaTfunc = StelUtils::getDeltaTwithoutCorrection;
dontUseMoon = true; deltaTnDot = -26.0; // n.dot = -26.0"/cy/cy OR WHAT
SHALL WE DO HERE?
deltaTdontUseMoon = true;
deltaTstart = INT_MIN;
deltaTfinish = INT_MAX;
break; break;
case Schoch: case Schoch:
// Schoch (1931) algorithm for DeltaT // Schoch (1931) algorithm for DeltaT
ndot = -29.68; // n.dot = -29.68"/cy/cy deltaTnDot = -29.68; // n.dot = -29.68"/cy/cy
DeltaT = StelUtils::getDeltaTBySchoch(JD); deltaTfunc = StelUtils::getDeltaTBySchoch;
deltaTstart = INT_MIN;
deltaTfinish = INT_MAX;
break; break;
case Clemence: case Clemence:
// Clemence (1948) algorithm for DeltaT // Clemence (1948) algorithm for DeltaT
ndot = -22.44; // n.dot = -22.44 "/cy/cy deltaTnDot = -22.44; // n.dot = -22.44 "/cy/cy
DeltaT = StelUtils::getDeltaTByClemence(JD); deltaTfunc = StelUtils::getDeltaTByClemence;
deltaTstart = 1681;
deltaTfinish = 1900;
break; break;
case IAU: case IAU:
// IAU (1952) algorithm for DeltaT, based on observa tions by Spencer Jones (1939) // IAU (1952) algorithm for DeltaT, based on observa tions by Spencer Jones (1939)
ndot = -22.44; // n.dot = -22.44 "/cy/cy deltaTnDot = -22.44; // n.dot = -22.44 "/cy/cy
DeltaT = StelUtils::getDeltaTByIAU(JD); deltaTfunc = StelUtils::getDeltaTByIAU;
deltaTstart = 1681;
deltaTfinish = 1936; // Details in http://adsabs.
harvard.edu/abs/1939MNRAS..99..541S
break; break;
case AstronomicalEphemeris: case AstronomicalEphemeris:
// Astronomical Ephemeris (1960) algorithm for Delta T // Astronomical Ephemeris (1960) algorithm for Delta T
ndot = -22.44; // n.dot = -22.44 "/cy/cy deltaTnDot = -22.44; // n.dot = -22.44 "/cy/cy
DeltaT = StelUtils::getDeltaTByAstronomicalEphemeris deltaTfunc = StelUtils::getDeltaTByAstronomicalEphem
(JD); eris;
// GZ: What is the source of "1681..1900"? Expl.Supp
l.AE 1961-p87 says "...over periods extending back to ancient times"
// I changed to what I estimate.
deltaTstart = -500; // 1681;
deltaTfinish = 2000; // 1900;
break; break;
case TuckermanGoldstine: case TuckermanGoldstine:
// Tuckerman (1962, 1964) & Goldstine (1973) algorit hm for DeltaT // Tuckerman (1962, 1964) & Goldstine (1973) algorit hm for DeltaT
//FIXME: n.dot //FIXME: n.dot
ndot = -22.44; // n.dot = -22.44 "/cy/cy ??? deltaTnDot = -22.44; // n.dot = -22.44 "/cy/cy ???
DeltaT = StelUtils::getDeltaTByTuckermanGoldstine(JD deltaTfunc = StelUtils::getDeltaTByTuckermanGoldstin
); e;
deltaTstart = -600;
deltaTfinish = 1649;
break; break;
case MullerStephenson: case MullerStephenson:
// Muller & Stephenson (1975) algorithm for DeltaT // Muller & Stephenson (1975) algorithm for DeltaT
ndot = -37.5; // n.dot = -37.5 "/cy/cy deltaTnDot = -37.5; // n.dot = -37.5 "/cy/cy
DeltaT = StelUtils::getDeltaTByMullerStephenson(JD); deltaTfunc = StelUtils::getDeltaTByMullerStephenson;
deltaTstart = -1375;
deltaTfinish = 1975;
break; break;
case Stephenson1978: case Stephenson1978:
// Stephenson (1978) algorithm for DeltaT // Stephenson (1978) algorithm for DeltaT
ndot = -30.0; // n.dot = -30.0 "/cy/cy deltaTnDot = -30.0; // n.dot = -30.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByStephenson1978(JD); deltaTfunc = StelUtils::getDeltaTByStephenson1978;
deltaTstart = INT_MIN; // Range unknown!
deltaTfinish = INT_MAX;
break; break;
case SchmadelZech1979: case SchmadelZech1979:
// Schmadel & Zech (1979) algorithm for DeltaT // Schmadel & Zech (1979) algorithm for DeltaT
ndot = -23.8946; // n.dot = -23.8946 "/cy/cy deltaTnDot = -23.8946; // n.dot = -23.8946 "/cy/cy
DeltaT = StelUtils::getDeltaTBySchmadelZech1979(JD); deltaTfunc = StelUtils::getDeltaTBySchmadelZech1979;
deltaTstart = 1800;
deltaTfinish = 1975;
break; break;
case MorrisonStephenson1982: case MorrisonStephenson1982:
// Morrison & Stephenson (1982) algorithm for DeltaT (used by RedShift) // Morrison & Stephenson (1982) algorithm for DeltaT (used by RedShift)
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByMorrisonStephenson198 deltaTfunc = StelUtils::getDeltaTByMorrisonStephenso
2(JD); n1982;
// FIXME: This is correct valid range?
deltaTstart = -4000;
deltaTfinish = 2800;
break; break;
case StephensonMorrison1984: case StephensonMorrison1984:
// Stephenson & Morrison (1984) algorithm for DeltaT // Stephenson & Morrison (1984) algorithm for DeltaT
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByStephensonMorrison198 deltaTfunc = StelUtils::getDeltaTByStephensonMorriso
4(JD); n1984;
deltaTstart = -391;
deltaTfinish = 1600;
break; break;
case StephensonHoulden: case StephensonHoulden:
// Stephenson & Houlden (1986) algorithm for DeltaT // Stephenson & Houlden (1986) algorithm for DeltaT.
ndot = -26.0; // n.dot = -26.0 "/cy/cy The limits are implicitly given by the tabulated values.
DeltaT = StelUtils::getDeltaTByStephensonHoulden(JD) deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
; deltaTfunc = StelUtils::getDeltaTByStephensonHoulden
;
deltaTstart = -600;
deltaTfinish = 1650;
break; break;
case Espenak: case Espenak:
// Espenak (1987, 1989) algorithm for DeltaT // Espenak (1987, 1989) algorithm for DeltaT
//FIXME: n.dot //FIXME: n.dot
ndot = -23.8946; // n.dot = -23.8946 "/cy/cy ??? deltaTnDot = -23.8946; // n.dot = -23.8946 "/cy/cy ?
DeltaT = StelUtils::getDeltaTByEspenak(JD); ??
deltaTfunc = StelUtils::getDeltaTByEspenak;
deltaTstart = 1950;
deltaTfinish = 2100;
break; break;
case Borkowski: case Borkowski:
// Borkowski (1988) algorithm for DeltaT, relates to ELP2000-85! // Borkowski (1988) algorithm for DeltaT, relates to ELP2000-85!
ndot = -23.895; // GZ: I see -23.895 in the paper, n deltaTnDot = -23.895; // GZ: I see -23.895 in the pa
ot -23.859; (?) // n.dot = -23.859 "/cy/cy per, not -23.859; (?) // n.dot = -23.859 "/cy/cy
DeltaT = StelUtils::getDeltaTByBorkowski(JD); deltaTfunc = StelUtils::getDeltaTByBorkowski;
deltaTstart = -2136;
deltaTfinish = 1715;
break; break;
case SchmadelZech1988: case SchmadelZech1988:
// Schmadel & Zech (1988) algorithm for DeltaT // Schmadel & Zech (1988) algorithm for DeltaT
//FIXME: n.dot //FIXME: n.dot
ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy ???
DeltaT = StelUtils::getDeltaTBySchmadelZech1988(JD); deltaTfunc = StelUtils::getDeltaTBySchmadelZech1988;
deltaTstart = 1800;
deltaTfinish = 1988;
break; break;
case ChaprontTouze: case ChaprontTouze:
// Chapront-Touzé & Chapront (1991) algorithm for De ltaT // Chapront-Touzé & Chapront (1991) algorithm for De ltaT
ndot = -23.8946; // n.dot = -23.8946 "/cy/cy deltaTnDot = -23.8946; // n.dot = -23.8946 "/cy/cy
DeltaT = StelUtils::getDeltaTByChaprontTouze(JD); deltaTfunc = StelUtils::getDeltaTByChaprontTouze;
// FIXME: Is it valid range?
deltaTstart = -4000;
deltaTfinish = 8000;
break; break;
case StephensonMorrison1995: case StephensonMorrison1995:
// Stephenson & Morrison (1995) algorithm for DeltaT // Stephenson & Morrison (1995) algorithm for DeltaT
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByStephensonMorrison199 deltaTfunc = StelUtils::getDeltaTByStephensonMorriso
5(JD); n1995;
deltaTstart = -700;
deltaTfinish = 1600;
break; break;
case Stephenson1997: case Stephenson1997:
// Stephenson (1997) algorithm for DeltaT // Stephenson (1997) algorithm for DeltaT
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByStephenson1997(JD); deltaTfunc = StelUtils::getDeltaTByStephenson1997;
deltaTstart = -500;
deltaTfinish = 1600;
break; break;
case ChaprontMeeus: case ChaprontMeeus:
// Chapront, Chapront-Touze & Francou (1997) & Meeus (1998) algorithm for DeltaT // Chapront, Chapront-Touze & Francou (1997) & Meeus (1998) algorithm for DeltaT
ndot = -25.7376; // n.dot = -25.7376 "/cy/cy deltaTnDot = -25.7376; // n.dot = -25.7376 "/cy/cy
DeltaT = StelUtils::getDeltaTByChaprontMeeus(JD); deltaTfunc = StelUtils::getDeltaTByChaprontMeeus;
deltaTstart = -400; // 1800; // not explicitly g
iven, but guess based on his using ChaprontFrancou which is cited elsewhere
in a similar term with -391.
deltaTfinish = 2150; // 1997;
break; break;
case JPLHorizons: case JPLHorizons:
// JPL Horizons algorithm for DeltaT // JPL Horizons algorithm for DeltaT
ndot = -25.7376; // n.dot = -25.7376 "/cy/cy deltaTnDot = -25.7376; // n.dot = -25.7376 "/cy/cy
DeltaT = StelUtils::getDeltaTByJPLHorizons(JD); deltaTfunc = StelUtils::getDeltaTByJPLHorizons;
deltaTstart = -2999;
deltaTfinish = 1620;
break; break;
case MeeusSimons: case MeeusSimons:
// Meeus & Simons (2000) algorithm for DeltaT // Meeus & Simons (2000) algorithm for DeltaT
ndot = -25.7376; // n.dot = -25.7376 "/cy/cy deltaTnDot = -25.7376; // n.dot = -25.7376 "/cy/cy
DeltaT = StelUtils::getDeltaTByMeeusSimons(JD); deltaTfunc = StelUtils::getDeltaTByMeeusSimons;
deltaTstart = 1620;
deltaTfinish = 2000;
break; break;
case ReingoldDershowitz: case ReingoldDershowitz:
// Reingold & Dershowitz (2002, 2007) algorithm for DeltaT // Reingold & Dershowitz (2002, 2007) algorithm for DeltaT
// FIXME: n.dot // FIXME: n.dot
ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy ???
DeltaT = StelUtils::getDeltaTByReingoldDershowitz(JD deltaTfunc = StelUtils::getDeltaTByReingoldDershowit
); z;
// GZ: while not original work, it's based on Meeus
and therefore the full implementation covers likewise approximately:
deltaTstart = -400; //1620;
deltaTfinish = 2100; //2019;
break; break;
case MontenbruckPfleger: case MontenbruckPfleger:
// Montenbruck & Pfleger (2000) algorithm for DeltaT // Montenbruck & Pfleger (2000) algorithm for DeltaT
// NOTE: book not contains n.dot value // NOTE: book does not contain n.dot value
// FIXME: n.dot // FIXME: n.dot
ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy ???
DeltaT = StelUtils::getDeltaTByMontenbruckPfleger(JD deltaTfunc = StelUtils::getDeltaTByMontenbruckPflege
); r;
deltaTstart = 1825;
deltaTfinish = 2005;
break; break;
case MorrisonStephenson2004: case MorrisonStephenson2004:
// Morrison & Stephenson (2004, 2005) algorithm for DeltaT // Morrison & Stephenson (2004, 2005) algorithm for DeltaT
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByMorrisonStephenson200 deltaTfunc = StelUtils::getDeltaTByMorrisonStephenso
4(JD); n2004;
deltaTstart = -1000;
deltaTfinish = 2000;
break; break;
case Reijs: case Reijs:
// Reijs (2006) algorithm for DeltaT // Reijs (2006) algorithm for DeltaT
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByReijs(JD); deltaTfunc = StelUtils::getDeltaTByReijs;
deltaTstart = -1500; // -500; // GZ: It models l
ong-term variability, so we should reflect this. Not sure on the begin, tho
ugh.
deltaTfinish = 1100; // not 1620; // GZ: Not appl
icable for telescopic era, and better not after 1100 (pers.comm.)
break; break;
case EspenakMeeus: case EspenakMeeus:
// Espenak & Meeus (2006) algorithm for DeltaT // Espenak & Meeus (2006) algorithm for DeltaT
ndot = -25.858; // n.dot = -25.858 "/cy/cy deltaTnDot = -25.858; // n.dot = -25.858 "/cy/cy
DeltaT = StelUtils::getDeltaTByEspenakMeeus(JD); deltaTfunc = StelUtils::getDeltaTByEspenakMeeus;
deltaTstart = -1999;
deltaTfinish = 3000;
break; break;
case EspenakMeeusZeroMoonAccel: case EspenakMeeusZeroMoonAccel:
// This is a trying area. Something is wrong with De ltaT, maybe ndot is still not applied correctly. // This is a trying area. Something is wrong with De ltaT, maybe ndot is still not applied correctly.
// Espenak & Meeus (2006) algorithm for DeltaT // Espenak & Meeus (2006) algorithm for DeltaT
ndot = -25.858; // n.dot = -25.858 "/cy/cy deltaTnDot = -25.858; // n.dot = -25.858 "/cy/cy
dontUseMoon = true; deltaTdontUseMoon = true;
DeltaT = StelUtils::getDeltaTByEspenakMeeus(JD); deltaTfunc = StelUtils::getDeltaTByEspenakMeeus;
deltaTstart = -1999;
deltaTfinish = 3000;
break; break;
case Banjevic: case Banjevic:
// Banjevic (2006) algorithm for DeltaT // Banjevic (2006) algorithm for DeltaT
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByBanjevic(JD); deltaTfunc = StelUtils::getDeltaTByBanjevic;
deltaTstart = -2020;
deltaTfinish = 1620;
break; break;
case IslamSadiqQureshi: case IslamSadiqQureshi:
// Islam, Sadiq & Qureshi (2008 + revisited 2013) al gorithm for DeltaT (6 polynomials) // Islam, Sadiq & Qureshi (2008 + revisited 2013) al gorithm for DeltaT (6 polynomials)
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByIslamSadiqQureshi(JD) deltaTfunc = StelUtils::getDeltaTByIslamSadiqQureshi
; ;
dontUseMoon = true; // Seems this solutions doesn't deltaTdontUseMoon = true; // Seems this solutions do
use value of secular acceleration of the Moon esn't use value of secular acceleration of the Moon
deltaTstart = 1620;
deltaTfinish = 2007;
break; break;
case KhalidSultanaZaidi: case KhalidSultanaZaidi:
// M. Khalid, Mariam Sultana and Faheem Zaidi polino mial approximation of time period 1620-2013 (2014) // M. Khalid, Mariam Sultana and Faheem Zaidi polino mial approximation of time period 1620-2013 (2014)
ndot = -26.0; // n.dot = -26.0 "/cy/cy deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByKhalidSultanaZaidi(JD deltaTfunc = StelUtils::getDeltaTByKhalidSultanaZaid
); i;
dontUseMoon = true; // Seems this solutions doesn't deltaTdontUseMoon = true; // Seems this solutions do
use value of secular acceleration of the Moon esn't use value of secular acceleration of the Moon
deltaTstart = 1620;
deltaTfinish = 2013;
break;
case StephensonMorrisonHohenkerk2016:
deltaTnDot = -25.82; // n.dot = -25.82 "/cy/cy
deltaTfunc=StelUtils::getDeltaTByStephensonMorrisonH
ohenkerk2016;
deltaTstart = -720;
deltaTfinish = 2015;
break; break;
case Custom: case Custom:
// User defined coefficients for quadratic equation // User defined coefficients for quadratic equation
for DeltaT for DeltaT. These can change, and we don't use the function pointer here.
ndot = getDeltaTCustomNDot(); // n.dot = custom valu deltaTnDot = deltaTCustomNDot; // n.dot = custom val
e "/cy/cy ue "/cy/cy
int year, month, day; deltaTfunc=NULL;
Vec3f coeff = getDeltaTCustomEquationCoefficients(); deltaTstart = INT_MIN; // Range unknown!
StelUtils::getDateFromJulianDay(JD, &year, &month, & deltaTfinish = INT_MAX;
day);
double u = (StelUtils::getDecYear(year,month,day)-ge
tDeltaTCustomYear())/100;
DeltaT = coeff[0] + u*(coeff[1] + u*coeff[2]);
break; break;
default:
deltaTnDot = -26.0; // n.dot = -26.0 "/cy/cy
deltaTfunc=NULL;
deltaTstart = INT_MIN; // Range unknown!
deltaTfinish = INT_MAX;
qCritical() << "StelCore: unknown DeltaT algorithm s
elected (" << currentDeltaTAlgorithm << ")! (setting nDot=-26., but no func
tion!!)";
} }
Q_ASSERT((currentDeltaTAlgorithm==Custom) || (deltaTfunc!=NULL));
if (!dontUseMoon)
DeltaT += StelUtils::getMoonSecularAcceleration(JD, ndot, (d
e430Active || de431Active) && true);
return DeltaT;
} }
//! Set the current algorithm for time correction to use //! Set the current algorithm for time correction to use
void StelCore::setCurrentDeltaTAlgorithmKey(QString key) void StelCore::setCurrentDeltaTAlgorithmKey(QString key)
{ {
const QMetaEnum& en = metaObject()->enumerator(metaObject()->indexOf Enumerator("DeltaTAlgorithm")); const QMetaEnum& en = metaObject()->enumerator(metaObject()->indexOf Enumerator("DeltaTAlgorithm"));
DeltaTAlgorithm algo = (DeltaTAlgorithm)en.keyToValue(key.toLatin1() .data()); DeltaTAlgorithm algo = (DeltaTAlgorithm)en.keyToValue(key.toLatin1() .data());
if (algo<0) if (algo<0)
{ {
qWarning() << "Unknown DeltaT algorithm: " << key << "settin g \"WithoutCorrection\" instead"; qWarning() << "Unknown DeltaT algorithm: " << key << "settin g \"WithoutCorrection\" instead";
skipping to change at line 2044 skipping to change at line 2177
break; break;
case MorrisonStephenson2004: // PRIMARY SOURCE case MorrisonStephenson2004: // PRIMARY SOURCE
description = q_("This important solution was publis hed by L. V. Morrison and F. R. Stephenson in article <em>Historical values of the Earth's clock error %1T and the calculation of eclipses</em> (%2) w ith addendum in (%3).").arg(QChar(0x0394)).arg("<a href='http://adsabs.harv ard.edu/abs/2004JHA....35..327M'>2004</a>").arg("<a href='http://adsabs.har vard.edu/abs/2005JHA....36..339M'>2005</a>").append(getCurrentDeltaTAlgorit hmValidRangeDescription(jd, &marker)); description = q_("This important solution was publis hed by L. V. Morrison and F. R. Stephenson in article <em>Historical values of the Earth's clock error %1T and the calculation of eclipses</em> (%2) w ith addendum in (%3).").arg(QChar(0x0394)).arg("<a href='http://adsabs.harv ard.edu/abs/2004JHA....35..327M'>2004</a>").arg("<a href='http://adsabs.har vard.edu/abs/2005JHA....36..339M'>2005</a>").append(getCurrentDeltaTAlgorit hmValidRangeDescription(jd, &marker));
break; break;
case Reijs: case Reijs:
description = q_("From the Length of Day (LOD; as de termined by Stephenson & Morrison (%2)), Victor Reijs derived a %1T formula by using a Simplex optimisation with a cosine and square function. This is based on a possible periodicy described by Stephenson (%2). See for more i nfo %3here%4.").arg(QChar(0x0394)).arg("<a href='http://adsabs.harvard.edu/ abs/2004JHA....35..327M'>2004</a>").arg("<a href='http://www.iol.ie/~geniet /eng/DeltaTeval.htm'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRa ngeDescription(jd, &marker)); description = q_("From the Length of Day (LOD; as de termined by Stephenson & Morrison (%2)), Victor Reijs derived a %1T formula by using a Simplex optimisation with a cosine and square function. This is based on a possible periodicy described by Stephenson (%2). See for more i nfo %3here%4.").arg(QChar(0x0394)).arg("<a href='http://adsabs.harvard.edu/ abs/2004JHA....35..327M'>2004</a>").arg("<a href='http://www.iol.ie/~geniet /eng/DeltaTeval.htm'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRa ngeDescription(jd, &marker));
break; break;
case EspenakMeeus: // GENERAL SOLUTION case EspenakMeeus: // GENERAL SOLUTION
description = q_("This solution by F. Espenak and J. Meeus, based on Morrison & Stephenson (2004) and a polynomial fit through tabulated values for 1600-2000, is used for the %1NASA Eclipse Web Site%2 a nd in their <em>Five Millennium Canon of Solar Eclipses: -1900 to +3000</em > (2006). This formula is also used in the solar, lunar and planetary ephem eris program SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.gov/eclipse.ht ml'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd , &marker)).append(" <em>").append(q_("Used by default.")).append("</em>"); description = q_("This solution by F. Espenak and J. Meeus, based on Morrison & Stephenson (2004) and a polynomial fit through tabulated values for 1600-2000, is used for the %1NASA Eclipse Web Site%2 a nd in their <em>Five Millennium Canon of Solar Eclipses: -1900 to +3000</em > (2006). This formula is also used in the solar, lunar and planetary ephem eris program SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.gov/eclipse.ht ml'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd , &marker)).append(" <em>").append(q_("Used by default.")).append("</em>");
break; break;
case EspenakMeeusZeroMoonAccel: // PATCHED SOLUTION case EspenakMeeusZeroMoonAccel: // PATCHED SOLUTION. Experim ental, it may not make sense to keep it in V1.0.
description = QString("%1 %2").arg(q_("PATCHED VERSI ON WITHOUT ADDITIONAL LUNAR ACCELERATION.")).arg(q_("This solution by F. Es penak and J. Meeus, based on Morrison & Stephenson (2004) and a polynomial fit through tabulated values for 1600-2000, is used for the %1NASA Eclipse Web Site%2 and in their <em>Five Millennium Canon of Solar Eclipses: -1900 to +3000</em> (2006). This formula is also used in the solar, lunar and pla netary ephemeris program SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.go v/eclipse.html'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRangeDe scription(jd, &marker)).append(" <em>").append("</em>")); description = QString("%1 %2").arg(q_("PATCHED VERSI ON WITHOUT ADDITIONAL LUNAR ACCELERATION.")).arg(q_("This solution by F. Es penak and J. Meeus, based on Morrison & Stephenson (2004) and a polynomial fit through tabulated values for 1600-2000, is used for the %1NASA Eclipse Web Site%2 and in their <em>Five Millennium Canon of Solar Eclipses: -1900 to +3000</em> (2006). This formula is also used in the solar, lunar and pla netary ephemeris program SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.go v/eclipse.html'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRangeDe scription(jd, &marker)).append(" <em>").append("</em>"));
break; break;
case Banjevic: case Banjevic:
description = q_("This solution by B. Banjevic, base d on Stephenson & Morrison (1984), was published in article <em>Ancient ecl ipses and dating the fall of Babylon</em> (%1).").arg("<a href='http://adsa bs.harvard.edu/abs/2006POBeo..80..251B'>2006</a>").append(getCurrentDeltaTA lgorithmValidRangeDescription(jd, &marker)); description = q_("This solution by B. Banjevic, base d on Stephenson & Morrison (1984), was published in article <em>Ancient ecl ipses and dating the fall of Babylon</em> (%1).").arg("<a href='http://adsa bs.harvard.edu/abs/2006POBeo..80..251B'>2006</a>").append(getCurrentDeltaTA lgorithmValidRangeDescription(jd, &marker));
break; break;
case IslamSadiqQureshi: case IslamSadiqQureshi:
description = q_("This solution by S. Islam, M. Sadi q and M. S. Qureshi, based on Meeus & Simons (2000), was published in artic le <em>Error Minimization of Polynomial Approximation of DeltaT</em> (%1) a nd revisited by Sana Islam in 2013.").arg("<a href='http://www.ias.ac.in/ar ticle/fulltext/joaa/029/03-04/0363-0366'>2008</a>").append(getCurrentDeltaT AlgorithmValidRangeDescription(jd, &marker)); description = q_("This solution by S. Islam, M. Sadi q and M. S. Qureshi, based on Meeus & Simons (2000), was published in artic le <em>Error Minimization of Polynomial Approximation of DeltaT</em> (%1) a nd revisited by Sana Islam in 2013.").arg("<a href='http://www.ias.ac.in/ar ticle/fulltext/joaa/029/03-04/0363-0366'>2008</a>").append(getCurrentDeltaT AlgorithmValidRangeDescription(jd, &marker));
break; break;
case KhalidSultanaZaidi: case KhalidSultanaZaidi:
description = q_("This polynomial approximation with 0.6 seconds of accuracy by M. Khalid, Mariam Sultana and Faheem Zaidi was published in <em>Delta T: Polynomial Approximation of Time Period 1620-2013 </em> (%1).").arg("<a href='http://dx.doi.org/10.1155/2014/480964'>2014</a> ").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); description = q_("This polynomial approximation with 0.6 seconds of accuracy by M. Khalid, Mariam Sultana and Faheem Zaidi was published in <em>Delta T: Polynomial Approximation of Time Period 1620-2013 </em> (%1).").arg("<a href='http://dx.doi.org/10.1155/2014/480964'>2014</a> ").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker));
break; break;
case StephensonMorrisonHohenkerk2016: // PRIMARY SOURCE, SEE
MS VERY IMPORTANT
description = q_("This solution by F. R. Stephenson,
L. V. Morrison and C. Y. Hohenkerk (2016) was published in <em>Measurement
of the Earth’s rotation: 720 BC to AD 2015</em> (%1). Outside of the named
range (modelled with a spline fit) it provides values from an approximate
parabola.").arg("<a href='http://dx.doi.org/10.1098/rspa.2016.0404'>2016</a
>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker));
break;
case Custom: case Custom:
description = q_("This is a quadratic formula for ca lculation of %1T with coefficients defined by the user.").arg(QChar(0x0394) ); description = q_("This is a quadratic formula for ca lculation of %1T with coefficients defined by the user.").arg(QChar(0x0394) );
break; break;
default: default:
description = q_("Error"); description = q_("Error");
} }
// Put n-dot value info
if (getCurrentDeltaTAlgorithm()!=WithoutCorrection)
{
QString fp = QString("%1\"/cy%2").arg(QString::number(getDel
taTnDot(), 'f', 4)).arg(QChar(0x00B2));
QString sp = QString("n%1").arg(QChar(0x2032));
description.append(" " + q_("The solution's value of %1 for
%2 (secular acceleration of the Moon) requires an adaptation, see Guide for
details.").arg(fp).arg(sp));
}
return description; return description;
} }
QString StelCore::getCurrentDeltaTAlgorithmValidRangeDescription(const doub le JD, QString *marker) const QString StelCore::getCurrentDeltaTAlgorithmValidRangeDescription(const doub le JD, QString *marker) const
{ {
QString validRange = ""; QString validRange = "";
QString validRangeAppendix = ""; QString validRangeAppendix = "";
*marker = ""; *marker = "";
int year, month, day; int year, month, day;
int start = 0;
int finish = 0;
StelUtils::getDateFromJulianDay(JD, &year, &month, &day); StelUtils::getDateFromJulianDay(JD, &year, &month, &day);
switch (getCurrentDeltaTAlgorithm()) switch (currentDeltaTAlgorithm)
{ {
case WithoutCorrection: case WithoutCorrection: // and
// say nothing case Schoch: // and
break; case Clemence: // and
case Schoch: case IAU: // and
// Valid range unknown case AstronomicalEphemeris: // and
break; case TuckermanGoldstine: // and
case Clemence: case StephensonHoulden: // and
start = 1681; case MullerStephenson: // and
finish = 1900; case Stephenson1978: // and
break; case MorrisonStephenson1982: // and
case IAU: case StephensonMorrison1984: // and
start = 1681; case Espenak: // and
finish = 1936; // Details in http://adsabs.harvard. case Borkowski: // and
edu/abs/1939MNRAS..99..541S case StephensonMorrison1995: // and
break; case Stephenson1997: // and
case AstronomicalEphemeris: case ChaprontMeeus: // and
// GZ: What is the source of "1681..1900"? Expl.Supp case ReingoldDershowitz: // and
l.AE 1961-p87 says "...over periods extending back to ancient times" case MorrisonStephenson2004: // and
// I changed to what I estimate. case Reijs: // and
start = -500; // 1681; case EspenakMeeus: // the default, range stated in the Canon
finish = 2000; // 1900; , p. 14. ... and
break; case EspenakMeeusZeroMoonAccel: // and
case TuckermanGoldstine: case StephensonMorrisonHohenkerk2016:
start = -600;
finish = 1649;
break;
case MullerStephenson:
start = -1375;
finish = 1975;
break;
case Stephenson1978:
// Valid range unknown
break;
case SchmadelZech1979:
start = 1800;
finish = 1975;
validRangeAppendix = q_("with meaningless values out
side this range");
break;
case MorrisonStephenson1982:
// FIXME: This is correct valid range?
start = -4000;
finish = 2800;
break;
case StephensonMorrison1984:
start = -391;
finish = 1600;
break;
case StephensonHoulden:
start = -600;
finish = 1600;
break;
case Espenak:
start = 1950;
finish = 2100;
break;
case Borkowski:
start = -2136;
finish = 1715;
break;
case SchmadelZech1988:
start = 1800;
finish = 1988;
validRangeAppendix = q_("with a mean error of less t
han one second, max. error 1.9s, and meaningless values outside this range"
);
break;
case ChaprontTouze:
// FIXME: Is it valid range?
start = -4000;
finish = 8000;
break;
case StephensonMorrison1995:
start = -700;
finish = 1600;
break;
case Stephenson1997:
start = -500;
finish = 1600;
break;
case ChaprontMeeus:
start = -400; // 1800; // not explicitly given, bu
t guess based on his using ChaprontFrancou which is cited elsewhere in a si
milar term with -391.
finish = 2150; // 1997;
break;
case JPLHorizons:
start = -2999;
finish = 1620;
validRangeAppendix = q_("with zero values outside th
is range");
break; break;
case JPLHorizons: // and
case MeeusSimons: case MeeusSimons:
start = 1620;
finish = 2000;
validRangeAppendix = q_("with zero values outside th is range"); validRangeAppendix = q_("with zero values outside th is range");
break; break;
case MontenbruckPfleger: case MontenbruckPfleger:
start = 1825;
finish = 2005;
validRangeAppendix = q_("with a typical 1-second acc uracy and zero values outside this range"); validRangeAppendix = q_("with a typical 1-second acc uracy and zero values outside this range");
break; break;
case ReingoldDershowitz: case SchmadelZech1988:
// GZ: while not original work, it's based on Meeus validRangeAppendix = q_("with a mean error of less t
and therefore the full implementation covers likewise approximately: han one second, max. error 1.9s, and values for the limit years outside thi
start = -400; //1620; s range");
finish = 2100; //2019;
break;
case MorrisonStephenson2004:
start = -1000;
finish = 2000;
break;
case Reijs:
start = -1500; // -500; // GZ: It models long-term
variability, so we should reflect this. Not sure on the begin, though.
finish = 1100; // not 1620; // GZ: Not applicable f
or telescopic era, and better not after 1100 (pers.comm.)
break;
case EspenakMeeus: // the default, range stated in the Canon
, p. 14.
case EspenakMeeusZeroMoonAccel:
start = -1999;
finish = 3000;
break;
case Banjevic:
start = -2020;
finish = 1620;
validRangeAppendix = q_("with zero values outside th
is range");
break;
case IslamSadiqQureshi:
start = 1620;
finish = 2007;
validRangeAppendix = q_("with zero values outside th
is range");
break; break;
case SchmadelZech1979: // and
case ChaprontTouze: // and
case Banjevic: // and
case IslamSadiqQureshi: // and
case KhalidSultanaZaidi: case KhalidSultanaZaidi:
start = 1620; validRangeAppendix = q_("with values for the limit y
finish = 2013; ears outside this range");
validRangeAppendix = q_("with zero values outside th
is range");
break; break;
case Custom: case Custom:
// Valid range unknown // Valid range unknown
break; break;
} }
if (start!=finish) if (deltaTstart > INT_MIN) // limits declared?
{ {
if (validRangeAppendix!="") if (validRangeAppendix!="")
validRange = q_("Valid range of usage: between years %1 and %2, %3.").arg(start).arg(finish).arg(validRangeAppendix); validRange = q_("Valid range of usage: between years %1 and %2, %3.").arg(deltaTstart).arg(deltaTfinish).arg(validRangeAppendix );
else else
validRange = q_("Valid range of usage: between years validRange = q_("Valid range of usage: between years
%1 and %2.").arg(start).arg(finish); %1 and %2.").arg(deltaTstart).arg(deltaTfinish);
if ((year < start) || (finish < year)) if ((year < deltaTstart) || (deltaTfinish < year))
*marker = "*"; *marker = "*"; // mark "outside designed range, poss
ible wrong"
} }
else else
*marker = "?"; *marker = "?"; // mark "no range given"
return QString(" %1").arg(validRange); return QString(" %1").arg(validRange);
} }
// return if sky plus atmosphere is bright enough from sunlight so that e.g . screen labels should be rendered dark. // return if sky plus atmosphere is bright enough from sunlight so that e.g . screen labels should be rendered dark.
bool StelCore::isBrightDaylight() const bool StelCore::isBrightDaylight() const
{ {
bool r = false; bool r = false;
SolarSystem* ssys = GETSTELMODULE(SolarSystem); SolarSystem* ssys = GETSTELMODULE(SolarSystem);
const Vec3d& sunPos = ssys->getSun()->getAltAzPosGeometric(this); const Vec3d& sunPos = ssys->getSun()->getAltAzPosGeometric(this);
skipping to change at line 2241 skipping to change at line 2298
if (ssys->getEclipseFactor(this)<=0.01) // Total solar eclipse if (ssys->getEclipseFactor(this)<=0.01) // Total solar eclipse
r = false; r = false;
return r; return r;
} }
double StelCore::getCurrentEpoch() const double StelCore::getCurrentEpoch() const
{ {
return 2000.0 + (getJD() - 2451545.0)/365.25; return 2000.0 + (getJD() - 2451545.0)/365.25;
} }
// DE430/DE431 handling // DE430/DE431 handling.
// FIXME: GZ observes: When DE431 is not available, DE430 installed, but da
te outside, de430IsActive() should return false because computations go bac
k to VSOP!.
bool StelCore::de430IsAvailable() bool StelCore::de430IsAvailable()
{ {
return de430Available; return de430Available;
} }
bool StelCore::de431IsAvailable() bool StelCore::de431IsAvailable()
{ {
return de431Available; return de431Available;
} }
 End of changes. 66 change blocks. 
256 lines changed or deleted 333 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/