StelCore.cpp   StelCore.cpp 
skipping to change at line 891 skipping to change at line 891
qWarning() << "WARNING - time passed to StelCore::setTodayTi me is not valid. The system time will be used." << target; qWarning() << "WARNING - time passed to StelCore::setTodayTi me is not valid. The system time will be used." << target;
setTimeNow(); setTimeNow();
} }
} }
//! Get whether the current stellarium time is the real world time //! Get whether the current stellarium time is the real world time
bool StelCore::getIsTimeNow(void) const bool StelCore::getIsTimeNow(void) const
{ {
// cache last time to prevent to much slow system call // cache last time to prevent to much slow system call
static double lastJD = getJDay(); static double lastJD = getJDay();
static bool previousResult = (fabs(getJDay()-StelUtils::getJDFromSys tem())<JD_SECOND); static bool previousResult = (fabs(getJDay()-(StelUtils::getJDFromSy stem()+getDeltaT(lastJD)/86400))<JD_SECOND);
if (fabs(lastJD-getJDay())>JD_SECOND/4) if (fabs(lastJD-getJDay())>JD_SECOND/4)
{ {
lastJD = getJDay(); lastJD = getJDay();
previousResult = (fabs(getJDay()-StelUtils::getJDFromSystem( ))<JD_SECOND); previousResult = (fabs(getJDay()-(StelUtils::getJDFromSystem ()+getDeltaT(lastJD)/86400))<JD_SECOND);
} }
return previousResult; return previousResult;
} }
QTime StelCore::getInitTodayTime(void) QTime StelCore::getInitTodayTime(void)
{ {
return initTodayTime; return initTodayTime;
} }
void StelCore::setInitTodayTime(const QTime& t) void StelCore::setInitTodayTime(const QTime& t)
skipping to change at line 997 skipping to change at line 997
addSolarDays(27.554549878); addSolarDays(27.554549878);
} }
void StelCore::addDraconicYear() void StelCore::addDraconicYear()
{ {
addSolarDays(346.620075883); addSolarDays(346.620075883);
} }
void StelCore::addTropicalYear() void StelCore::addTropicalYear()
{ {
addSolarDays(365.2421897); addSolarDays(365.242190419);
} }
void StelCore::addTropicalCentury() void StelCore::addTropicalCentury()
{ {
addSolarDays(36524.21897); addSolarDays(36524.21897);
} }
void StelCore::subtractHour() void StelCore::subtractHour()
{ {
addSolarDays(-JD_HOUR); addSolarDays(-JD_HOUR);
skipping to change at line 1087 skipping to change at line 1087
addSolarDays(-27.554549878); addSolarDays(-27.554549878);
} }
void StelCore::subtractDraconicYear() void StelCore::subtractDraconicYear()
{ {
addSolarDays(-346.620075883); addSolarDays(-346.620075883);
} }
void StelCore::subtractTropicalYear() void StelCore::subtractTropicalYear()
{ {
addSolarDays(-365.2421897); addSolarDays(-365.242190419);
} }
void StelCore::subtractTropicalCentury() void StelCore::subtractTropicalCentury()
{ {
addSolarDays(-36524.21897); addSolarDays(-36524.21897);
} }
void StelCore::addSolarDays(double d) void StelCore::addSolarDays(double d)
{ {
const PlanetP& home = position->getHomePlanet(); const PlanetP& home = position->getHomePlanet();
skipping to change at line 1112 skipping to change at line 1112
} }
void StelCore::addSiderealDays(double d) void StelCore::addSiderealDays(double d)
{ {
const PlanetP& home = position->getHomePlanet(); const PlanetP& home = position->getHomePlanet();
if (home->getEnglishName() != "Solar System Observer") if (home->getEnglishName() != "Solar System Observer")
d *= home->getSiderealDay(); d *= home->getSiderealDay();
setJDay(getJDay() + d); setJDay(getJDay() + d);
} }
// Get the sideral time shifted by the observer longitude // Get the sidereal time shifted by the observer longitude
double StelCore::getLocalSideralTime() const double StelCore::getLocalSideralTime() const
{ {
return (position->getHomePlanet()->getSiderealTime(JDay)+position->g etCurrentLocation().longitude)*M_PI/180.; return (position->getHomePlanet()->getSiderealTime(JDay)+position->g etCurrentLocation().longitude)*M_PI/180.;
} }
//! Get the duration of a sideral day for the current observer in day. //! Get the duration of a sidereal day for the current observer in day.
double StelCore::getLocalSideralDayLength() const double StelCore::getLocalSideralDayLength() const
{ {
return position->getHomePlanet()->getSiderealDay(); return position->getHomePlanet()->getSiderealDay();
} }
//! Get the duration of a sidereal year for the current observer in days.
double StelCore::getLocalSideralYearLength() const
{
return position->getHomePlanet()->getSiderealPeriod();
}
QString StelCore::getStartupTimeMode() QString StelCore::getStartupTimeMode()
{ {
return startupTimeMode; return startupTimeMode;
} }
//! Increase the time speed //! Increase the time speed
void StelCore::increaseTimeSpeed() void StelCore::increaseTimeSpeed()
{ {
double s = getTimeRate(); double s = getTimeRate();
if (s>=JD_SECOND) s*=10.; if (s>=JD_SECOND) s*=10.;
skipping to change at line 1327 skipping to change at line 1333
ndot = -26.0; // n.dot = -26.0 "/cy/cy ndot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByStephensonMorrison1995(jDay); DeltaT = StelUtils::getDeltaTByStephensonMorrison1995(jDay);
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 ndot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByStephenson1997(jDay); DeltaT = StelUtils::getDeltaTByStephenson1997(jDay);
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 = -26.0; // n.dot = -26.0 "/cy/cy ndot = -25.7376; // n.dot = -25.7376 "/cy/cy
DeltaT = StelUtils::getDeltaTByChaprontMeeus(jDay); DeltaT = StelUtils::getDeltaTByChaprontMeeus(jDay);
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 ndot = -25.7376; // n.dot = -25.7376 "/cy/cy
DeltaT = StelUtils::getDeltaTByJPLHorizons(jDay); DeltaT = StelUtils::getDeltaTByJPLHorizons(jDay);
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 ndot = -25.7376; // n.dot = -25.7376 "/cy/cy
skipping to change at line 1368 skipping to change at line 1374
case Reijs: case Reijs:
// Reijs (2006) algorithm for DeltaT // Reijs (2006) algorithm for DeltaT
ndot = -26.0; // n.dot = -26.0 "/cy/cy ndot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByReijs(jDay); DeltaT = StelUtils::getDeltaTByReijs(jDay);
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 ndot = -25.858; // n.dot = -25.858 "/cy/cy
DeltaT = StelUtils::getDeltaTByEspenakMeeus(jDay); DeltaT = StelUtils::getDeltaTByEspenakMeeus(jDay);
break; break;
case Banjevic:
// Banjevic (2006) algorithm for DeltaT
ndot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByBanjevic(jDay);
break;
case IslamSadiqQureshi:
// Islam, Sadiq & Qureshi (2008 + revisited 2013) algorithm
for DeltaT (6 polynomials)
ndot = -26.0; // n.dot = -26.0 "/cy/cy
DeltaT = StelUtils::getDeltaTByIslamSadiqQureshi(jDay);
break;
case Custom: case Custom:
// User defined coefficients for quadratic equation for Delt aT // User defined coefficients for quadratic equation for Delt aT
ndot = getCustomNDot(); // n.dot = custom value "/cy/cy ndot = getCustomNDot(); // n.dot = custom value "/cy/cy
int year, month, day; int year, month, day;
Vec3f coeff = getCustomEquationCoefficients(); Vec3f coeff = getCustomEquationCoefficients();
StelUtils::getDateFromJulianDay(jDay, &year, &month, &day); StelUtils::getDateFromJulianDay(jDay, &year, &month, &day);
double yeardec=year+((month-1)*30.5+day/31*30.5)/366; double yeardec=year+((month-1)*30.5+day/31*30.5)/366;
double u = (yeardec-getCustomYear())/100; double u = (yeardec-getCustomYear())/100;
DeltaT = coeff[0] + coeff[1]*u + coeff[2]*std::pow(u,2); DeltaT = coeff[0] + coeff[1]*u + coeff[2]*std::pow(u,2);
break; break;
skipping to change at line 1494 skipping to change at line 1510
break; break;
case MorrisonStephenson2004: // PRIMARY SOURCE case MorrisonStephenson2004: // PRIMARY SOURCE
description = q_("This important solution was published 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) with adde ndum in (%3).").arg(QChar(0x0394)).arg("<a href='http://adsabs.harvard.edu/ abs/2004JHA....35..327M'>2004</a>").arg("<a href='http://adsabs.harvard.edu /abs/2005JHA....36..339M'>2005</a>").append(getCurrentDeltaTAlgorithmValidR ange(jd, &marker)); description = q_("This important solution was published 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) with adde ndum in (%3).").arg(QChar(0x0394)).arg("<a href='http://adsabs.harvard.edu/ abs/2004JHA....35..327M'>2004</a>").arg("<a href='http://adsabs.harvard.edu /abs/2005JHA....36..339M'>2005</a>").append(getCurrentDeltaTAlgorithmValidR ange(jd, &marker));
break; break;
case Reijs: case Reijs:
description = q_("From the Length of Day (LOD; as determined by Stephenson & Morrison (%2)), Victor Reijs derived a %1T formula by usin g a Simplex optimisation with a cosine and square function. This is based o n a possible periodicy described by Stephenson (%2). See for more info %3he re%4.").arg(QChar(0x0394)).arg("<a href='http://adsabs.harvard.edu/abs/2004 JHA....35..327M'>2004</a>").arg("<a href='http://www.iol.ie/~geniet/eng/Del taTeval.htm'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); description = q_("From the Length of Day (LOD; as determined by Stephenson & Morrison (%2)), Victor Reijs derived a %1T formula by usin g a Simplex optimisation with a cosine and square function. This is based o n a possible periodicy described by Stephenson (%2). See for more info %3he re%4.").arg(QChar(0x0394)).arg("<a href='http://adsabs.harvard.edu/abs/2004 JHA....35..327M'>2004</a>").arg("<a href='http://www.iol.ie/~geniet/eng/Del taTeval.htm'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRange(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 tabulate d values for 1600-2000, is used for the %1NASA Eclipse Web Site%2 and in th eir <em>Five Millennium Canon of Solar Eclipses: -1900 to +3000</em> (2006) . This formula is also used in the solar, lunar and planetary ephemeris pro gram SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.gov/eclipse.html'>").a rg("</a>").append(getCurrentDeltaTAlgorithmValidRange(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 tabulate d values for 1600-2000, is used for the %1NASA Eclipse Web Site%2 and in th eir <em>Five Millennium Canon of Solar Eclipses: -1900 to +3000</em> (2006) . This formula is also used in the solar, lunar and planetary ephemeris pro gram SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.gov/eclipse.html'>").a rg("</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)).append( " <em>").append(q_("Used by default.")).append("</em>");
break; break;
case Banjevic:
description = q_("This solution by B. Banjevic, based on Ste
phenson & Morrison (1984), was published in article <em>Ancient eclipses an
d dating the fall of Babylon</em> (%1).").arg("<a href='http://adsabs.harva
rd.edu/abs/2006POBeo..80..251B'>2006</a>").append(getCurrentDeltaTAlgorithm
ValidRange(jd, &marker));
break;
case IslamSadiqQureshi:
description = q_("This solution by S. Islam, M. Sadiq and M.
S. Qureshi, based on Meeus & Simons (2000), was published in article <em>E
rror Minimization of Polynomial Approximation of DeltaT</em> (%1) and revis
ited by Sana Islam in 2013.").arg("<a href='http://www.ias.ac.in/jaa/dec200
8/JAA610.pdf'>2008</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &ma
rker));
break;
case Custom: case Custom:
description = q_("This is a quadratic formula for calculatio n of %1T with coefficients defined by the user.").arg(QChar(0x0394)); description = q_("This is a quadratic formula for calculatio n of %1T with coefficients defined by the user.").arg(QChar(0x0394));
break; break;
default: default:
description = q_("Error"); description = q_("Error");
} }
return description; return description;
} }
QString StelCore::getCurrentDeltaTAlgorithmValidRange(double jDay, QString *marker) const QString StelCore::getCurrentDeltaTAlgorithmValidRange(double jDay, QString *marker) const
skipping to change at line 1576 skipping to change at line 1598
case Borkowski: case Borkowski:
start = -2136; start = -2136;
finish = 1715; finish = 1715;
break; break;
case SchmadelZech1988: case SchmadelZech1988:
start = 1800; start = 1800;
finish = 1988; finish = 1988;
validRangeAppendix = q_("with a mean error of less than one second, max. error 1.9s, and meaningless values outside this range"); validRangeAppendix = q_("with a mean error of less than one second, max. error 1.9s, and meaningless values outside this range");
break; break;
case ChaprontTouze: case ChaprontTouze:
// FIXME: This is valid range? // FIXME: It's valid range?
start = -4000; start = -4000;
finish = 8000; finish = 8000;
break; break;
case StephensonMorrison1995: case StephensonMorrison1995:
start = -700; start = -700;
finish = 1600; finish = 1600;
break; break;
case Stephenson1997: case Stephenson1997:
start = -500; start = -500;
finish = 1600; finish = 1600;
break; break;
case ChaprontMeeus: case ChaprontMeeus:
start = -400; // 1800; // not explicitly given, but guess based on his using ChaprontFrancou which is cited elsewhere in a similar te rm with -391. start = -400; // 1800; // not explicitly given, but guess based on his using ChaprontFrancou which is cited elsewhere in a similar te rm with -391.
finish = 2150; // 1997; finish = 2150; // 1997;
//validRangeAppendix = q_("with a maximum error of 2.3 secon
ds"); // Wrong: This is only for the unused expression on p. 80!
//validRangeAppendix = q_("(estimated)");
break; break;
case JPLHorizons: case JPLHorizons:
start = -2999; start = -2999;
finish = 1620; finish = 1620;
validRangeAppendix = q_("with zero values outside this range "); validRangeAppendix = q_("with zero values outside this range ");
break; break;
case MeeusSimons: case MeeusSimons:
start = 1620; start = 1620;
finish = 2000; finish = 2000;
validRangeAppendix = q_("with zero values outside this range "); validRangeAppendix = q_("with zero values outside this range ");
skipping to change at line 1626 skipping to change at line 1646
finish = 2000; finish = 2000;
break; break;
case Reijs: case Reijs:
start = -1500; // -500; // GZ: It models long-term variabi lity, so we should reflect this. Not sure on the begin, though. start = -1500; // -500; // GZ: It models long-term variabi lity, so we should reflect this. Not sure on the begin, though.
finish = 1100; // not 1620; // GZ: Not applicable for teles copic era, and better not after 1100 (pers.comm.) finish = 1100; // not 1620; // GZ: Not applicable for teles copic era, and better not after 1100 (pers.comm.)
break; break;
case EspenakMeeus: // the default, range stated in the Canon, p. 14. case EspenakMeeus: // the default, range stated in the Canon, p. 14.
start = -1999; start = -1999;
finish = 3000; finish = 3000;
break; break;
case Banjevic:
start = -2020;
finish = 1620;
validRangeAppendix = q_("with zero values outside this range
");
break;
case IslamSadiqQureshi:
start = 1620;
finish = 2007;
validRangeAppendix = q_("with zero values outside this range
");
break;
case Custom: case Custom:
// Valid range unknown // Valid range unknown
break; break;
} }
if (start!=finish) if (start!=finish)
{ {
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(start).arg(finish).arg(validRangeAppendix);
else else
validRange = q_("Valid range of usage: between years %1 and %2.").arg(start).arg(finish); validRange = q_("Valid range of usage: between years %1 and %2.").arg(start).arg(finish);
if (start > year or year > finish) if (start > year || year > finish)
*marker = "*"; *marker = "*";
} }
else else
*marker = "?"; *marker = "?";
return QString(" %1").arg(validRange); return QString(" %1").arg(validRange);
} }
 End of changes. 14 change blocks. 
12 lines changed or deleted 53 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/