Merge lp:~stellarium/stellarium/fix-DeltaT into lp:stellarium
- fix-DeltaT
- Merge into trunk
Proposed by
gzotti
Status: | Merged |
---|---|
Approved by: | Alexander Wolf |
Approved revision: | 7754 |
Merged at revision: | 7760 |
Proposed branch: | lp:~stellarium/stellarium/fix-DeltaT |
Merge into: | lp:stellarium |
Diff against target: |
3522 lines (+693/-585) 59 files modified
plugins/AngleMeasure/src/AngleMeasure.hpp (+5/-3) plugins/ArchaeoLines/src/ArchaeoLines.cpp (+11/-5) plugins/ArchaeoLines/src/ArchaeoLines.hpp (+1/-1) plugins/EquationOfTime/src/EquationOfTime.cpp (+12/-10) plugins/EquationOfTime/src/EquationOfTime.hpp (+2/-2) plugins/Exoplanets/src/Exoplanet.cpp (+1/-1) plugins/MeteorShowers/src/MeteorShower.cpp (+3/-3) plugins/MeteorShowers/src/MeteorShowers.cpp (+4/-3) plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp (+2/-1) plugins/Novae/src/Nova.cpp (+1/-1) plugins/Novae/src/Nova.hpp (+5/-0) plugins/Observability/src/Observability.cpp (+121/-99) plugins/Observability/src/Observability.hpp (+25/-18) plugins/PointerCoordinates/src/PointerCoordinates.cpp (+2/-2) plugins/Satellites/src/Satellite.cpp (+2/-3) plugins/Satellites/src/Satellites.cpp (+1/-1) plugins/Satellites/src/gSatWrapper.cpp (+1/-1) plugins/Satellites/src/gsatellite/gVector.cpp (+1/-1) plugins/Satellites/src/gsatellite/gVector.hpp (+3/-2) plugins/Scenery3d/src/Scenery3d.cpp (+3/-3) plugins/Supernovae/src/Supernova.cpp (+1/-1) plugins/TelescopeControl/src/clients/TelescopeClient.cpp (+4/-2) plugins/TelescopeControl/src/servers/Socket.cpp (+4/-2) plugins/TextUserInterface/src/TextUserInterface.cpp (+3/-3) src/core/StelCore.cpp (+147/-111) src/core/StelCore.hpp (+54/-26) src/core/StelMovementMgr.cpp (+3/-3) src/core/StelMovementMgr.hpp (+1/-1) src/core/StelObject.cpp (+5/-12) src/core/StelObserver.cpp (+6/-12) src/core/StelObserver.hpp (+4/-1) src/core/StelUtils.hpp (+1/-1) src/core/TrailGroup.cpp (+3/-3) src/core/modules/Atmosphere.cpp (+1/-1) src/core/modules/Comet.cpp (+12/-12) src/core/modules/Comet.hpp (+2/-6) src/core/modules/Constellation.cpp (+1/-1) src/core/modules/LandscapeMgr.cpp (+2/-1) src/core/modules/MinorPlanet.cpp (+3/-3) src/core/modules/Orbit.cpp (+17/-26) src/core/modules/Orbit.hpp (+7/-7) src/core/modules/Planet.cpp (+61/-58) src/core/modules/Planet.hpp (+17/-15) src/core/modules/SolarSystem.cpp (+10/-8) src/core/modules/SolarSystem.hpp (+3/-3) src/core/modules/StarWrapper.cpp (+1/-1) src/core/modules/StarWrapper.hpp (+1/-1) src/core/modules/ZodiacalLight.cpp (+1/-1) src/core/modules/ZoneArray.cpp (+2/-2) src/core/planetsephems/sidereal_time.c (+10/-10) src/core/planetsephems/sidereal_time.h (+2/-2) src/gui/ConfigurationDialog.cpp (+4/-2) src/gui/DateTimeDialog.cpp (+16/-23) src/gui/SearchDialog.cpp (+1/-1) src/gui/StelGui.cpp (+1/-1) src/gui/StelGuiItems.cpp (+20/-22) src/gui/dateTimeDialogGui.ui (+3/-3) src/scripting/StelMainScriptAPI.cpp (+37/-26) src/scripting/StelMainScriptAPI.hpp (+16/-11) |
To merge this branch: | bzr merge lp:~stellarium/stellarium/fix-DeltaT |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexander Wolf | Approve | ||
Review via email: mp+266675@code.launchpad.net |
Commit message
Description of the change
See branch description, also on tests. The branch untangles applications of DeltaT, it should be clear now what flavour of JD to use in which situation.
I have placed comments in many places which have changed. These will go away during merge when no longer needed. There are very few cases in the "object plugins" (Supernovae, pulsars, ...) where it is not clear to me which kind of JD (JD or JDE) was in the original catalog for discovery date. Most likely these cases are JDE (as was also in use via the previous getJDay() call).
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'plugins/AngleMeasure/src/AngleMeasure.hpp' | |||
2 | --- plugins/AngleMeasure/src/AngleMeasure.hpp 2015-05-31 09:35:00 +0000 | |||
3 | +++ plugins/AngleMeasure/src/AngleMeasure.hpp 2015-08-03 13:17:13 +0000 | |||
4 | @@ -34,8 +34,10 @@ | |||
5 | 34 | /*! @defgroup angleMeasure Angle Measure plug-in | 34 | /*! @defgroup angleMeasure Angle Measure plug-in |
6 | 35 | @{ | 35 | @{ |
7 | 36 | The Angle Measure plugin is a small tool which is used to measure | 36 | The Angle Measure plugin is a small tool which is used to measure |
10 | 37 | the angular distance between two points on the sky. *goes misty eyed* | 37 | the angular distance between two points on the sky. |
11 | 38 | I recall measuring the size of the Cassini Division when I was a student. | 38 | |
12 | 39 | *goes misty eyed* I recall measuring the size of the Cassini Division | ||
13 | 40 | when I was a student. | ||
14 | 39 | It was not the high academic glamor one might expect... It was cloudy... | 41 | It was not the high academic glamor one might expect... It was cloudy... |
15 | 40 | It was rainy... The observatory lab had some old scopes set up at one end, | 42 | It was rainy... The observatory lab had some old scopes set up at one end, |
16 | 41 | pointing at a photograph of Saturn at the other end of the lab. We measured. | 43 | pointing at a photograph of Saturn at the other end of the lab. We measured. |
17 | @@ -64,7 +66,7 @@ | |||
18 | 64 | //! Main class of the Angle Measure plug-in. | 66 | //! Main class of the Angle Measure plug-in. |
19 | 65 | //! @author Matthew Gates | 67 | //! @author Matthew Gates |
20 | 66 | //! @author Alexander Wolf | 68 | //! @author Alexander Wolf |
22 | 67 | //! @anchor Georg Zotti | 69 | //! @author Georg Zotti |
23 | 68 | class AngleMeasure : public StelModule | 70 | class AngleMeasure : public StelModule |
24 | 69 | { | 71 | { |
25 | 70 | Q_OBJECT | 72 | Q_OBJECT |
26 | 71 | 73 | ||
27 | === modified file 'plugins/ArchaeoLines/src/ArchaeoLines.cpp' | |||
28 | --- plugins/ArchaeoLines/src/ArchaeoLines.cpp 2015-05-16 10:23:09 +0000 | |||
29 | +++ plugins/ArchaeoLines/src/ArchaeoLines.cpp 2015-08-03 13:17:13 +0000 | |||
30 | @@ -79,7 +79,7 @@ | |||
31 | 79 | , flagShowCurrentSun(false) | 79 | , flagShowCurrentSun(false) |
32 | 80 | , flagShowCurrentMoon(false) | 80 | , flagShowCurrentMoon(false) |
33 | 81 | , enumShowCurrentPlanet(ArchaeoLine::CurrentPlanetNone) | 81 | , enumShowCurrentPlanet(ArchaeoLine::CurrentPlanetNone) |
35 | 82 | , lastJD(0.0) | 82 | , lastJDE(0.0) |
36 | 83 | , toolbarButton(NULL) | 83 | , toolbarButton(NULL) |
37 | 84 | { | 84 | { |
38 | 85 | setObjectName("ArchaeoLines"); | 85 | setObjectName("ArchaeoLines"); |
39 | @@ -212,6 +212,9 @@ | |||
40 | 212 | 212 | ||
41 | 213 | void ArchaeoLines::update(double deltaTime) | 213 | void ArchaeoLines::update(double deltaTime) |
42 | 214 | { | 214 | { |
43 | 215 | if (core->getCurrentPlanet()->getEnglishName()!="Earth") | ||
44 | 216 | return; | ||
45 | 217 | |||
46 | 215 | static SolarSystem *ssystem=GETSTELMODULE(SolarSystem); | 218 | static SolarSystem *ssystem=GETSTELMODULE(SolarSystem); |
47 | 216 | static const double lunarI=5.145396; // inclination of lunar orbit | 219 | static const double lunarI=5.145396; // inclination of lunar orbit |
48 | 217 | // compute min and max distance values for horizontal parallax. | 220 | // compute min and max distance values for horizontal parallax. |
49 | @@ -244,16 +247,16 @@ | |||
50 | 244 | currentPlanetLine->setDeclination(dec_equ * 180.0/M_PI); | 247 | currentPlanetLine->setDeclination(dec_equ * 180.0/M_PI); |
51 | 245 | } | 248 | } |
52 | 246 | 249 | ||
55 | 247 | double newJD=core->getJDay(); | 250 | double newJDE=core->getJDE(); |
56 | 248 | if (fabs(newJD-lastJD) > 10.0) // enough to compute this every 10 days? | 251 | if (fabs(newJDE-lastJDE) > 10.0) // enough to compute this every 10 days? |
57 | 249 | { | 252 | { |
59 | 250 | eps= ssystem->getEarth()->getRotObliquity(core->getJDay()) *180.0/M_PI; | 253 | eps= ssystem->getEarth()->getRotObliquity(newJDE) *180.0/M_PI; |
60 | 251 | static const double invSqrt2=1.0/std::sqrt(2.0); | 254 | static const double invSqrt2=1.0/std::sqrt(2.0); |
61 | 252 | northernSolsticeLine->setDeclination( eps); | 255 | northernSolsticeLine->setDeclination( eps); |
62 | 253 | southernSolsticeLine->setDeclination(-eps); | 256 | southernSolsticeLine->setDeclination(-eps); |
63 | 254 | northernCrossquarterLine->setDeclination( eps*invSqrt2); | 257 | northernCrossquarterLine->setDeclination( eps*invSqrt2); |
64 | 255 | southernCrossquarterLine->setDeclination(-eps*invSqrt2); | 258 | southernCrossquarterLine->setDeclination(-eps*invSqrt2); |
66 | 256 | lastJD=newJD; | 259 | lastJDE=newJDE; |
67 | 257 | } | 260 | } |
68 | 258 | StelLocation loc=core->getCurrentLocation(); | 261 | StelLocation loc=core->getCurrentLocation(); |
69 | 259 | 262 | ||
70 | @@ -347,6 +350,9 @@ | |||
71 | 347 | //! Draw any parts on the screen which are for our module | 350 | //! Draw any parts on the screen which are for our module |
72 | 348 | void ArchaeoLines::draw(StelCore* core) | 351 | void ArchaeoLines::draw(StelCore* core) |
73 | 349 | { | 352 | { |
74 | 353 | if (core->getCurrentPlanet()->getEnglishName()!="Earth") | ||
75 | 354 | return; | ||
76 | 355 | |||
77 | 350 | equinoxLine->draw(core, lineFader.getInterstate()); | 356 | equinoxLine->draw(core, lineFader.getInterstate()); |
78 | 351 | northernSolsticeLine->draw(core, lineFader.getInterstate()); | 357 | northernSolsticeLine->draw(core, lineFader.getInterstate()); |
79 | 352 | southernSolsticeLine->draw(core, lineFader.getInterstate()); | 358 | southernSolsticeLine->draw(core, lineFader.getInterstate()); |
80 | 353 | 359 | ||
81 | === modified file 'plugins/ArchaeoLines/src/ArchaeoLines.hpp' | |||
82 | --- plugins/ArchaeoLines/src/ArchaeoLines.hpp 2015-05-30 19:56:47 +0000 | |||
83 | +++ plugins/ArchaeoLines/src/ArchaeoLines.hpp 2015-08-03 13:17:13 +0000 | |||
84 | @@ -272,7 +272,7 @@ | |||
85 | 272 | bool flagShowCurrentSun; | 272 | bool flagShowCurrentSun; |
86 | 273 | bool flagShowCurrentMoon; | 273 | bool flagShowCurrentMoon; |
87 | 274 | ArchaeoLine::Line enumShowCurrentPlanet; | 274 | ArchaeoLine::Line enumShowCurrentPlanet; |
89 | 275 | double lastJD; // cache last-time-computed to 1/month or so? | 275 | double lastJDE; // cache last-time-computed to every 10 days or so? |
90 | 276 | 276 | ||
91 | 277 | ArchaeoLine * equinoxLine; | 277 | ArchaeoLine * equinoxLine; |
92 | 278 | ArchaeoLine * northernSolsticeLine; | 278 | ArchaeoLine * northernSolsticeLine; |
93 | 279 | 279 | ||
94 | === modified file 'plugins/EquationOfTime/src/EquationOfTime.cpp' | |||
95 | --- plugins/EquationOfTime/src/EquationOfTime.cpp 2015-03-22 09:33:56 +0000 | |||
96 | +++ plugins/EquationOfTime/src/EquationOfTime.cpp 2015-08-03 13:17:13 +0000 | |||
97 | @@ -113,6 +113,8 @@ | |||
98 | 113 | { | 113 | { |
99 | 114 | if (!isEnabled()) | 114 | if (!isEnabled()) |
100 | 115 | return; | 115 | return; |
101 | 116 | if (core->getCurrentPlanet()->getEnglishName()!="Earth") | ||
102 | 117 | return; | ||
103 | 116 | 118 | ||
104 | 117 | StelPainter sPainter(core->getProjection2d()); | 119 | StelPainter sPainter(core->getProjection2d()); |
105 | 118 | sPainter.setColor(textColor[0], textColor[1], textColor[2], 1.f); | 120 | sPainter.setColor(textColor[0], textColor[1], textColor[2], 1.f); |
106 | @@ -120,26 +122,26 @@ | |||
107 | 120 | sPainter.setFont(font); | 122 | sPainter.setFont(font); |
108 | 121 | 123 | ||
109 | 122 | QString timeText; | 124 | QString timeText; |
111 | 123 | double time = getSolutionEquationOfTime(core->getJDay()); | 125 | double eqTime = getSolutionEquationOfTime(core->getJDE()); |
112 | 124 | 126 | ||
113 | 125 | if (getFlagInvertedValue()) | 127 | if (getFlagInvertedValue()) |
115 | 126 | time *= -1; | 128 | eqTime *= -1; |
116 | 127 | 129 | ||
117 | 128 | if (getFlagMsFormat()) | 130 | if (getFlagMsFormat()) |
118 | 129 | { | 131 | { |
120 | 130 | int seconds = qRound((time - (int)time)*60); | 132 | int seconds = qRound((eqTime - (int)eqTime)*60); |
121 | 131 | QString messageSecondsValue = QString("%1").arg(qAbs(seconds), 2, 10, QLatin1Char('0')); | 133 | QString messageSecondsValue = QString("%1").arg(qAbs(seconds), 2, 10, QLatin1Char('0')); |
122 | 132 | 134 | ||
124 | 133 | timeText = QString("%1: %2%3%4%5%6").arg(messageEquation, (time<0? QString(QLatin1Char('-')):QString()), QString::number((int)qAbs(time)), messageEquationMinutes, messageSecondsValue, messageEquationSeconds); | 135 | timeText = QString("%1: %2%3%4%5%6").arg(messageEquation, (eqTime<0? QString(QLatin1Char('-')):QString()), QString::number((int)qAbs(eqTime)), messageEquationMinutes, messageSecondsValue, messageEquationSeconds); |
125 | 134 | } | 136 | } |
126 | 135 | else | 137 | else |
128 | 136 | timeText = QString("%1: %2%3").arg(messageEquation, QString::number(time, 'f', 2), messageEquationMinutes); | 138 | timeText = QString("%1: %2%3").arg(messageEquation, QString::number(eqTime, 'f', 2), messageEquationMinutes); |
129 | 137 | 139 | ||
130 | 138 | 140 | ||
131 | 139 | QFontMetrics fm(font); | 141 | QFontMetrics fm(font); |
132 | 140 | QSize fs = fm.size(Qt::TextSingleLine, timeText); | 142 | QSize fs = fm.size(Qt::TextSingleLine, timeText); |
135 | 141 | if (core->getCurrentPlanet().data()->getEnglishName()=="Earth") | 143 | |
136 | 142 | sPainter.drawText(gui->getSkyGui()->getSkyGuiWidth()/2 - fs.width()/2, gui->getSkyGui()->getSkyGuiHeight() - fs.height()*1.5, timeText); | 144 | sPainter.drawText(gui->getSkyGui()->getSkyGuiWidth()/2 - fs.width()/2, gui->getSkyGui()->getSkyGuiHeight() - fs.height()*1.5, timeText); |
137 | 143 | 145 | ||
138 | 144 | //qDebug() << timeText; | 146 | //qDebug() << timeText; |
139 | 145 | } | 147 | } |
140 | @@ -212,11 +214,11 @@ | |||
141 | 212 | conf->endGroup(); | 214 | conf->endGroup(); |
142 | 213 | } | 215 | } |
143 | 214 | 216 | ||
145 | 215 | double EquationOfTime::getSolutionEquationOfTime(const double JDay) const | 217 | double EquationOfTime::getSolutionEquationOfTime(const double JDE) const |
146 | 216 | { | 218 | { |
147 | 217 | StelCore* core = StelApp::getInstance().getCore(); | 219 | StelCore* core = StelApp::getInstance().getCore(); |
148 | 218 | 220 | ||
150 | 219 | double tau = (JDay - 2451545.0)/365250.0; | 221 | double tau = (JDE - 2451545.0)/365250.0; |
151 | 220 | double sunMeanLongitude = 280.4664567 + tau*(360007.6892779 + tau*(0.03032028 + tau*(1./49931. - tau*(1./15300. - tau/2000000.)))); | 222 | double sunMeanLongitude = 280.4664567 + tau*(360007.6892779 + tau*(0.03032028 + tau*(1./49931. - tau*(1./15300. - tau/2000000.)))); |
152 | 221 | 223 | ||
153 | 222 | // reduce the angle | 224 | // reduce the angle |
154 | @@ -233,7 +235,7 @@ | |||
155 | 233 | // force it to be the positive remainder, so that 0 <= angle < 360 | 235 | // force it to be the positive remainder, so that 0 <= angle < 360 |
156 | 234 | alpha = std::fmod(alpha + 360., 360.); | 236 | alpha = std::fmod(alpha + 360., 360.); |
157 | 235 | 237 | ||
159 | 236 | double equation = 4*(sunMeanLongitude - 0.0057183 - alpha + get_nutation_longitude(JDay)*cos(get_mean_ecliptical_obliquity(JDay))); | 238 | double equation = 4*(sunMeanLongitude - 0.0057183 - alpha + get_nutation_longitude(JDE)*cos(get_mean_ecliptical_obliquity(JDE))); |
160 | 237 | // The equation of time is always smaller 20 minutes in absolute value | 239 | // The equation of time is always smaller 20 minutes in absolute value |
161 | 238 | if (qAbs(equation)>20) | 240 | if (qAbs(equation)>20) |
162 | 239 | { | 241 | { |
163 | 240 | 242 | ||
164 | === modified file 'plugins/EquationOfTime/src/EquationOfTime.hpp' | |||
165 | --- plugins/EquationOfTime/src/EquationOfTime.hpp 2015-05-31 09:35:00 +0000 | |||
166 | +++ plugins/EquationOfTime/src/EquationOfTime.hpp 2015-08-03 13:17:13 +0000 | |||
167 | @@ -87,9 +87,9 @@ | |||
168 | 87 | 87 | ||
169 | 88 | //! Get solution of equation of time | 88 | //! Get solution of equation of time |
170 | 89 | //! Source: J. Meeus "Astronomical Algorithms" (2nd ed., with corrections as of August 10, 2009) p.183-187. | 89 | //! Source: J. Meeus "Astronomical Algorithms" (2nd ed., with corrections as of August 10, 2009) p.183-187. |
172 | 90 | //! @param JDay JD | 90 | //! @param JDE JD in Dynamical Time (previously called Ephemeris Time) |
173 | 91 | //! @return time in minutes | 91 | //! @return time in minutes |
175 | 92 | double getSolutionEquationOfTime(const double JDay) const; | 92 | double getSolutionEquationOfTime(const double JDE) const; |
176 | 93 | 93 | ||
177 | 94 | //! Is plugin enabled? | 94 | //! Is plugin enabled? |
178 | 95 | bool isEnabled() const | 95 | bool isEnabled() const |
179 | 96 | 96 | ||
180 | === modified file 'plugins/Exoplanets/src/Exoplanet.cpp' | |||
181 | --- plugins/Exoplanets/src/Exoplanet.cpp 2015-01-16 19:33:33 +0000 | |||
182 | +++ plugins/Exoplanets/src/Exoplanet.cpp 2015-08-03 13:17:13 +0000 | |||
183 | @@ -417,7 +417,7 @@ | |||
184 | 417 | QList<int> discovery; | 417 | QList<int> discovery; |
185 | 418 | // For getting value of new year from midnight at 1 Jan we need increase a value of JD on 0.5. | 418 | // For getting value of new year from midnight at 1 Jan we need increase a value of JD on 0.5. |
186 | 419 | // This hack need for correct display of discovery mode of exoplanets. | 419 | // This hack need for correct display of discovery mode of exoplanets. |
188 | 420 | StelUtils::getDateFromJulianDay(core->getJDay()+0.5, &year, &month, &day); | 420 | StelUtils::getDateFromJulianDay(core->getJD()+0.5, &year, &month, &day); |
189 | 421 | discovery.clear(); | 421 | discovery.clear(); |
190 | 422 | foreach(const exoplanetData &p, exoplanets) | 422 | foreach(const exoplanetData &p, exoplanets) |
191 | 423 | { | 423 | { |
192 | 424 | 424 | ||
193 | === modified file 'plugins/MeteorShowers/src/MeteorShower.cpp' | |||
194 | --- plugins/MeteorShowers/src/MeteorShower.cpp 2015-04-22 01:04:29 +0000 | |||
195 | +++ plugins/MeteorShowers/src/MeteorShower.cpp 2015-08-03 13:17:13 +0000 | |||
196 | @@ -206,9 +206,9 @@ | |||
197 | 206 | QDateTime MeteorShower::getSkyQDateTime() const | 206 | QDateTime MeteorShower::getSkyQDateTime() const |
198 | 207 | { | 207 | { |
199 | 208 | StelCore* core = StelApp::getInstance().getCore(); | 208 | StelCore* core = StelApp::getInstance().getCore(); |
203 | 209 | //get the current sky date | 209 | //get the current sky date (zone time) |
204 | 210 | double JD = core->getJDay(); | 210 | double JD = core->getJD(); |
205 | 211 | return StelUtils::jdToQDateTime(JD+StelUtils::getGMTShiftFromQT(JD)/24-core->getDeltaT(JD)/86400); | 211 | return StelUtils::jdToQDateTime(JD+ StelUtils::getGMTShiftFromQT(JD)/24); |
206 | 212 | } | 212 | } |
207 | 213 | 213 | ||
208 | 214 | void MeteorShower::updateCurrentData(QDateTime skyDate) | 214 | void MeteorShower::updateCurrentData(QDateTime skyDate) |
209 | 215 | 215 | ||
210 | === modified file 'plugins/MeteorShowers/src/MeteorShowers.cpp' | |||
211 | --- plugins/MeteorShowers/src/MeteorShowers.cpp 2015-04-11 13:25:02 +0000 | |||
212 | +++ plugins/MeteorShowers/src/MeteorShowers.cpp 2015-08-03 13:17:13 +0000 | |||
213 | @@ -215,7 +215,8 @@ | |||
214 | 215 | updateTimer->start(); | 215 | updateTimer->start(); |
215 | 216 | 216 | ||
216 | 217 | // skyDate startup | 217 | // skyDate startup |
218 | 218 | skyDate = StelUtils::jdToQDateTime(StelApp::getInstance().getCore()->getJDay()); | 218 | // GZ JDfix for 0.14 I am not sure how skyDate is used. It used to be set to JDE, so again: |
219 | 219 | skyDate = StelUtils::jdToQDateTime(StelApp::getInstance().getCore()->getJDE()); | ||
220 | 219 | 220 | ||
221 | 220 | GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this); | 221 | GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this); |
222 | 221 | } | 222 | } |
223 | @@ -273,8 +274,8 @@ | |||
224 | 273 | 274 | ||
225 | 274 | bool MeteorShowers::changedSkyDate(StelCore* core) | 275 | bool MeteorShowers::changedSkyDate(StelCore* core) |
226 | 275 | { | 276 | { |
229 | 276 | double JD = core->getJDay(); | 277 | double JD = core->getJD(); |
230 | 277 | skyDate = StelUtils::jdToQDateTime(JD+StelUtils::getGMTShiftFromQT(JD)/24-core->getDeltaT(JD)/86400); | 278 | skyDate = StelUtils::jdToQDateTime(JD+StelUtils::getGMTShiftFromQT(JD)/24); |
231 | 278 | if (skyDate.toString("MM.dd.yyyy") != lastSkyDate.toString("MM.dd.yyyy")) //if the sky date changed | 279 | if (skyDate.toString("MM.dd.yyyy") != lastSkyDate.toString("MM.dd.yyyy")) //if the sky date changed |
232 | 279 | { | 280 | { |
233 | 280 | return true; | 281 | return true; |
234 | 281 | 282 | ||
235 | === modified file 'plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp' | |||
236 | --- plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp 2015-07-29 18:56:52 +0000 | |||
237 | +++ plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp 2015-08-03 13:17:13 +0000 | |||
238 | @@ -237,7 +237,8 @@ | |||
239 | 237 | //Change date | 237 | //Change date |
240 | 238 | QString dateString = treeWidget->currentItem()->text(ColumnPeak); | 238 | QString dateString = treeWidget->currentItem()->text(ColumnPeak); |
241 | 239 | QDateTime qDateTime = QDateTime::fromString(dateString, "dd/MMM/yyyy"); | 239 | QDateTime qDateTime = QDateTime::fromString(dateString, "dd/MMM/yyyy"); |
243 | 240 | core->setJDay(StelUtils::qDateTimeToJd(qDateTime)); | 240 | // GZ JDfix for V0.14 this used to set JDE, so again. If IMO ephemerides are JD(UT), please change. |
244 | 241 | core->setJDE(StelUtils::qDateTimeToJd(qDateTime)); | ||
245 | 241 | 242 | ||
246 | 242 | //Select object | 243 | //Select object |
247 | 243 | QString namel18n = treeWidget->currentItem()->text(ColumnName); | 244 | QString namel18n = treeWidget->currentItem()->text(ColumnName); |
248 | 244 | 245 | ||
249 | === modified file 'plugins/Novae/src/Nova.cpp' | |||
250 | --- plugins/Novae/src/Nova.cpp 2015-02-08 15:35:27 +0000 | |||
251 | +++ plugins/Novae/src/Nova.cpp 2015-08-03 13:17:13 +0000 | |||
252 | @@ -167,7 +167,7 @@ | |||
253 | 167 | { | 167 | { |
254 | 168 | // OK, start from minimal brightness | 168 | // OK, start from minimal brightness |
255 | 169 | double vmag = minMagnitude; | 169 | double vmag = minMagnitude; |
257 | 170 | double currentJD = core->getJDay(); | 170 | double currentJD = core->getJDE(); |
258 | 171 | double deltaJD = qAbs(peakJD-currentJD); | 171 | double deltaJD = qAbs(peakJD-currentJD); |
259 | 172 | 172 | ||
260 | 173 | // Fill "default" values for mX | 173 | // Fill "default" values for mX |
261 | 174 | 174 | ||
262 | === modified file 'plugins/Novae/src/Nova.hpp' | |||
263 | --- plugins/Novae/src/Nova.hpp 2015-05-30 19:56:47 +0000 | |||
264 | +++ plugins/Novae/src/Nova.hpp 2015-08-03 13:17:13 +0000 | |||
265 | @@ -37,6 +37,11 @@ | |||
266 | 37 | //! Details about the novae are passed using a QVariant which contains | 37 | //! Details about the novae are passed using a QVariant which contains |
267 | 38 | //! a map of data from the json file. | 38 | //! a map of data from the json file. |
268 | 39 | //! @ingroup brightNovae | 39 | //! @ingroup brightNovae |
269 | 40 | // | ||
270 | 41 | // GZ NOTE from JDfix for V0.14: | ||
271 | 42 | // TODO: I don't know whether the peak times given are UT or DT times. | ||
272 | 43 | // If DT, please change relevant calls from core->getJD() to getJDE() etc | ||
273 | 44 | // and rename variables to include JDE for clarity. | ||
274 | 40 | 45 | ||
275 | 41 | class Nova : public StelObject | 46 | class Nova : public StelObject |
276 | 42 | { | 47 | { |
277 | 43 | 48 | ||
278 | === modified file 'plugins/Observability/src/Observability.cpp' | |||
279 | --- plugins/Observability/src/Observability.cpp 2014-11-26 18:14:09 +0000 | |||
280 | +++ plugins/Observability/src/Observability.cpp 2015-08-03 13:17:13 +0000 | |||
281 | @@ -72,6 +72,17 @@ | |||
282 | 72 | return info; | 72 | return info; |
283 | 73 | } | 73 | } |
284 | 74 | 74 | ||
285 | 75 | // TODO: Migrate to static const? --BM ==> GZ during JDfix for 0.14: SURE! | ||
286 | 76 | // Some useful constants: | ||
287 | 77 | const double Observability::Rad2Deg = 180./M_PI; // Convert degrees into radians | ||
288 | 78 | const double Observability::Rad2Hr = 12./M_PI; // Convert hours into radians | ||
289 | 79 | const double Observability::UA = AU; // 1.4958e+8; // Astronomical Unit in Km. ==> HAS BEEN DEFINED IN StelUtils.hpp! | ||
290 | 80 | const double Observability::TFrac = 0.9972677595628414; // Convert sidereal time into Solar time | ||
291 | 81 | const double Observability::JDsec = 1./86400.; // A second in days. ==> TODO USE StelCore::JD_SECOND instead | ||
292 | 82 | const double Observability::halfpi = M_PI * 0.5; // 1.57079632675; // pi/2 | ||
293 | 83 | const double Observability::MoonT = 29.530588; // Moon synodic period (used as first estimate of Full Moon). ==> FIND MORE DEC. PLACES! | ||
294 | 84 | const double Observability::RefFullMoon = 2451564.696; // Reference Julian date of a Full Moon. | ||
295 | 85 | const double Observability::MoonPerilune = 0.0024236308; // Smallest Earth-Moon distance (in AU). | ||
296 | 75 | 86 | ||
297 | 76 | 87 | ||
298 | 77 | Observability::Observability() | 88 | Observability::Observability() |
299 | @@ -110,17 +121,6 @@ | |||
300 | 110 | setObjectName("Observability"); | 121 | setObjectName("Observability"); |
301 | 111 | configDialog = new ObservabilityDialog(); | 122 | configDialog = new ObservabilityDialog(); |
302 | 112 | 123 | ||
303 | 113 | // TODO: Migrate to static const? --BM | ||
304 | 114 | // Some useful constants: | ||
305 | 115 | Rad2Deg = 180./3.1415927; // Convert degrees into radians | ||
306 | 116 | Rad2Hr = 12./3.1415927; // Convert hours into radians | ||
307 | 117 | UA = 1.4958e+8; // Astronomical Unit in Km. | ||
308 | 118 | TFrac = 0.9972677595628414; // Convert sidereal time into Solar time | ||
309 | 119 | JDsec = 1./86400.; // A second in days. | ||
310 | 120 | halfpi = 1.57079632675; // pi/2 | ||
311 | 121 | MoonT = 29.530588; // Moon synodic period (used as first estimate of Full Moon). | ||
312 | 122 | RefFullMoon = 2451564.696; // Reference Julian date of a Full Moon. | ||
313 | 123 | MoonPerilune = 0.0024236308; // Smallest Earth-Moon distance (in AU). | ||
314 | 124 | 124 | ||
315 | 125 | nextFullMoon = 0.0; | 125 | nextFullMoon = 0.0; |
316 | 126 | prevFullMoon = 0.0; | 126 | prevFullMoon = 0.0; |
317 | @@ -129,7 +129,8 @@ | |||
318 | 129 | 129 | ||
319 | 130 | // Dummy initial values for parameters and data vectors: | 130 | // Dummy initial values for parameters and data vectors: |
320 | 131 | mylat = 1000.; mylon = 1000.; | 131 | mylat = 1000.; mylon = 1000.; |
322 | 132 | myJD = 0.0; | 132 | myJD.first = 0.0; |
323 | 133 | myJD.second = 0.0; | ||
324 | 133 | curYear = 0; | 134 | curYear = 0; |
325 | 134 | isStar = true; | 135 | isStar = true; |
326 | 135 | isMoon = false; | 136 | isMoon = false; |
327 | @@ -146,13 +147,21 @@ | |||
328 | 146 | 147 | ||
329 | 147 | // I think this can be done in a more simple way...--BM | 148 | // I think this can be done in a more simple way...--BM |
330 | 148 | for (int i=0;i<366;i++) { | 149 | for (int i=0;i<366;i++) { |
337 | 149 | sunRA[i] = 0.0; sunDec[i] = 0.0; | 150 | // sunRA[i] = 0.0; sunDec[i] = 0.0; |
338 | 150 | objectRA[i] = 0.0; objectDec[i]=0.0; | 151 | // objectRA[i] = 0.0; objectDec[i]=0.0; |
339 | 151 | sunSidT[0][i]=0.0; sunSidT[1][i]=0.0; | 152 | // sunSidT[0][i]=0.0; sunSidT[1][i]=0.0; |
340 | 152 | objectSidT[0][i]=0.0; objectSidT[1][i]=0.0; | 153 | // objectSidT[0][i]=0.0; objectSidT[1][i]=0.0; |
341 | 153 | objectH0[i] = 0.0; | 154 | // objectH0[i] = 0.0; |
342 | 154 | yearJD[i] = 0.0; | 155 | yearJD[i]=QPair<double, double>(0.0, 0.0); |
343 | 155 | }; | 156 | }; |
344 | 157 | // GZ Sure: | ||
345 | 158 | memset(sunRA, 0, 366*sizeof(double)); | ||
346 | 159 | memset(sunDec, 0, 366*sizeof(double)); | ||
347 | 160 | memset(objectRA, 0, 366*sizeof(double)); | ||
348 | 161 | memset(objectDec, 0, 366*sizeof(double)); | ||
349 | 162 | memset(sunSidT, 0, 2*366*sizeof(double)); | ||
350 | 163 | memset(objectSidT, 0, 2*366*sizeof(double)); | ||
351 | 164 | memset(objectH0, 0, 366*sizeof(double)); | ||
352 | 156 | 165 | ||
353 | 157 | } | 166 | } |
354 | 158 | 167 | ||
355 | @@ -281,7 +290,7 @@ | |||
356 | 281 | double currlat = (core->getCurrentLocation().latitude)/Rad2Deg; | 290 | double currlat = (core->getCurrentLocation().latitude)/Rad2Deg; |
357 | 282 | double currlon = (core->getCurrentLocation().longitude)/Rad2Deg; | 291 | double currlon = (core->getCurrentLocation().longitude)/Rad2Deg; |
358 | 283 | double currheight = (6371.+(core->getCurrentLocation().altitude)/1000.)/UA; | 292 | double currheight = (6371.+(core->getCurrentLocation().altitude)/1000.)/UA; |
360 | 284 | double currJD = core->getJDay(); | 293 | double currJD = core->getJD(); |
361 | 285 | double currJDint; | 294 | double currJDint; |
362 | 286 | // GMTShift = StelUtils::getGMTShiftFromQT(currJD)/24.0; | 295 | // GMTShift = StelUtils::getGMTShiftFromQT(currJD)/24.0; |
363 | 287 | GMTShift = StelApp::getInstance().getLocaleMgr().getGMTShift(currJD)/24.0; | 296 | GMTShift = StelApp::getInstance().getLocaleMgr().getGMTShift(currJD)/24.0; |
364 | @@ -302,7 +311,7 @@ | |||
365 | 302 | // NOW WE CHECK THE CHANGED PARAMETERS W.R.T. THE PREVIOUS FRAME: | 311 | // NOW WE CHECK THE CHANGED PARAMETERS W.R.T. THE PREVIOUS FRAME: |
366 | 303 | 312 | ||
367 | 304 | // Update JD. | 313 | // Update JD. |
369 | 305 | myJD = currJD; | 314 | myJD.first = currJD; |
370 | 306 | 315 | ||
371 | 307 | // If the year changed, we must recompute the Sun's position for each new day: | 316 | // If the year changed, we must recompute the Sun's position for each new day: |
372 | 308 | if (auxy != curYear) | 317 | if (auxy != curYear) |
373 | @@ -494,12 +503,12 @@ | |||
374 | 494 | 503 | ||
375 | 495 | // Returns false if the calculation fails... | 504 | // Returns false if the calculation fails... |
376 | 496 | solvedMoon = calculateSolarSystemEvents(core, type); | 505 | solvedMoon = calculateSolarSystemEvents(core, type); |
379 | 497 | currH = qAbs(24.*(MoonCulm-myJD)/TFrac); | 506 | currH = qAbs(24.*(MoonCulm-myJD.first)/TFrac); |
380 | 498 | transit = MoonCulm-myJD<0.0; | 507 | transit = MoonCulm-myJD.first<0.0; |
381 | 499 | if (solvedMoon) | 508 | if (solvedMoon) |
382 | 500 | { // If failed, Set and Rise will be dummy. | 509 | { // If failed, Set and Rise will be dummy. |
385 | 501 | settingTime = qAbs(24.*(MoonSet-myJD)/TFrac); | 510 | settingTime = qAbs(24.*(MoonSet-myJD.first)/TFrac); |
386 | 502 | risingTime = qAbs(24.*(MoonRise-myJD)/TFrac); | 511 | risingTime = qAbs(24.*(MoonRise-myJD.first)/TFrac); |
387 | 503 | } | 512 | } |
388 | 504 | } | 513 | } |
389 | 505 | else if (horizH>0.0) | 514 | else if (horizH>0.0) |
390 | @@ -947,7 +956,7 @@ | |||
391 | 947 | QString Observability::formatAsDate(int dayNumber) | 956 | QString Observability::formatAsDate(int dayNumber) |
392 | 948 | { | 957 | { |
393 | 949 | int day, month, year; | 958 | int day, month, year; |
395 | 950 | StelUtils::getDateFromJulianDay(yearJD[dayNumber], &year, &month, &day); | 959 | StelUtils::getDateFromJulianDay(yearJD[dayNumber].first, &year, &month, &day); |
396 | 951 | 960 | ||
397 | 952 | QString formatString = (getDateFormat()) ? "%1 %2" : "%2 %1"; | 961 | QString formatString = (getDateFormat()) ? "%1 %2" : "%2 %1"; |
398 | 953 | QString result = formatString.arg(day).arg(monthNames[month-1]); | 962 | QString result = formatString.arg(day).arg(monthNames[month-1]); |
399 | @@ -960,8 +969,8 @@ | |||
400 | 960 | { | 969 | { |
401 | 961 | int sDay, sMonth, sYear, eDay, eMonth, eYear; | 970 | int sDay, sMonth, sYear, eDay, eMonth, eYear; |
402 | 962 | QString range; | 971 | QString range; |
405 | 963 | StelUtils::getDateFromJulianDay(yearJD[startDay], &sYear, &sMonth, &sDay); | 972 | StelUtils::getDateFromJulianDay(yearJD[startDay].first, &sYear, &sMonth, &sDay); |
406 | 964 | StelUtils::getDateFromJulianDay(yearJD[endDay], &eYear, &eMonth, &eDay); | 973 | StelUtils::getDateFromJulianDay(yearJD[endDay].first, &eYear, &eMonth, &eDay); |
407 | 965 | if (endDay == 0) | 974 | if (endDay == 0) |
408 | 966 | { | 975 | { |
409 | 967 | eDay = 31; | 976 | eDay = 31; |
410 | @@ -1017,7 +1026,7 @@ | |||
411 | 1017 | { | 1026 | { |
412 | 1018 | int day, month, year, sameYear; | 1027 | int day, month, year, sameYear; |
413 | 1019 | // Get current date: | 1028 | // Get current date: |
415 | 1020 | StelUtils::getDateFromJulianDay(myJD,&year,&month,&day); | 1029 | StelUtils::getDateFromJulianDay(myJD.first,&year,&month,&day); |
416 | 1021 | 1030 | ||
417 | 1022 | // Get JD for the Jan 1 of current year: | 1031 | // Get JD for the Jan 1 of current year: |
418 | 1023 | StelUtils::getJDFromDate(&Jan1stJD,year,1,1,0,0,0); | 1032 | StelUtils::getJDFromDate(&Jan1stJD,year,1,1,0,0,0); |
419 | @@ -1030,9 +1039,10 @@ | |||
420 | 1030 | Vec3d pos, sunPos; | 1039 | Vec3d pos, sunPos; |
421 | 1031 | for (int i=0; i<nDays; i++) | 1040 | for (int i=0; i<nDays; i++) |
422 | 1032 | { | 1041 | { |
426 | 1033 | yearJD[i] = Jan1stJD + (double)i; | 1042 | yearJD[i].first = Jan1stJD + (double)i; |
427 | 1034 | myEarth->computePosition(yearJD[i]); | 1043 | yearJD[i].second = yearJD[i].first+core->computeDeltaT(yearJD[i].first)/86400.0; |
428 | 1035 | myEarth->computeTransMatrix(yearJD[i]); | 1044 | myEarth->computePosition(yearJD[i].second); |
429 | 1045 | myEarth->computeTransMatrix(yearJD[i].first, yearJD[i].second); | ||
430 | 1036 | pos = myEarth->getHeliocentricEclipticPos(); | 1046 | pos = myEarth->getHeliocentricEclipticPos(); |
431 | 1037 | sunPos = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-pos)); | 1047 | sunPos = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-pos)); |
432 | 1038 | EarthPos[i] = -pos; | 1048 | EarthPos[i] = -pos; |
433 | @@ -1040,8 +1050,8 @@ | |||
434 | 1040 | }; | 1050 | }; |
435 | 1041 | 1051 | ||
436 | 1042 | //Return the Earth to its current time: | 1052 | //Return the Earth to its current time: |
439 | 1043 | myEarth->computePosition(myJD); | 1053 | myEarth->computePosition(myJD.second); |
440 | 1044 | myEarth->computeTransMatrix(myJD); | 1054 | myEarth->computeTransMatrix(myJD.first, myJD.second); |
441 | 1045 | } | 1055 | } |
442 | 1046 | /////////////////////////////////////////////////// | 1056 | /////////////////////////////////////////////////// |
443 | 1047 | 1057 | ||
444 | @@ -1261,24 +1271,24 @@ | |||
445 | 1261 | ////////////////////////// | 1271 | ////////////////////////// |
446 | 1262 | // Get the coordinates of Sun or Moon for a given JD: | 1272 | // Get the coordinates of Sun or Moon for a given JD: |
447 | 1263 | // getBack controls whether Earth and Moon must be returned to their original positions after computation. | 1273 | // getBack controls whether Earth and Moon must be returned to their original positions after computation. |
452 | 1264 | void Observability::getSunMoonCoords(StelCore *core, double jd, | 1274 | void Observability::getSunMoonCoords(StelCore *core, QPair<double, double> JD, |
453 | 1265 | double &raSun, double &decSun, | 1275 | double &raSun, double &decSun, |
454 | 1266 | double &raMoon, double &decMoon, | 1276 | double &raMoon, double &decMoon, |
455 | 1267 | double &eclLon, bool getBack) | 1277 | double &eclLon, bool getBack) |
456 | 1268 | //, Vec3d &AltAzVector) | 1278 | //, Vec3d &AltAzVector) |
457 | 1269 | { | 1279 | { |
458 | 1270 | 1280 | ||
459 | 1271 | if (getBack) // Return the Moon and Earth to their current position: | 1281 | if (getBack) // Return the Moon and Earth to their current position: |
460 | 1272 | { | 1282 | { |
465 | 1273 | myEarth->computePosition(jd); | 1283 | myEarth->computePosition(JD.second); |
466 | 1274 | myEarth->computeTransMatrix(jd); | 1284 | myEarth->computeTransMatrix(JD.first, JD.second); |
467 | 1275 | myMoon->computePosition(jd); | 1285 | myMoon->computePosition(JD.second); |
468 | 1276 | myMoon->computeTransMatrix(jd); | 1286 | myMoon->computeTransMatrix(JD.first, JD.second); |
469 | 1277 | } | 1287 | } |
470 | 1278 | else // Compute coordinates: | 1288 | else // Compute coordinates: |
471 | 1279 | { | 1289 | { |
474 | 1280 | myEarth->computePosition(jd); | 1290 | myEarth->computePosition(JD.second); |
475 | 1281 | myEarth->computeTransMatrix(jd); | 1291 | myEarth->computeTransMatrix(JD.first, JD.second); |
476 | 1282 | Vec3d earthPos = myEarth->getHeliocentricEclipticPos(); | 1292 | Vec3d earthPos = myEarth->getHeliocentricEclipticPos(); |
477 | 1283 | double curSidT; | 1293 | double curSidT; |
478 | 1284 | 1294 | ||
479 | @@ -1287,11 +1297,11 @@ | |||
480 | 1287 | toRADec(sunPos, raSun, decSun); | 1297 | toRADec(sunPos, raSun, decSun); |
481 | 1288 | 1298 | ||
482 | 1289 | // Moon coordinates: | 1299 | // Moon coordinates: |
484 | 1290 | curSidT = myEarth->getSiderealTime(jd)/Rad2Deg; | 1300 | curSidT = myEarth->getSiderealTime(JD.first, JD.second)/Rad2Deg; |
485 | 1291 | RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc; | 1301 | RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc; |
486 | 1292 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos)); | 1302 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos)); |
489 | 1293 | myMoon->computePosition(jd); | 1303 | myMoon->computePosition(JD.second); |
490 | 1294 | myMoon->computeTransMatrix(jd); | 1304 | myMoon->computeTransMatrix(JD.first, JD.second); |
491 | 1295 | Vec3d moonPos = myMoon->getHeliocentricEclipticPos(); | 1305 | Vec3d moonPos = myMoon->getHeliocentricEclipticPos(); |
492 | 1296 | sunPos = (core->j2000ToEquinoxEqu(LocTrans*moonPos))-RotObserver; | 1306 | sunPos = (core->j2000ToEquinoxEqu(LocTrans*moonPos))-RotObserver; |
493 | 1297 | 1307 | ||
494 | @@ -1307,20 +1317,20 @@ | |||
495 | 1307 | ////////////////////////// | 1317 | ////////////////////////// |
496 | 1308 | // Get the Observer-to-Moon distance JD: | 1318 | // Get the Observer-to-Moon distance JD: |
497 | 1309 | // getBack controls whether Earth and Moon must be returned to their original positions after computation. | 1319 | // getBack controls whether Earth and Moon must be returned to their original positions after computation. |
499 | 1310 | void Observability::getMoonDistance(StelCore *core, double jd, double &distance, bool getBack) | 1320 | void Observability::getMoonDistance(StelCore *core, QPair<double, double> JD, double &distance, bool getBack) |
500 | 1311 | { | 1321 | { |
501 | 1312 | 1322 | ||
502 | 1313 | if (getBack) // Return the Moon and Earth to their current position: | 1323 | if (getBack) // Return the Moon and Earth to their current position: |
503 | 1314 | { | 1324 | { |
508 | 1315 | myEarth->computePosition(jd); | 1325 | myEarth->computePosition(JD.second); |
509 | 1316 | myEarth->computeTransMatrix(jd); | 1326 | myEarth->computeTransMatrix(JD.first, JD.second); |
510 | 1317 | myMoon->computePosition(jd); | 1327 | myMoon->computePosition(JD.second); |
511 | 1318 | myMoon->computeTransMatrix(jd); | 1328 | myMoon->computeTransMatrix(JD.first, JD.second); |
512 | 1319 | } | 1329 | } |
513 | 1320 | else | 1330 | else |
514 | 1321 | { // Compute coordinates: | 1331 | { // Compute coordinates: |
517 | 1322 | myEarth->computePosition(jd); | 1332 | myEarth->computePosition(JD.second); |
518 | 1323 | myEarth->computeTransMatrix(jd); | 1333 | myEarth->computeTransMatrix(JD.first, JD.second); |
519 | 1324 | Vec3d earthPos = myEarth->getHeliocentricEclipticPos(); | 1334 | Vec3d earthPos = myEarth->getHeliocentricEclipticPos(); |
520 | 1325 | // double curSidT; | 1335 | // double curSidT; |
521 | 1326 | 1336 | ||
522 | @@ -1332,8 +1342,8 @@ | |||
523 | 1332 | // curSidT = myEarth->getSiderealTime(JD)/Rad2Deg; | 1342 | // curSidT = myEarth->getSiderealTime(JD)/Rad2Deg; |
524 | 1333 | // RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc; | 1343 | // RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc; |
525 | 1334 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos)); | 1344 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos)); |
528 | 1335 | myMoon->computePosition(jd); | 1345 | myMoon->computePosition(JD.second); |
529 | 1336 | myMoon->computeTransMatrix(jd); | 1346 | myMoon->computeTransMatrix(JD.first, JD.second); |
530 | 1337 | Pos1 = myMoon->getHeliocentricEclipticPos(); | 1347 | Pos1 = myMoon->getHeliocentricEclipticPos(); |
531 | 1338 | Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1)); //-RotObserver; | 1348 | Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1)); //-RotObserver; |
532 | 1339 | 1349 | ||
533 | @@ -1349,24 +1359,24 @@ | |||
534 | 1349 | 1359 | ||
535 | 1350 | ////////////////////////////////////////////// | 1360 | ////////////////////////////////////////////// |
536 | 1351 | // Get the Coords of a planet: | 1361 | // Get the Coords of a planet: |
538 | 1352 | void Observability::getPlanetCoords(StelCore *core, double JD, double &RA, double &Dec, bool getBack) | 1362 | void Observability::getPlanetCoords(StelCore *core, QPair<double, double> JD, double &RA, double &Dec, bool getBack) |
539 | 1353 | { | 1363 | { |
540 | 1354 | 1364 | ||
541 | 1355 | if (getBack) | 1365 | if (getBack) |
542 | 1356 | { | 1366 | { |
543 | 1357 | // Return the planet to its current time: | 1367 | // Return the planet to its current time: |
548 | 1358 | myPlanet->computePosition(JD); | 1368 | myPlanet->computePosition(JD.second); |
549 | 1359 | myPlanet->computeTransMatrix(JD); | 1369 | myPlanet->computeTransMatrix(JD.first, JD.second); |
550 | 1360 | myEarth->computePosition(JD); | 1370 | myEarth->computePosition(JD.second); |
551 | 1361 | myEarth->computeTransMatrix(JD); | 1371 | myEarth->computeTransMatrix(JD.first, JD.second); |
552 | 1362 | } else | 1372 | } else |
553 | 1363 | { | 1373 | { |
554 | 1364 | // Compute planet's position: | 1374 | // Compute planet's position: |
557 | 1365 | myPlanet->computePosition(JD); | 1375 | myPlanet->computePosition(JD.second); |
558 | 1366 | myPlanet->computeTransMatrix(JD); | 1376 | myPlanet->computeTransMatrix(JD.first, JD.second); |
559 | 1367 | Pos1 = myPlanet->getHeliocentricEclipticPos(); | 1377 | Pos1 = myPlanet->getHeliocentricEclipticPos(); |
562 | 1368 | myEarth->computePosition(JD); | 1378 | myEarth->computePosition(JD.second); |
563 | 1369 | myEarth->computeTransMatrix(JD); | 1379 | myEarth->computeTransMatrix(JD.first, JD.second); |
564 | 1370 | Pos2 = myEarth->getHeliocentricEclipticPos(); | 1380 | Pos2 = myEarth->getHeliocentricEclipticPos(); |
565 | 1371 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-Pos2)); | 1381 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-Pos2)); |
566 | 1372 | Pos2 = core->j2000ToEquinoxEqu(LocTrans*Pos1); | 1382 | Pos2 = core->j2000ToEquinoxEqu(LocTrans*Pos1); |
567 | @@ -1385,7 +1395,8 @@ | |||
568 | 1385 | 1395 | ||
569 | 1386 | const int NUM_ITER = 100; | 1396 | const int NUM_ITER = 100; |
570 | 1387 | int i; | 1397 | int i; |
572 | 1388 | double hHoriz, ra, dec, raSun, decSun, tempH, tempJd, tempEphH, curSidT, eclLon; | 1398 | double hHoriz, ra, dec, raSun, decSun, tempH, /* tempJd, */ tempEphH, curSidT, eclLon; |
573 | 1399 | QPair<double, double> tempJd; | ||
574 | 1389 | //Vec3d Observer; | 1400 | //Vec3d Observer; |
575 | 1390 | 1401 | ||
576 | 1391 | hHoriz = calculateHourAngle(mylat, refractedHorizonAlt, selDec); | 1402 | hHoriz = calculateHourAngle(mylat, refractedHorizonAlt, selDec); |
577 | @@ -1394,15 +1405,15 @@ | |||
578 | 1394 | 1405 | ||
579 | 1395 | // Only recompute ephemeris from second to second (at least) | 1406 | // Only recompute ephemeris from second to second (at least) |
580 | 1396 | // or if the source has changed (i.e., Sun <-> Moon). This saves resources: | 1407 | // or if the source has changed (i.e., Sun <-> Moon). This saves resources: |
582 | 1397 | if (qAbs(myJD-lastJDMoon)>JDsec || lastType!=bodyType || souChanged) | 1408 | if (qAbs(myJD.first-lastJDMoon)>JDsec || lastType!=bodyType || souChanged) |
583 | 1398 | { | 1409 | { |
584 | 1399 | 1410 | ||
585 | 1400 | // qDebug() << q_("%1 %2 %3 %4").arg(Kind).arg(LastObject).arg(myJD,0,'f',5).arg(lastJDMoon,0,'f',5); | 1411 | // qDebug() << q_("%1 %2 %3 %4").arg(Kind).arg(LastObject).arg(myJD,0,'f',5).arg(lastJDMoon,0,'f',5); |
586 | 1401 | 1412 | ||
587 | 1402 | lastType = bodyType; | 1413 | lastType = bodyType; |
588 | 1403 | 1414 | ||
591 | 1404 | myEarth->computePosition(myJD); | 1415 | myEarth->computePosition(myJD.second); |
592 | 1405 | myEarth->computeTransMatrix(myJD); | 1416 | myEarth->computeTransMatrix(myJD.first, myJD.second); |
593 | 1406 | Vec3d earthPos = myEarth->getHeliocentricEclipticPos(); | 1417 | Vec3d earthPos = myEarth->getHeliocentricEclipticPos(); |
594 | 1407 | 1418 | ||
595 | 1408 | if (bodyType == 1) // Sun position | 1419 | if (bodyType == 1) // Sun position |
596 | @@ -1411,18 +1422,18 @@ | |||
597 | 1411 | } | 1422 | } |
598 | 1412 | else if (bodyType==2) // Moon position | 1423 | else if (bodyType==2) // Moon position |
599 | 1413 | { | 1424 | { |
601 | 1414 | curSidT = myEarth->getSiderealTime(myJD)/Rad2Deg; | 1425 | curSidT = myEarth->getSiderealTime(myJD.first, myJD.second)/Rad2Deg; |
602 | 1415 | RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc; | 1426 | RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc; |
603 | 1416 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos)); | 1427 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos)); |
606 | 1417 | myMoon->computePosition(myJD); | 1428 | myMoon->computePosition(myJD.second); |
607 | 1418 | myMoon->computeTransMatrix(myJD); | 1429 | myMoon->computeTransMatrix(myJD.first, myJD.second); |
608 | 1419 | Pos1 = myMoon->getHeliocentricEclipticPos(); | 1430 | Pos1 = myMoon->getHeliocentricEclipticPos(); |
609 | 1420 | Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1))-RotObserver; | 1431 | Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1))-RotObserver; |
610 | 1421 | } | 1432 | } |
611 | 1422 | else // Planet position | 1433 | else // Planet position |
612 | 1423 | { | 1434 | { |
615 | 1424 | myPlanet->computePosition(myJD); | 1435 | myPlanet->computePosition(myJD.second); |
616 | 1425 | myPlanet->computeTransMatrix(myJD); | 1436 | myPlanet->computeTransMatrix(myJD.first, myJD.second); |
617 | 1426 | Pos1 = myPlanet->getHeliocentricEclipticPos(); | 1437 | Pos1 = myPlanet->getHeliocentricEclipticPos(); |
618 | 1427 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos)); | 1438 | LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos)); |
619 | 1428 | Pos2 = core->j2000ToEquinoxEqu(LocTrans*Pos1); | 1439 | Pos2 = core->j2000ToEquinoxEqu(LocTrans*Pos1); |
620 | @@ -1452,11 +1463,12 @@ | |||
621 | 1452 | 1463 | ||
622 | 1453 | // Rise time: | 1464 | // Rise time: |
623 | 1454 | tempEphH = MoonRise*TFrac; | 1465 | tempEphH = MoonRise*TFrac; |
625 | 1455 | MoonRise = myJD + (MoonRise/24.); | 1466 | MoonRise = myJD.first + (MoonRise/24.); |
626 | 1456 | for (i=0; i<NUM_ITER; i++) | 1467 | for (i=0; i<NUM_ITER; i++) |
627 | 1457 | { | 1468 | { |
628 | 1458 | // Get modified coordinates: | 1469 | // Get modified coordinates: |
630 | 1459 | tempJd = MoonRise; | 1470 | tempJd.first = MoonRise; |
631 | 1471 | tempJd.second=tempJd.first+core->computeDeltaT(tempJd.first)/86400.0; | ||
632 | 1460 | 1472 | ||
633 | 1461 | if (bodyType<3) | 1473 | if (bodyType<3) |
634 | 1462 | { | 1474 | { |
635 | @@ -1485,16 +1497,18 @@ | |||
636 | 1485 | if (qAbs(tempH-tempEphH)<JDsec) break; | 1497 | if (qAbs(tempH-tempEphH)<JDsec) break; |
637 | 1486 | // Update rise-time estimate: | 1498 | // Update rise-time estimate: |
638 | 1487 | tempEphH = tempH; | 1499 | tempEphH = tempH; |
640 | 1488 | MoonRise = myJD + (tempEphH/24.); | 1500 | MoonRise = myJD.first + (tempEphH/24.); |
641 | 1489 | }; | 1501 | }; |
642 | 1490 | 1502 | ||
643 | 1491 | // Set time: | 1503 | // Set time: |
644 | 1492 | tempEphH = MoonSet; | 1504 | tempEphH = MoonSet; |
646 | 1493 | MoonSet = myJD + (MoonSet/24.); | 1505 | MoonSet = myJD.first + (MoonSet/24.); |
647 | 1494 | for (i=0; i<NUM_ITER; i++) | 1506 | for (i=0; i<NUM_ITER; i++) |
648 | 1495 | { | 1507 | { |
649 | 1496 | // Get modified coordinates: | 1508 | // Get modified coordinates: |
651 | 1497 | tempJd = MoonSet; | 1509 | tempJd.first = MoonSet; |
652 | 1510 | tempJd.second=tempJd.first+core->computeDeltaT(tempJd.first)/86400.0; | ||
653 | 1511 | |||
654 | 1498 | 1512 | ||
655 | 1499 | if (bodyType < 3) | 1513 | if (bodyType < 3) |
656 | 1500 | getSunMoonCoords(core, tempJd, | 1514 | getSunMoonCoords(core, tempJd, |
657 | @@ -1521,7 +1535,7 @@ | |||
658 | 1521 | break; | 1535 | break; |
659 | 1522 | // Update set-time estimate: | 1536 | // Update set-time estimate: |
660 | 1523 | tempEphH = tempH; | 1537 | tempEphH = tempH; |
662 | 1524 | MoonSet = myJD + (tempEphH/24.); | 1538 | MoonSet = myJD.first + (tempEphH/24.); |
663 | 1525 | }; | 1539 | }; |
664 | 1526 | } | 1540 | } |
665 | 1527 | else // Comes from if(raises) | 1541 | else // Comes from if(raises) |
666 | @@ -1532,12 +1546,14 @@ | |||
667 | 1532 | 1546 | ||
668 | 1533 | // Culmination time: | 1547 | // Culmination time: |
669 | 1534 | tempEphH = MoonCulm; | 1548 | tempEphH = MoonCulm; |
671 | 1535 | MoonCulm = myJD + (MoonCulm/24.); | 1549 | MoonCulm = myJD.first + (MoonCulm/24.); |
672 | 1536 | 1550 | ||
673 | 1537 | for (i=0; i<NUM_ITER; i++) | 1551 | for (i=0; i<NUM_ITER; i++) |
674 | 1538 | { | 1552 | { |
675 | 1539 | // Get modified coordinates: | 1553 | // Get modified coordinates: |
677 | 1540 | tempJd = MoonCulm; | 1554 | tempJd.first = MoonCulm; |
678 | 1555 | tempJd.second=tempJd.first+core->computeDeltaT(tempJd.first)/86400.0; | ||
679 | 1556 | |||
680 | 1541 | 1557 | ||
681 | 1542 | if (bodyType<3) | 1558 | if (bodyType<3) |
682 | 1543 | { | 1559 | { |
683 | @@ -1561,16 +1577,16 @@ | |||
684 | 1561 | // Check convergence: | 1577 | // Check convergence: |
685 | 1562 | if (qAbs(tempH-tempEphH)<JDsec) break; | 1578 | if (qAbs(tempH-tempEphH)<JDsec) break; |
686 | 1563 | tempEphH = tempH; | 1579 | tempEphH = tempH; |
688 | 1564 | MoonCulm = myJD + (tempEphH/24.); | 1580 | MoonCulm = myJD.first + (tempEphH/24.); |
689 | 1565 | culmAlt = qAbs(mylat-dec); // 90 - altitude at transit. | 1581 | culmAlt = qAbs(mylat-dec); // 90 - altitude at transit. |
690 | 1566 | }; | 1582 | }; |
691 | 1567 | 1583 | ||
692 | 1568 | // qDebug() << q_("%1").arg(MoonCulm,0,'f',5); | 1584 | // qDebug() << q_("%1").arg(MoonCulm,0,'f',5); |
693 | 1569 | 1585 | ||
694 | 1570 | 1586 | ||
696 | 1571 | lastJDMoon = myJD; | 1587 | lastJDMoon = myJD.first; |
697 | 1572 | 1588 | ||
699 | 1573 | }; // Comes from if (qAbs(myJD-lastJDMoon)>JDsec || LastObject!=Kind) | 1589 | }; // Comes from if (qAbs(myJD.first-lastJDMoon)>JDsec || LastObject!=Kind) |
700 | 1574 | 1590 | ||
701 | 1575 | 1591 | ||
702 | 1576 | 1592 | ||
703 | @@ -1580,13 +1596,13 @@ | |||
704 | 1580 | { | 1596 | { |
705 | 1581 | 1597 | ||
706 | 1582 | // Only estimate date of Full Moon if we have changed Lunar month: | 1598 | // Only estimate date of Full Moon if we have changed Lunar month: |
708 | 1583 | if (myJD > nextFullMoon || myJD < prevFullMoon) | 1599 | if (myJD.first > nextFullMoon || myJD.first < prevFullMoon) |
709 | 1584 | { | 1600 | { |
710 | 1585 | 1601 | ||
711 | 1586 | 1602 | ||
712 | 1587 | // Estimate the nearest (in time) Full Moon: | 1603 | // Estimate the nearest (in time) Full Moon: |
713 | 1588 | double nT; | 1604 | double nT; |
715 | 1589 | double dT = std::modf((myJD-RefFullMoon)/MoonT,&nT); | 1605 | double dT = std::modf((myJD.first-RefFullMoon)/MoonT,&nT); |
716 | 1590 | if (dT>0.5) {nT += 1.0;}; | 1606 | if (dT>0.5) {nT += 1.0;}; |
717 | 1591 | if (dT<-0.5) {nT -= 1.0;}; | 1607 | if (dT<-0.5) {nT -= 1.0;}; |
718 | 1592 | 1608 | ||
719 | @@ -1596,7 +1612,8 @@ | |||
720 | 1596 | 1612 | ||
721 | 1597 | dT = 0.1/1440.; // 6 seconds. Our time span for the finite-difference derivative estimate. | 1613 | dT = 0.1/1440.; // 6 seconds. Our time span for the finite-difference derivative estimate. |
722 | 1598 | // double Deriv1, Deriv2; // Variables for temporal use. | 1614 | // double Deriv1, Deriv2; // Variables for temporal use. |
724 | 1599 | double Sec1, Sec2, Temp1, Temp2; // Variables for temporal use. | 1615 | QPair<double, double>Sec1, Sec2; // Variables for temporal use. Contrary to the other cases, we have Sec[12].second=DeltaT[days], not JDE. This avoids needless re-computing. |
725 | 1616 | double Temp1, Temp2; // Variables for temporal use. | ||
726 | 1600 | double iniEst1, iniEst2; // JD values that MUST include the solution within them. | 1617 | double iniEst1, iniEst2; // JD values that MUST include the solution within them. |
727 | 1601 | double Phase1; | 1618 | double Phase1; |
728 | 1602 | 1619 | ||
729 | @@ -1606,26 +1623,31 @@ | |||
730 | 1606 | iniEst1 = TempFullMoon - 0.25*MoonT; | 1623 | iniEst1 = TempFullMoon - 0.25*MoonT; |
731 | 1607 | iniEst2 = TempFullMoon + 0.25*MoonT; | 1624 | iniEst2 = TempFullMoon + 0.25*MoonT; |
732 | 1608 | 1625 | ||
737 | 1609 | Sec1 = iniEst1; // TempFullMoon - 0.05*MoonT; // Initial estimates of Full-Moon dates | 1626 | |
738 | 1610 | Sec2 = iniEst2; // TempFullMoon + 0.05*MoonT; | 1627 | Sec1.first = iniEst1; // TempFullMoon - 0.05*MoonT; // Initial estimates of Full-Moon dates |
739 | 1611 | 1628 | Sec1.second= core->computeDeltaT(Sec1.first)/86400.0; // enough to compute this once. | |
740 | 1612 | getSunMoonCoords(core,Sec1,raSun,decSun,ra,dec,eclLon,false); | 1629 | Sec2.first = iniEst2; // TempFullMoon + 0.05*MoonT; |
741 | 1630 | Sec2.second= core->computeDeltaT(Sec2.first)/86400.0; // enough to compute this once. | ||
742 | 1631 | |||
743 | 1632 | // for the computation calls, we need temporary QPairs here! | ||
744 | 1633 | getSunMoonCoords(core,QPair<double, double>(Sec1.first, Sec1.first+Sec1.second),raSun,decSun,ra,dec,eclLon,false); | ||
745 | 1613 | Temp1 = eclLon; //Lambda(RA,Dec,RAS,DecS); | 1634 | Temp1 = eclLon; //Lambda(RA,Dec,RAS,DecS); |
747 | 1614 | getSunMoonCoords(core,Sec2,raSun,decSun,ra,dec,eclLon,false); | 1635 | getSunMoonCoords(core,QPair<double, double>(Sec2.first, Sec2.first+Sec2.second),raSun,decSun,ra,dec,eclLon,false); |
748 | 1615 | Temp2 = eclLon; //Lambda(RA,Dec,RAS,DecS); | 1636 | Temp2 = eclLon; //Lambda(RA,Dec,RAS,DecS); |
749 | 1616 | 1637 | ||
750 | 1617 | 1638 | ||
751 | 1618 | for (int i=0; i<100; i++) // A limit of 100 iterations. | 1639 | for (int i=0; i<100; i++) // A limit of 100 iterations. |
752 | 1619 | { | 1640 | { |
755 | 1620 | Phase1 = (Sec2-Sec1)/(Temp1-Temp2)*Temp1+Sec1; | 1641 | Phase1 = (Sec2.first-Sec1.first)/(Temp1-Temp2)*Temp1+Sec1.first; |
756 | 1621 | getSunMoonCoords(core,Phase1,raSun,decSun,ra,dec,eclLon,false); | 1642 | // The ad-hoc pair needs a DeltaT, use the one of Sec1 |
757 | 1643 | getSunMoonCoords(core,QPair<double, double>(Phase1, Phase1+Sec1.second),raSun,decSun,ra,dec,eclLon,false); | ||
758 | 1622 | 1644 | ||
759 | 1623 | if (Temp1*eclLon < 0.0) | 1645 | if (Temp1*eclLon < 0.0) |
760 | 1624 | { | 1646 | { |
762 | 1625 | Sec2 = Phase1; | 1647 | Sec2.first = Phase1; |
763 | 1626 | Temp2 = eclLon; | 1648 | Temp2 = eclLon; |
764 | 1627 | } else { | 1649 | } else { |
766 | 1628 | Sec1 = Phase1; | 1650 | Sec1.first = Phase1; |
767 | 1629 | Temp1 = eclLon; | 1651 | Temp1 = eclLon; |
768 | 1630 | 1652 | ||
769 | 1631 | }; | 1653 | }; |
770 | @@ -1633,9 +1655,9 @@ | |||
771 | 1633 | // qDebug() << QString("%1 %2 %3 %4 ").arg(Sec1).arg(Sec2).arg(Temp1).arg(Temp2); | 1655 | // qDebug() << QString("%1 %2 %3 %4 ").arg(Sec1).arg(Sec2).arg(Temp1).arg(Temp2); |
772 | 1634 | 1656 | ||
773 | 1635 | 1657 | ||
775 | 1636 | if (qAbs(Sec2-Sec1) < 10.*dT) // 1 minute accuracy; convergence. | 1658 | if (qAbs(Sec2.first-Sec1.first) < 10.*dT) // 1 minute accuracy; convergence. |
776 | 1637 | { | 1659 | { |
778 | 1638 | TempFullMoon = (Sec1+Sec2)/2.; | 1660 | TempFullMoon = (Sec1.first+Sec2.first)/2.; |
779 | 1639 | // qDebug() << QString("%1%2 ").arg(TempFullMoon); | 1661 | // qDebug() << QString("%1%2 ").arg(TempFullMoon); |
780 | 1640 | break; | 1662 | break; |
781 | 1641 | }; | 1663 | }; |
782 | @@ -1643,7 +1665,7 @@ | |||
783 | 1643 | }; | 1665 | }; |
784 | 1644 | 1666 | ||
785 | 1645 | 1667 | ||
787 | 1646 | if (TempFullMoon > myJD) | 1668 | if (TempFullMoon > myJD.first) |
788 | 1647 | { | 1669 | { |
789 | 1648 | nextFullMoon = TempFullMoon; | 1670 | nextFullMoon = TempFullMoon; |
790 | 1649 | TempFullMoon -= MoonT; | 1671 | TempFullMoon -= MoonT; |
791 | 1650 | 1672 | ||
792 | === modified file 'plugins/Observability/src/Observability.hpp' | |||
793 | --- plugins/Observability/src/Observability.hpp 2015-05-30 19:56:47 +0000 | |||
794 | +++ plugins/Observability/src/Observability.hpp 2015-08-03 13:17:13 +0000 | |||
795 | @@ -21,6 +21,7 @@ | |||
796 | 21 | #include "StelModule.hpp" | 21 | #include "StelModule.hpp" |
797 | 22 | #include <QFont> | 22 | #include <QFont> |
798 | 23 | #include <QString> | 23 | #include <QString> |
799 | 24 | #include <QPair> | ||
800 | 24 | #include "VecMath.hpp" | 25 | #include "VecMath.hpp" |
801 | 25 | #include "SolarSystem.hpp" | 26 | #include "SolarSystem.hpp" |
802 | 26 | #include "Planet.hpp" | 27 | #include "Planet.hpp" |
803 | @@ -190,33 +191,33 @@ | |||
804 | 190 | 191 | ||
805 | 191 | //! Computes the Sun or Moon coordinates at a given Julian date. | 192 | //! Computes the Sun or Moon coordinates at a given Julian date. |
806 | 192 | //! @param core the stellarium core. | 193 | //! @param core the stellarium core. |
808 | 193 | //! @param JD double for the Julian date. | 194 | //! @param JD QPair of double for the Julian date: first=JD_UT and .second=JDE_DT |
809 | 194 | //! @param RASun right ascension of the Sun (in hours). | 195 | //! @param RASun right ascension of the Sun (in hours). |
810 | 195 | //! @param DecSun declination of the Sun (in radians). | 196 | //! @param DecSun declination of the Sun (in radians). |
811 | 196 | //! @param RAMoon idem for the Moon. | 197 | //! @param RAMoon idem for the Moon. |
812 | 197 | //! @param DecMoon idem for the Moon. | 198 | //! @param DecMoon idem for the Moon. |
813 | 198 | //! @param EclLon is the module of the vector product of Heliocentric Ecliptic Coordinates of Sun and Moon (projected over the Ecliptic plane). Useful to derive the dates of Full Moon. | 199 | //! @param EclLon is the module of the vector product of Heliocentric Ecliptic Coordinates of Sun and Moon (projected over the Ecliptic plane). Useful to derive the dates of Full Moon. |
814 | 199 | //! @param getBack controls whether Earth and Moon must be returned to their original positions after computation. | 200 | //! @param getBack controls whether Earth and Moon must be returned to their original positions after computation. |
819 | 200 | void getSunMoonCoords(StelCore* core, double jd, | 201 | void getSunMoonCoords(StelCore* core, QPair<double, double> JD, |
820 | 201 | double& raSun, double& decSun, | 202 | double& raSun, double& decSun, |
821 | 202 | double& raMoon, double& decMoon, | 203 | double& raMoon, double& decMoon, |
822 | 203 | double& eclLon, bool getBack); | 204 | double& eclLon, bool getBack); |
823 | 204 | 205 | ||
824 | 205 | 206 | ||
825 | 206 | //! computes the selected-planet coordinates at a given Julian date. | 207 | //! computes the selected-planet coordinates at a given Julian date. |
826 | 207 | //! @param core the stellarium core. | 208 | //! @param core the stellarium core. |
828 | 208 | //! @param JD double for the Julian date. | 209 | //! @param JD QPair for the Julian date: .first=JD(UT), .second=JDE |
829 | 209 | //! @param RA right ascension of the planet (in hours). | 210 | //! @param RA right ascension of the planet (in hours). |
830 | 210 | //! @param Dec declination of the planet (in radians). | 211 | //! @param Dec declination of the planet (in radians). |
831 | 211 | //! @param getBack controls whether the planet must be returned to its original positions after computation. | 212 | //! @param getBack controls whether the planet must be returned to its original positions after computation. |
833 | 212 | void getPlanetCoords(StelCore* core, double JD, double &RA, double &Dec, bool getBack); | 213 | void getPlanetCoords(StelCore* core, QPair<double, double> JD, double &RA, double &Dec, bool getBack); |
834 | 213 | 214 | ||
837 | 214 | //! Comptues the Earth-Moon distance (in AU) at a given Julian date. | 215 | //! Computes the Earth-Moon distance (in AU) at a given Julian date. |
838 | 215 | //! The parameters are similar to those of getSunMoonCoords or getPlanetCoords. | 216 | //! The parameters are similar to those of getSunMoonCoords() or getPlanetCoords(). |
839 | 216 | void getMoonDistance(StelCore* core, | 217 | void getMoonDistance(StelCore* core, |
843 | 217 | double jd, | 218 | QPair<double, double> JD, |
844 | 218 | double& distance, | 219 | double& distance, |
845 | 219 | bool getBack); | 220 | bool getBack); |
846 | 220 | 221 | ||
847 | 221 | //! Returns the angular separation (in radians) between two points. | 222 | //! Returns the angular separation (in radians) between two points. |
848 | 222 | //! @param RA1 right ascension of point 1 (in hours) | 223 | //! @param RA1 right ascension of point 1 (in hours) |
849 | @@ -268,15 +269,19 @@ | |||
850 | 268 | void toRADec(Vec3d vec3d, double& ra, double& dec); | 269 | void toRADec(Vec3d vec3d, double& ra, double& dec); |
851 | 269 | 270 | ||
852 | 270 | //! Table containing the Julian Dates of the days of the current year. | 271 | //! Table containing the Julian Dates of the days of the current year. |
854 | 271 | double yearJD[366]; | 272 | QPair<double, double> yearJD[366]; // GZ: This had to become a QPair of JD.first=JD_UT, JD.second=JDE |
855 | 272 | 273 | ||
856 | 273 | //! Check if a source is observable during a given date. | 274 | //! Check if a source is observable during a given date. |
857 | 274 | //! @param i the day of the year. | 275 | //! @param i the day of the year. |
858 | 275 | bool CheckRise(int day); | 276 | bool CheckRise(int day); |
859 | 276 | 277 | ||
863 | 277 | //! Some useful constants and variables(almost self-explanatory). | 278 | //! Some useful constants (almost self-explanatory). |
864 | 278 | double Rad2Deg, Rad2Hr, UA, TFrac, JDsec, Jan1stJD, halfpi, MoonT, nextFullMoon, prevFullMoon, RefFullMoon, GMTShift, MoonPerilune; | 279 | // GZ: Made true constants out of those, and improved accuracy of some. |
865 | 279 | 280 | static const double Rad2Deg, Rad2Hr, UA, TFrac, JDsec, halfpi, MoonT, RefFullMoon, MoonPerilune; | |
866 | 281 | |||
867 | 282 | //! Some useful variables(almost self-explanatory). | ||
868 | 283 | double nextFullMoon, prevFullMoon, GMTShift, Jan1stJD; | ||
869 | 284 | |||
870 | 280 | //! User-defined angular altitude of astronomical twilight in radians. | 285 | //! User-defined angular altitude of astronomical twilight in radians. |
871 | 281 | //! See setTwilightAltitude() and getTwilightAltitude(). | 286 | //! See setTwilightAltitude() and getTwilightAltitude(). |
872 | 282 | double twilightAltRad; | 287 | double twilightAltRad; |
873 | @@ -292,7 +297,9 @@ | |||
874 | 292 | int horizonAltDeg; | 297 | int horizonAltDeg; |
875 | 293 | 298 | ||
876 | 294 | //! RA, Dec, observer latitude, object's elevation, and Hour Angle at horizon. | 299 | //! RA, Dec, observer latitude, object's elevation, and Hour Angle at horizon. |
878 | 295 | double selRA, selDec, mylat, mylon, alti, horizH, culmAlt, myJD; | 300 | double selRA, selDec, mylat, mylon, alti, horizH, culmAlt; |
879 | 301 | //! Some place to keep JD and JDE. .first is JD(UT), .second is for the fitting JDE. | ||
880 | 302 | QPair<double, double> myJD; | ||
881 | 296 | 303 | ||
882 | 297 | //! Vectors to store Sun's RA, Dec, and Sid. Time at twilight and rise/set. | 304 | //! Vectors to store Sun's RA, Dec, and Sid. Time at twilight and rise/set. |
883 | 298 | double sunRA[366]; | 305 | double sunRA[366]; |
884 | @@ -304,7 +311,7 @@ | |||
885 | 304 | double objectRA[366]; | 311 | double objectRA[366]; |
886 | 305 | double objectDec[366]; | 312 | double objectDec[366]; |
887 | 306 | double objectH0[366]; | 313 | double objectH0[366]; |
889 | 307 | //! Table of the sidereal time of the object's rising/setting. | 314 | //! Table of the sidereal time of the object's rising/setting. |
890 | 308 | double objectSidT[2][366]; | 315 | double objectSidT[2][366]; |
891 | 309 | 316 | ||
892 | 310 | //! Rise/Set/Transit times for the Moon at current day: | 317 | //! Rise/Set/Transit times for the Moon at current day: |
893 | 311 | 318 | ||
894 | === modified file 'plugins/PointerCoordinates/src/PointerCoordinates.cpp' | |||
895 | --- plugins/PointerCoordinates/src/PointerCoordinates.cpp 2015-04-24 17:04:28 +0000 | |||
896 | +++ plugins/PointerCoordinates/src/PointerCoordinates.cpp 2015-08-03 13:17:13 +0000 | |||
897 | @@ -210,7 +210,7 @@ | |||
898 | 210 | { | 210 | { |
899 | 211 | double lambda, beta; | 211 | double lambda, beta; |
900 | 212 | StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEqu(mousePosition)); | 212 | StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEqu(mousePosition)); |
902 | 213 | StelUtils::equToEcl(cx, cy, core->getCurrentPlanet()->getRotObliquity(core->getJDay()), &lambda, &beta); // Calculate ecliptic position and show it... | 213 | StelUtils::equToEcl(cx, cy, core->getCurrentPlanet()->getRotObliquity(core->getJDE()), &lambda, &beta); // Calculate ecliptic position and show it... |
903 | 214 | if (lambda<0) lambda+=2.0*M_PI; | 214 | if (lambda<0) lambda+=2.0*M_PI; |
904 | 215 | coordsSystem = qc_("Ecl. Long/Lat", "abbreviated in the plugin"); | 215 | coordsSystem = qc_("Ecl. Long/Lat", "abbreviated in the plugin"); |
905 | 216 | if (withDecimalDegree) | 216 | if (withDecimalDegree) |
906 | @@ -247,7 +247,7 @@ | |||
907 | 247 | case HourAngle: | 247 | case HourAngle: |
908 | 248 | { | 248 | { |
909 | 249 | Vec3d v = core->j2000ToAltAz(mousePosition, StelCore::RefractionAuto); | 249 | Vec3d v = core->j2000ToAltAz(mousePosition, StelCore::RefractionAuto); |
911 | 250 | StelUtils::rectToSphe(&cx,&cy,Mat4d::zrotation(-core->getLocalSiderealTime()+((core->getDeltaT(core->getJDay())/240.)*M_PI/180.))*core->altAzToEquinoxEqu(v, StelCore::RefractionOff)); | 250 | StelUtils::rectToSphe(&cx,&cy,Mat4d::zrotation(-core->getLocalSiderealTime())*core->altAzToEquinoxEqu(v, StelCore::RefractionOff)); |
912 | 251 | cx = 2.*M_PI-cx; | 251 | cx = 2.*M_PI-cx; |
913 | 252 | coordsSystem = qc_("HA/Dec", "abbreviated in the plugin"); | 252 | coordsSystem = qc_("HA/Dec", "abbreviated in the plugin"); |
914 | 253 | if (withDecimalDegree) | 253 | if (withDecimalDegree) |
915 | 254 | 254 | ||
916 | === modified file 'plugins/Satellites/src/Satellite.cpp' | |||
917 | --- plugins/Satellites/src/Satellite.cpp 2015-06-18 19:50:02 +0000 | |||
918 | +++ plugins/Satellites/src/Satellite.cpp 2015-08-03 13:17:13 +0000 | |||
919 | @@ -612,8 +612,7 @@ | |||
920 | 612 | if (pSatWrapper && orbitValid) | 612 | if (pSatWrapper && orbitValid) |
921 | 613 | { | 613 | { |
922 | 614 | StelCore* core = StelApp::getInstance().getCore(); | 614 | StelCore* core = StelApp::getInstance().getCore(); |
925 | 615 | double JD = core->getJDay(); | 615 | epochTime = core->getJD(); // We have "true" JD from core, satellites don't need JDE! |
924 | 616 | epochTime = JD - core->getDeltaT(JD)/86400; // Delta T anti-correction for artificial satellites | ||
926 | 617 | 616 | ||
927 | 618 | pSatWrapper->setEpoch(epochTime); | 617 | pSatWrapper->setEpoch(epochTime); |
928 | 619 | position = pSatWrapper->getTEMEPos(); | 618 | position = pSatWrapper->getTEMEPos(); |
929 | @@ -730,7 +729,7 @@ | |||
930 | 730 | 729 | ||
931 | 731 | void Satellite::draw(StelCore* core, StelPainter& painter, float) | 730 | void Satellite::draw(StelCore* core, StelPainter& painter, float) |
932 | 732 | { | 731 | { |
934 | 733 | if (core->getJDay()<jdLaunchYearJan1 || !displayed) | 732 | if (core->getJD()<jdLaunchYearJan1 || !displayed) |
935 | 734 | return; | 733 | return; |
936 | 735 | 734 | ||
937 | 736 | XYZ = getJ2000EquatorialPos(core); | 735 | XYZ = getJ2000EquatorialPos(core); |
938 | 737 | 736 | ||
939 | === modified file 'plugins/Satellites/src/Satellites.cpp' | |||
940 | --- plugins/Satellites/src/Satellites.cpp 2015-06-17 18:00:57 +0000 | |||
941 | +++ plugins/Satellites/src/Satellites.cpp 2015-08-03 13:17:13 +0000 | |||
942 | @@ -1694,7 +1694,7 @@ | |||
943 | 1694 | bool Satellites::isValidRangeDates() const | 1694 | bool Satellites::isValidRangeDates() const |
944 | 1695 | { | 1695 | { |
945 | 1696 | bool ok; | 1696 | bool ok; |
947 | 1697 | double tJD = StelApp::getInstance().getCore()->getJDay(); | 1697 | double tJD = StelApp::getInstance().getCore()->getJD(); |
948 | 1698 | double uJD = StelUtils::getJulianDayFromISO8601String(lastUpdate.toString(Qt::ISODate), &ok); | 1698 | double uJD = StelUtils::getJulianDayFromISO8601String(lastUpdate.toString(Qt::ISODate), &ok); |
949 | 1699 | if (lastUpdate.isNull()) // No updates yet? | 1699 | if (lastUpdate.isNull()) // No updates yet? |
950 | 1700 | uJD = tJD; | 1700 | uJD = tJD; |
951 | 1701 | 1701 | ||
952 | === modified file 'plugins/Satellites/src/gSatWrapper.cpp' | |||
953 | --- plugins/Satellites/src/gSatWrapper.cpp 2015-02-01 20:44:54 +0000 | |||
954 | +++ plugins/Satellites/src/gSatWrapper.cpp 2015-08-03 13:17:13 +0000 | |||
955 | @@ -122,7 +122,7 @@ | |||
956 | 122 | 122 | ||
957 | 123 | void gSatWrapper::updateEpoch() | 123 | void gSatWrapper::updateEpoch() |
958 | 124 | { | 124 | { |
960 | 125 | double jul_utc = StelApp::getInstance().getCore()->getJDay(); | 125 | double jul_utc = StelApp::getInstance().getCore()->getJD(); |
961 | 126 | epoch = jul_utc; | 126 | epoch = jul_utc; |
962 | 127 | 127 | ||
963 | 128 | if (pSatellite) | 128 | if (pSatellite) |
964 | 129 | 129 | ||
965 | === modified file 'plugins/Satellites/src/gsatellite/gVector.cpp' | |||
966 | --- plugins/Satellites/src/gsatellite/gVector.cpp 2015-02-01 20:44:54 +0000 | |||
967 | +++ plugins/Satellites/src/gsatellite/gVector.cpp 2015-08-03 13:17:13 +0000 | |||
968 | @@ -34,7 +34,7 @@ | |||
969 | 34 | 34 | ||
970 | 35 | } | 35 | } |
971 | 36 | 36 | ||
973 | 37 | gVector::gVector(unsigned int ai_uiElementsNumber) | 37 | gVector::gVector(size_t ai_uiElementsNumber) |
974 | 38 | : br_stl::gVectorTempl<double>(ai_uiElementsNumber) | 38 | : br_stl::gVectorTempl<double>(ai_uiElementsNumber) |
975 | 39 | { | 39 | { |
976 | 40 | 40 | ||
977 | 41 | 41 | ||
978 | === modified file 'plugins/Satellites/src/gsatellite/gVector.hpp' | |||
979 | --- plugins/Satellites/src/gsatellite/gVector.hpp 2015-05-30 19:56:47 +0000 | |||
980 | +++ plugins/Satellites/src/gsatellite/gVector.hpp 2015-08-03 13:17:13 +0000 | |||
981 | @@ -43,9 +43,10 @@ | |||
982 | 43 | 43 | ||
983 | 44 | public: | 44 | public: |
984 | 45 | gVector(); | 45 | gVector(); |
986 | 46 | gVector(unsigned int ai_uiElementsNumber); | 46 | //gVector(unsigned int ai_uiElementsNumber); |
987 | 47 | gVector(size_t ai_uiElementsNumber); | ||
988 | 47 | 48 | ||
990 | 48 | virtual ~gVector() {}; | 49 | virtual ~gVector() {} |
991 | 49 | 50 | ||
992 | 50 | //## Other Operations (specified) | 51 | //## Other Operations (specified) |
993 | 51 | //## Operation: operator* | 52 | //## Operation: operator* |
994 | 52 | 53 | ||
995 | === modified file 'plugins/Scenery3d/src/Scenery3d.cpp' | |||
996 | --- plugins/Scenery3d/src/Scenery3d.cpp 2015-05-18 12:01:39 +0000 | |||
997 | +++ plugins/Scenery3d/src/Scenery3d.cpp 2015-08-03 13:17:13 +0000 | |||
998 | @@ -391,7 +391,7 @@ | |||
999 | 391 | movement[2]); | 391 | movement[2]); |
1000 | 392 | 392 | ||
1001 | 393 | //get current time | 393 | //get current time |
1003 | 394 | double curTime = core->getJDay(); | 394 | double curTime = core->getJD(); |
1004 | 395 | 395 | ||
1005 | 396 | if(lazyDrawing) | 396 | if(lazyDrawing) |
1006 | 397 | { | 397 | { |
1007 | @@ -1542,7 +1542,7 @@ | |||
1008 | 1542 | 1542 | ||
1009 | 1543 | if(needsCubemapUpdate) | 1543 | if(needsCubemapUpdate) |
1010 | 1544 | { | 1544 | { |
1012 | 1545 | lastCubemapUpdate = core->getJDay(); | 1545 | lastCubemapUpdate = core->getJD(); |
1013 | 1546 | lastCubemapUpdateRealTime = QDateTime::currentMSecsSinceEpoch(); | 1546 | lastCubemapUpdateRealTime = QDateTime::currentMSecsSinceEpoch(); |
1014 | 1547 | } | 1547 | } |
1015 | 1548 | } | 1548 | } |
1016 | @@ -1893,7 +1893,7 @@ | |||
1017 | 1893 | str = QString("Last cubemap update: %1ms ago").arg(QDateTime::currentMSecsSinceEpoch() - lastCubemapUpdateRealTime); | 1893 | str = QString("Last cubemap update: %1ms ago").arg(QDateTime::currentMSecsSinceEpoch() - lastCubemapUpdateRealTime); |
1018 | 1894 | painter.drawText(screen_x, screen_y, str); | 1894 | painter.drawText(screen_x, screen_y, str); |
1019 | 1895 | screen_y -= 15.0f; | 1895 | screen_y -= 15.0f; |
1021 | 1896 | str = QString("Last cubemap update JDAY: %1").arg(qAbs(core->getJDay()-lastCubemapUpdate) * StelCore::ONE_OVER_JD_SECOND); | 1896 | str = QString("Last cubemap update JDAY: %1").arg(qAbs(core->getJD()-lastCubemapUpdate) * StelCore::ONE_OVER_JD_SECOND); |
1022 | 1897 | painter.drawText(screen_x, screen_y, str); | 1897 | painter.drawText(screen_x, screen_y, str); |
1023 | 1898 | } | 1898 | } |
1024 | 1899 | 1899 | ||
1025 | 1900 | 1900 | ||
1026 | === modified file 'plugins/Supernovae/src/Supernova.cpp' | |||
1027 | --- plugins/Supernovae/src/Supernova.cpp 2015-02-08 15:35:27 +0000 | |||
1028 | +++ plugins/Supernovae/src/Supernova.cpp 2015-08-03 13:17:13 +0000 | |||
1029 | @@ -160,7 +160,7 @@ | |||
1030 | 160 | float Supernova::getVMagnitude(const StelCore* core) const | 160 | float Supernova::getVMagnitude(const StelCore* core) const |
1031 | 161 | { | 161 | { |
1032 | 162 | double vmag = 20; | 162 | double vmag = 20; |
1034 | 163 | double currentJD = core->getJDay(); | 163 | double currentJD = core->getJDE(); // GZ JDfix for 0.14. I hope the JD in the list is JDE? (Usually difference should be negligible) |
1035 | 164 | double deltaJD = qAbs(peakJD-currentJD); | 164 | double deltaJD = qAbs(peakJD-currentJD); |
1036 | 165 | 165 | ||
1037 | 166 | // Use supernova light curve model from here - http://www.astronet.ru/db/msg/1188703 | 166 | // Use supernova light curve model from here - http://www.astronet.ru/db/msg/1188703 |
1038 | 167 | 167 | ||
1039 | === modified file 'plugins/TelescopeControl/src/clients/TelescopeClient.cpp' | |||
1040 | --- plugins/TelescopeControl/src/clients/TelescopeClient.cpp 2015-02-05 15:44:10 +0000 | |||
1041 | +++ plugins/TelescopeControl/src/clients/TelescopeClient.cpp 2015-08-03 13:17:13 +0000 | |||
1042 | @@ -146,7 +146,7 @@ | |||
1043 | 146 | // At the moment this can't be done in a platform-independent way with Qt | 146 | // At the moment this can't be done in a platform-independent way with Qt |
1044 | 147 | // (QDateTime and QTime don't support microsecond precision) | 147 | // (QDateTime and QTime don't support microsecond precision) |
1045 | 148 | qint64 t; | 148 | qint64 t; |
1047 | 149 | StelCore *core = StelApp::getInstance().getCore(); | 149 | //StelCore *core = StelApp::getInstance().getCore(); |
1048 | 150 | #ifdef Q_OS_WIN32 | 150 | #ifdef Q_OS_WIN32 |
1049 | 151 | FILETIME file_time; | 151 | FILETIME file_time; |
1050 | 152 | GetSystemTimeAsFileTime(&file_time); | 152 | GetSystemTimeAsFileTime(&file_time); |
1051 | @@ -156,7 +156,9 @@ | |||
1052 | 156 | gettimeofday(&tv,0); | 156 | gettimeofday(&tv,0); |
1053 | 157 | t = tv.tv_sec * 1000000LL + tv.tv_usec; | 157 | t = tv.tv_sec * 1000000LL + tv.tv_usec; |
1054 | 158 | #endif | 158 | #endif |
1056 | 159 | return t - core->getDeltaT(StelUtils::getJDFromSystem())*1000000; // Delta T anti-correction | 159 | // GZ JDfix for 0.14 I am 99.9% sure we no longer need the anti-correction |
1057 | 160 | //return t - core->getDeltaT(StelUtils::getJDFromSystem())*1000000; // Delta T anti-correction | ||
1058 | 161 | return t; | ||
1059 | 160 | } | 162 | } |
1060 | 161 | 163 | ||
1061 | 162 | TelescopeTCP::TelescopeTCP(const QString &name, const QString ¶ms, Equinox eq) | 164 | TelescopeTCP::TelescopeTCP(const QString &name, const QString ¶ms, Equinox eq) |
1062 | 163 | 165 | ||
1063 | === modified file 'plugins/TelescopeControl/src/servers/Socket.cpp' | |||
1064 | --- plugins/TelescopeControl/src/servers/Socket.cpp 2013-05-15 12:54:31 +0000 | |||
1065 | +++ plugins/TelescopeControl/src/servers/Socket.cpp 2015-08-03 13:17:13 +0000 | |||
1066 | @@ -36,7 +36,7 @@ | |||
1067 | 36 | long long int GetNow(void) | 36 | long long int GetNow(void) |
1068 | 37 | { | 37 | { |
1069 | 38 | long long int t; | 38 | long long int t; |
1071 | 39 | StelCore *core = StelApp::getInstance().getCore(); | 39 | //StelCore *core = StelApp::getInstance().getCore(); |
1072 | 40 | #ifdef Q_OS_WIN32 | 40 | #ifdef Q_OS_WIN32 |
1073 | 41 | union | 41 | union |
1074 | 42 | { | 42 | { |
1075 | @@ -50,7 +50,9 @@ | |||
1076 | 50 | gettimeofday(&tv, 0); | 50 | gettimeofday(&tv, 0); |
1077 | 51 | t = tv.tv_sec * 1000000LL + tv.tv_usec; | 51 | t = tv.tv_sec * 1000000LL + tv.tv_usec; |
1078 | 52 | #endif | 52 | #endif |
1080 | 53 | return t - core->getDeltaT(StelUtils::getJDFromSystem())*1000000; // Delta T anti-correction | 53 | // GZ JDfix for 0.14 I am 99.9% sure we no longer need the anti-correction |
1081 | 54 | //return t - core->getDeltaT(StelUtils::getJDFromSystem())*1000000; // Delta T anti-correction | ||
1082 | 55 | return t; | ||
1083 | 54 | } | 56 | } |
1084 | 55 | 57 | ||
1085 | 56 | void Socket::hangup(void) | 58 | void Socket::hangup(void) |
1086 | 57 | 59 | ||
1087 | === modified file 'plugins/TextUserInterface/src/TextUserInterface.cpp' | |||
1088 | --- plugins/TextUserInterface/src/TextUserInterface.cpp 2015-06-14 20:40:29 +0000 | |||
1089 | +++ plugins/TextUserInterface/src/TextUserInterface.cpp 2015-08-03 13:17:13 +0000 | |||
1090 | @@ -174,8 +174,8 @@ | |||
1091 | 174 | m1->setNextNode(m2); | 174 | m1->setNextNode(m2); |
1092 | 175 | TuiNode* m2_1 = new TuiNodeDateTime(N_("Current date/time"), | 175 | TuiNode* m2_1 = new TuiNodeDateTime(N_("Current date/time"), |
1093 | 176 | core, | 176 | core, |
1096 | 177 | SLOT(setJDay(double)), | 177 | SLOT(setJD(double)), |
1097 | 178 | core->getJDay(), | 178 | core->getJD(), |
1098 | 179 | m2); | 179 | m2); |
1099 | 180 | TuiNode* m2_2 = new TuiNode(N_("Set time zone"), m2, m2_1); | 180 | TuiNode* m2_2 = new TuiNode(N_("Set time zone"), m2, m2_1); |
1100 | 181 | TuiNode* m2_3 = new TuiNode(N_("Day keys"), m2, m2_2); | 181 | TuiNode* m2_3 = new TuiNode(N_("Day keys"), m2, m2_2); |
1101 | @@ -605,7 +605,7 @@ | |||
1102 | 605 | 605 | ||
1103 | 606 | if (tuiDateTime) | 606 | if (tuiDateTime) |
1104 | 607 | { | 607 | { |
1106 | 608 | double jd = core->getJDay(); | 608 | double jd = core->getJD(); |
1107 | 609 | int text_x = x + xVc*2/3, text_y = y + pixOffset; | 609 | int text_x = x + xVc*2/3, text_y = y + pixOffset; |
1108 | 610 | 610 | ||
1109 | 611 | QString newDate = StelApp::getInstance().getLocaleMgr().getPrintableDateLocal(jd) + " " | 611 | QString newDate = StelApp::getInstance().getLocaleMgr().getPrintableDateLocal(jd) + " " |
1110 | 612 | 612 | ||
1111 | === modified file 'src/core/StelCore.cpp' | |||
1112 | --- src/core/StelCore.cpp 2015-08-02 17:12:29 +0000 | |||
1113 | +++ src/core/StelCore.cpp 2015-08-03 13:17:13 +0000 | |||
1114 | @@ -50,11 +50,11 @@ | |||
1115 | 50 | const Mat4d StelCore::matJ2000ToGalactic(-0.054875539726, 0.494109453312, -0.867666135858, 0, -0.873437108010, -0.444829589425, -0.198076386122, 0, -0.483834985808, 0.746982251810, 0.455983795705, 0, 0, 0, 0, 1); | 50 | const Mat4d StelCore::matJ2000ToGalactic(-0.054875539726, 0.494109453312, -0.867666135858, 0, -0.873437108010, -0.444829589425, -0.198076386122, 0, -0.483834985808, 0.746982251810, 0.455983795705, 0, 0, 0, 0, 1); |
1116 | 51 | const Mat4d StelCore::matGalacticToJ2000(matJ2000ToGalactic.transpose()); | 51 | const Mat4d StelCore::matGalacticToJ2000(matJ2000ToGalactic.transpose()); |
1117 | 52 | 52 | ||
1121 | 53 | const double StelCore::JD_SECOND=0.000011574074074074074074; | 53 | const double StelCore::JD_SECOND=0.000011574074074074074074; // 1/(24*60*60)=1/86400 |
1122 | 54 | const double StelCore::JD_MINUTE=0.00069444444444444444444; | 54 | const double StelCore::JD_MINUTE=0.00069444444444444444444; // 1/(24*60) =1/1440 |
1123 | 55 | const double StelCore::JD_HOUR =0.041666666666666666666; | 55 | const double StelCore::JD_HOUR =0.041666666666666666666; // 1/24 |
1124 | 56 | const double StelCore::JD_DAY =1.; | 56 | const double StelCore::JD_DAY =1.; |
1126 | 57 | const double StelCore::ONE_OVER_JD_SECOND = 24 * 60 * 60; | 57 | const double StelCore::ONE_OVER_JD_SECOND = 24 * 60 * 60; // 86400 |
1127 | 58 | 58 | ||
1128 | 59 | 59 | ||
1129 | 60 | StelCore::StelCore() | 60 | StelCore::StelCore() |
1130 | @@ -65,10 +65,10 @@ | |||
1131 | 65 | , currentDeltaTAlgorithm(EspenakMeeus) | 65 | , currentDeltaTAlgorithm(EspenakMeeus) |
1132 | 66 | , position(NULL) | 66 | , position(NULL) |
1133 | 67 | , timeSpeed(JD_SECOND) | 67 | , timeSpeed(JD_SECOND) |
1135 | 68 | , JDay(0.) | 68 | , JD(0.,0.) |
1136 | 69 | , presetSkyTime(0.) | 69 | , presetSkyTime(0.) |
1139 | 70 | , secondsOfLastJDayUpdate(0.) | 70 | , secondsOfLastJDUpdate(0.) |
1140 | 71 | , JDayOfLastJDayUpdate(0.) | 71 | , jdOfLastJDUpdate(0.) |
1141 | 72 | , deltaTCustomNDot(-26.0) | 72 | , deltaTCustomNDot(-26.0) |
1142 | 73 | , deltaTCustomYear(1820.0) | 73 | , deltaTCustomYear(1820.0) |
1143 | 74 | { | 74 | { |
1144 | @@ -173,7 +173,7 @@ | |||
1145 | 173 | setInitTodayTime(QTime::fromString(conf->value("navigation/today_time", "22:00").toString())); | 173 | setInitTodayTime(QTime::fromString(conf->value("navigation/today_time", "22:00").toString())); |
1146 | 174 | startupTimeMode = conf->value("navigation/startup_time_mode", "actual").toString().toLower(); | 174 | startupTimeMode = conf->value("navigation/startup_time_mode", "actual").toString().toLower(); |
1147 | 175 | if (startupTimeMode=="preset") | 175 | if (startupTimeMode=="preset") |
1149 | 176 | setJDay(presetSkyTime - StelUtils::getGMTShiftFromQT(presetSkyTime) * JD_HOUR); | 176 | setJD(presetSkyTime - StelUtils::getGMTShiftFromQT(presetSkyTime) * JD_HOUR); |
1150 | 177 | else if (startupTimeMode=="today") | 177 | else if (startupTimeMode=="today") |
1151 | 178 | setTodayTime(getInitTodayTime()); | 178 | setTodayTime(getInitTodayTime()); |
1152 | 179 | 179 | ||
1153 | @@ -766,7 +766,7 @@ | |||
1154 | 766 | // called in update() (for every frame) | 766 | // called in update() (for every frame) |
1155 | 767 | void StelCore::updateTransformMatrices() | 767 | void StelCore::updateTransformMatrices() |
1156 | 768 | { | 768 | { |
1158 | 769 | matAltAzToEquinoxEqu = position->getRotAltAzToEquatorial(JDay); | 769 | matAltAzToEquinoxEqu = position->getRotAltAzToEquatorial(getJD(), getJDE()); |
1159 | 770 | matEquinoxEquToAltAz = matAltAzToEquinoxEqu.transpose(); | 770 | matEquinoxEquToAltAz = matAltAzToEquinoxEqu.transpose(); |
1160 | 771 | 771 | ||
1161 | 772 | // multiply static J2000 earth axis tilt (eclipticalJ2000<->equatorialJ2000) | 772 | // multiply static J2000 earth axis tilt (eclipticalJ2000<->equatorialJ2000) |
1162 | @@ -865,26 +865,40 @@ | |||
1163 | 865 | smmgr->zoomTo(smmgr->getInitFov(), 1.); | 865 | smmgr->zoomTo(smmgr->getInitFov(), 1.); |
1164 | 866 | } | 866 | } |
1165 | 867 | 867 | ||
1176 | 868 | void StelCore::setJDay(double JD) | 868 | void StelCore::setJD(double newJD) |
1177 | 869 | { | 869 | { |
1178 | 870 | JDay=JD; | 870 | JD.first=newJD; |
1179 | 871 | resetSync(); | 871 | JD.second=computeDeltaT(newJD); |
1180 | 872 | } | 872 | resetSync(); |
1181 | 873 | 873 | } | |
1182 | 874 | double StelCore::getJDay() const | 874 | |
1183 | 875 | { | 875 | double StelCore::getJD() const |
1184 | 876 | return JDay; | 876 | { |
1185 | 877 | } | 877 | return JD.first; |
1186 | 878 | } | ||
1187 | 879 | |||
1188 | 880 | void StelCore::setJDE(double newJDE) | ||
1189 | 881 | { | ||
1190 | 882 | // nitpickerish this is not exact, but as good as it gets... | ||
1191 | 883 | JD.second=computeDeltaT(newJDE); | ||
1192 | 884 | JD.first=newJDE-JD.second/86400.0; | ||
1193 | 885 | resetSync(); | ||
1194 | 886 | } | ||
1195 | 887 | |||
1196 | 888 | double StelCore::getJDE() const | ||
1197 | 889 | { | ||
1198 | 890 | return JD.first+JD.second/86400.0; | ||
1199 | 891 | } | ||
1200 | 892 | |||
1201 | 878 | 893 | ||
1202 | 879 | void StelCore::setMJDay(double MJD) | 894 | void StelCore::setMJDay(double MJD) |
1203 | 880 | { | 895 | { |
1206 | 881 | JDay=MJD+2400000.5; | 896 | setJD(MJD+2400000.5); |
1205 | 882 | resetSync(); | ||
1207 | 883 | } | 897 | } |
1208 | 884 | 898 | ||
1209 | 885 | double StelCore::getMJDay() const | 899 | double StelCore::getMJDay() const |
1210 | 886 | { | 900 | { |
1212 | 887 | return JDay-2400000.5; | 901 | return JD.first-2400000.5; |
1213 | 888 | } | 902 | } |
1214 | 889 | 903 | ||
1215 | 890 | double StelCore::getPresetSkyTime() const | 904 | double StelCore::getPresetSkyTime() const |
1216 | @@ -993,9 +1007,7 @@ | |||
1217 | 993 | //! Set stellarium time to current real world time | 1007 | //! Set stellarium time to current real world time |
1218 | 994 | void StelCore::setTimeNow() | 1008 | void StelCore::setTimeNow() |
1219 | 995 | { | 1009 | { |
1223 | 996 | double JD = StelUtils::getJDFromSystem(); | 1010 | setJD(StelUtils::getJDFromSystem()); |
1221 | 997 | // add Delta-T correction for actual time | ||
1222 | 998 | setJDay(JD+getDeltaT(JD)/86400); | ||
1224 | 999 | } | 1011 | } |
1225 | 1000 | 1012 | ||
1226 | 1001 | void StelCore::setTodayTime(const QTime& target) | 1013 | void StelCore::setTodayTime(const QTime& target) |
1227 | @@ -1006,7 +1018,7 @@ | |||
1228 | 1006 | dt.setTime(target); | 1018 | dt.setTime(target); |
1229 | 1007 | // don't forget to adjust for timezone / daylight savings. | 1019 | // don't forget to adjust for timezone / daylight savings. |
1230 | 1008 | double JD = StelUtils::qDateTimeToJd(dt)-(StelUtils::getGMTShiftFromQT(StelUtils::getJDFromSystem()) * JD_HOUR); | 1020 | double JD = StelUtils::qDateTimeToJd(dt)-(StelUtils::getGMTShiftFromQT(StelUtils::getJDFromSystem()) * JD_HOUR); |
1232 | 1009 | setJDay(JD + getDeltaT(JD)/86400); | 1021 | setJD(JD); |
1233 | 1010 | } | 1022 | } |
1234 | 1011 | else | 1023 | else |
1235 | 1012 | { | 1024 | { |
1236 | @@ -1019,12 +1031,12 @@ | |||
1237 | 1019 | bool StelCore::getIsTimeNow(void) const | 1031 | bool StelCore::getIsTimeNow(void) const |
1238 | 1020 | { | 1032 | { |
1239 | 1021 | // cache last time to prevent to much slow system call | 1033 | // cache last time to prevent to much slow system call |
1243 | 1022 | static double lastJD = getJDay(); | 1034 | static double lastJD = getJD(); |
1244 | 1023 | static bool previousResult = (fabs(getJDay()-(StelUtils::getJDFromSystem()+getDeltaT(lastJD)/86400))<JD_SECOND); | 1035 | static bool previousResult = (fabs(getJD()-(StelUtils::getJDFromSystem()))<JD_SECOND); |
1245 | 1024 | if (fabs(lastJD-getJDay())>JD_SECOND/4) | 1036 | if (fabs(lastJD-getJD())>JD_SECOND/4) |
1246 | 1025 | { | 1037 | { |
1249 | 1026 | lastJD = getJDay(); | 1038 | lastJD = getJD(); |
1250 | 1027 | previousResult = (fabs(getJDay()-(StelUtils::getJDFromSystem()+getDeltaT(lastJD)/86400))<JD_SECOND); | 1039 | previousResult = (fabs(getJD()-(StelUtils::getJDFromSystem()))<JD_SECOND); |
1251 | 1028 | } | 1040 | } |
1252 | 1029 | return previousResult; | 1041 | return previousResult; |
1253 | 1030 | } | 1042 | } |
1254 | @@ -1034,14 +1046,14 @@ | |||
1255 | 1034 | return initTodayTime; | 1046 | return initTodayTime; |
1256 | 1035 | } | 1047 | } |
1257 | 1036 | 1048 | ||
1259 | 1037 | void StelCore::setInitTodayTime(const QTime& t) | 1049 | void StelCore::setInitTodayTime(const QTime& time) |
1260 | 1038 | { | 1050 | { |
1262 | 1039 | initTodayTime=t; | 1051 | initTodayTime=time; |
1263 | 1040 | } | 1052 | } |
1264 | 1041 | 1053 | ||
1266 | 1042 | void StelCore::setPresetSkyTime(QDateTime dt) | 1054 | void StelCore::setPresetSkyTime(QDateTime dateTime) |
1267 | 1043 | { | 1055 | { |
1269 | 1044 | setPresetSkyTime(StelUtils::qDateTimeToJd(dt)); | 1056 | setPresetSkyTime(StelUtils::qDateTimeToJd(dateTime)); |
1270 | 1045 | } | 1057 | } |
1271 | 1046 | 1058 | ||
1272 | 1047 | void StelCore::addHour() | 1059 | void StelCore::addHour() |
1273 | @@ -1250,7 +1262,7 @@ | |||
1274 | 1250 | if (home->getEnglishName() != "Solar System Observer") | 1262 | if (home->getEnglishName() != "Solar System Observer") |
1275 | 1251 | d *= home->getMeanSolarDay(); | 1263 | d *= home->getMeanSolarDay(); |
1276 | 1252 | 1264 | ||
1278 | 1253 | setJDay(getJDay() + d); | 1265 | setJD(getJD() + d); |
1279 | 1254 | } | 1266 | } |
1280 | 1255 | 1267 | ||
1281 | 1256 | void StelCore::addSiderealDays(double d) | 1268 | void StelCore::addSiderealDays(double d) |
1282 | @@ -1258,13 +1270,14 @@ | |||
1283 | 1258 | const PlanetP& home = position->getHomePlanet(); | 1270 | const PlanetP& home = position->getHomePlanet(); |
1284 | 1259 | if (home->getEnglishName() != "Solar System Observer") | 1271 | if (home->getEnglishName() != "Solar System Observer") |
1285 | 1260 | d *= home->getSiderealDay(); | 1272 | d *= home->getSiderealDay(); |
1287 | 1261 | setJDay(getJDay() + d); | 1273 | setJD(getJD() + d); |
1288 | 1262 | } | 1274 | } |
1289 | 1263 | 1275 | ||
1290 | 1264 | // Get the sidereal time shifted by the observer longitude | 1276 | // Get the sidereal time shifted by the observer longitude |
1291 | 1265 | double StelCore::getLocalSiderealTime() const | 1277 | double StelCore::getLocalSiderealTime() const |
1292 | 1266 | { | 1278 | { |
1294 | 1267 | return (position->getHomePlanet()->getSiderealTime(JDay)+position->getCurrentLocation().longitude)*M_PI/180.; | 1279 | // On Earth, this requires UT deliberately with all its faults, on other planets we use the more regular TT. |
1295 | 1280 | return (position->getHomePlanet()->getSiderealTime(getJD(), getJDE())+position->getCurrentLocation().longitude)*M_PI/180.; | ||
1296 | 1268 | } | 1281 | } |
1297 | 1269 | 1282 | ||
1298 | 1270 | //! Get the duration of a sidereal day for the current observer in day. | 1283 | //! Get the duration of a sidereal day for the current observer in day. |
1299 | @@ -1353,16 +1366,19 @@ | |||
1300 | 1353 | if (getRealTimeSpeed()) | 1366 | if (getRealTimeSpeed()) |
1301 | 1354 | { | 1367 | { |
1302 | 1355 | // Get rid of the error from the 1 / | 1368 | // Get rid of the error from the 1 / |
1304 | 1356 | JDay = JDayOfLastJDayUpdate + (StelApp::getTotalRunTime() - secondsOfLastJDayUpdate) / ONE_OVER_JD_SECOND; | 1369 | // JDay = JDayOfLastJDayUpdate + (StelApp::getTotalRunTime() - secondsOfLastJDayUpdate) / ONE_OVER_JD_SECOND; |
1305 | 1370 | // GZ I don't understand the comment. Is the constant wrong? | ||
1306 | 1371 | JD.first = jdOfLastJDUpdate + (StelApp::getTotalRunTime() - secondsOfLastJDUpdate) * JD_SECOND; | ||
1307 | 1357 | } | 1372 | } |
1308 | 1358 | else | 1373 | else |
1309 | 1359 | { | 1374 | { |
1311 | 1360 | JDay = JDayOfLastJDayUpdate + (StelApp::getTotalRunTime() - secondsOfLastJDayUpdate) * timeSpeed; | 1375 | JD.first = jdOfLastJDUpdate + (StelApp::getTotalRunTime() - secondsOfLastJDUpdate) * timeSpeed; |
1312 | 1361 | } | 1376 | } |
1313 | 1362 | 1377 | ||
1314 | 1363 | // Fix time limits to -100000 to +100000 to prevent bugs | 1378 | // Fix time limits to -100000 to +100000 to prevent bugs |
1317 | 1364 | if (JDay>38245309.499988) JDay = 38245309.499988; | 1379 | if (JD.first>38245309.499988) JD.first = 38245309.499988; |
1318 | 1365 | if (JDay<-34803211.500012) JDay = -34803211.500012; | 1380 | if (JD.first<-34803211.500012) JD.first = -34803211.500012; |
1319 | 1381 | JD.second=computeDeltaT(JD.first); | ||
1320 | 1366 | 1382 | ||
1321 | 1367 | if (position->isObserverLifeOver()) | 1383 | if (position->isObserverLifeOver()) |
1322 | 1368 | { | 1384 | { |
1323 | @@ -1380,14 +1396,16 @@ | |||
1324 | 1380 | position->update(deltaTime); | 1396 | position->update(deltaTime); |
1325 | 1381 | 1397 | ||
1326 | 1382 | // Position of sun and all the satellites (ie planets) | 1398 | // Position of sun and all the satellites (ie planets) |
1329 | 1383 | SolarSystem* solsystem = (SolarSystem*)StelApp::getInstance().getModuleMgr().getModule("SolarSystem"); | 1399 | // GZ maybe setting this static can speedup a bit? |
1330 | 1384 | solsystem->computePositions(getJDay(), position->getHomePlanet()->getHeliocentricEclipticPos()); | 1400 | static SolarSystem* solsystem = (SolarSystem*)StelApp::getInstance().getModuleMgr().getModule("SolarSystem"); |
1331 | 1401 | // Likely the most important location where we need JDE: | ||
1332 | 1402 | solsystem->computePositions(getJDE(), position->getHomePlanet()->getHeliocentricEclipticPos()); | ||
1333 | 1385 | } | 1403 | } |
1334 | 1386 | 1404 | ||
1335 | 1387 | void StelCore::resetSync() | 1405 | void StelCore::resetSync() |
1336 | 1388 | { | 1406 | { |
1339 | 1389 | JDayOfLastJDayUpdate = getJDay(); | 1407 | jdOfLastJDUpdate = getJD(); |
1340 | 1390 | secondsOfLastJDayUpdate = StelApp::getTotalRunTime(); | 1408 | secondsOfLastJDUpdate = StelApp::getTotalRunTime(); |
1341 | 1391 | } | 1409 | } |
1342 | 1392 | 1410 | ||
1343 | 1393 | void StelCore::setStartupTimeMode(const QString& s) | 1411 | void StelCore::setStartupTimeMode(const QString& s) |
1344 | @@ -1395,7 +1413,15 @@ | |||
1345 | 1395 | startupTimeMode = s; | 1413 | startupTimeMode = s; |
1346 | 1396 | } | 1414 | } |
1347 | 1397 | 1415 | ||
1349 | 1398 | double StelCore::getDeltaT(double jDay) const | 1416 | // return precomputed DeltaT in seconds. Public. |
1350 | 1417 | double StelCore::getDeltaT() const | ||
1351 | 1418 | { | ||
1352 | 1419 | return JD.second; | ||
1353 | 1420 | } | ||
1354 | 1421 | |||
1355 | 1422 | |||
1356 | 1423 | // compute and return DeltaT in seconds. Try not to call it directly, current DeltaT, JD, and JDE are available. | ||
1357 | 1424 | double StelCore::computeDeltaT(const double JD) const | ||
1358 | 1399 | { | 1425 | { |
1359 | 1400 | double DeltaT = 0.; | 1426 | double DeltaT = 0.; |
1360 | 1401 | double ndot = 0.; | 1427 | double ndot = 0.; |
1361 | @@ -1410,149 +1436,156 @@ | |||
1362 | 1410 | case Schoch: | 1436 | case Schoch: |
1363 | 1411 | // Schoch (1931) algorithm for DeltaT | 1437 | // Schoch (1931) algorithm for DeltaT |
1364 | 1412 | ndot = -29.68; // n.dot = -29.68"/cy/cy | 1438 | ndot = -29.68; // n.dot = -29.68"/cy/cy |
1366 | 1413 | DeltaT = StelUtils::getDeltaTBySchoch(jDay); | 1439 | DeltaT = StelUtils::getDeltaTBySchoch(JD); |
1367 | 1414 | break; | 1440 | break; |
1368 | 1415 | case Clemence: | 1441 | case Clemence: |
1369 | 1416 | // Clemence (1948) algorithm for DeltaT | 1442 | // Clemence (1948) algorithm for DeltaT |
1370 | 1417 | ndot = -22.44; // n.dot = -22.44 "/cy/cy | 1443 | ndot = -22.44; // n.dot = -22.44 "/cy/cy |
1372 | 1418 | DeltaT = StelUtils::getDeltaTByClemence(jDay); | 1444 | DeltaT = StelUtils::getDeltaTByClemence(JD); |
1373 | 1419 | break; | 1445 | break; |
1374 | 1420 | case IAU: | 1446 | case IAU: |
1375 | 1421 | // IAU (1952) algorithm for DeltaT, based on observations by Spencer Jones (1939) | 1447 | // IAU (1952) algorithm for DeltaT, based on observations by Spencer Jones (1939) |
1376 | 1422 | ndot = -22.44; // n.dot = -22.44 "/cy/cy | 1448 | ndot = -22.44; // n.dot = -22.44 "/cy/cy |
1378 | 1423 | DeltaT = StelUtils::getDeltaTByIAU(jDay); | 1449 | DeltaT = StelUtils::getDeltaTByIAU(JD); |
1379 | 1424 | break; | 1450 | break; |
1380 | 1425 | case AstronomicalEphemeris: | 1451 | case AstronomicalEphemeris: |
1381 | 1426 | // Astronomical Ephemeris (1960) algorithm for DeltaT | 1452 | // Astronomical Ephemeris (1960) algorithm for DeltaT |
1382 | 1427 | ndot = -22.44; // n.dot = -22.44 "/cy/cy | 1453 | ndot = -22.44; // n.dot = -22.44 "/cy/cy |
1384 | 1428 | DeltaT = StelUtils::getDeltaTByAstronomicalEphemeris(jDay); | 1454 | DeltaT = StelUtils::getDeltaTByAstronomicalEphemeris(JD); |
1385 | 1429 | break; | 1455 | break; |
1386 | 1430 | case TuckermanGoldstine: | 1456 | case TuckermanGoldstine: |
1387 | 1431 | // Tuckerman (1962, 1964) & Goldstine (1973) algorithm for DeltaT | 1457 | // Tuckerman (1962, 1964) & Goldstine (1973) algorithm for DeltaT |
1388 | 1432 | //FIXME: n.dot | 1458 | //FIXME: n.dot |
1389 | 1433 | ndot = -22.44; // n.dot = -22.44 "/cy/cy ??? | 1459 | ndot = -22.44; // n.dot = -22.44 "/cy/cy ??? |
1391 | 1434 | DeltaT = StelUtils::getDeltaTByTuckermanGoldstine(jDay); | 1460 | DeltaT = StelUtils::getDeltaTByTuckermanGoldstine(JD); |
1392 | 1435 | break; | 1461 | break; |
1393 | 1436 | case MullerStephenson: | 1462 | case MullerStephenson: |
1394 | 1437 | // Muller & Stephenson (1975) algorithm for DeltaT | 1463 | // Muller & Stephenson (1975) algorithm for DeltaT |
1395 | 1438 | ndot = -37.5; // n.dot = -37.5 "/cy/cy | 1464 | ndot = -37.5; // n.dot = -37.5 "/cy/cy |
1397 | 1439 | DeltaT = StelUtils::getDeltaTByMullerStephenson(jDay); | 1465 | DeltaT = StelUtils::getDeltaTByMullerStephenson(JD); |
1398 | 1440 | break; | 1466 | break; |
1399 | 1441 | case Stephenson1978: | 1467 | case Stephenson1978: |
1400 | 1442 | // Stephenson (1978) algorithm for DeltaT | 1468 | // Stephenson (1978) algorithm for DeltaT |
1401 | 1443 | ndot = -30.0; // n.dot = -30.0 "/cy/cy | 1469 | ndot = -30.0; // n.dot = -30.0 "/cy/cy |
1403 | 1444 | DeltaT = StelUtils::getDeltaTByStephenson1978(jDay); | 1470 | DeltaT = StelUtils::getDeltaTByStephenson1978(JD); |
1404 | 1445 | break; | 1471 | break; |
1405 | 1446 | case SchmadelZech1979: | 1472 | case SchmadelZech1979: |
1406 | 1447 | // Schmadel & Zech (1979) algorithm for DeltaT | 1473 | // Schmadel & Zech (1979) algorithm for DeltaT |
1407 | 1448 | ndot = -23.8946; // n.dot = -23.8946 "/cy/cy | 1474 | ndot = -23.8946; // n.dot = -23.8946 "/cy/cy |
1409 | 1449 | DeltaT = StelUtils::getDeltaTBySchmadelZech1979(jDay); | 1475 | DeltaT = StelUtils::getDeltaTBySchmadelZech1979(JD); |
1410 | 1450 | break; | 1476 | break; |
1411 | 1451 | case MorrisonStephenson1982: | 1477 | case MorrisonStephenson1982: |
1412 | 1452 | // Morrison & Stephenson (1982) algorithm for DeltaT (used by RedShift) | 1478 | // Morrison & Stephenson (1982) algorithm for DeltaT (used by RedShift) |
1413 | 1453 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1479 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1415 | 1454 | DeltaT = StelUtils::getDeltaTByMorrisonStephenson1982(jDay); | 1480 | DeltaT = StelUtils::getDeltaTByMorrisonStephenson1982(JD); |
1416 | 1455 | break; | 1481 | break; |
1417 | 1456 | case StephensonMorrison1984: | 1482 | case StephensonMorrison1984: |
1418 | 1457 | // Stephenson & Morrison (1984) algorithm for DeltaT | 1483 | // Stephenson & Morrison (1984) algorithm for DeltaT |
1419 | 1458 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1484 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1421 | 1459 | DeltaT = StelUtils::getDeltaTByStephensonMorrison1984(jDay); | 1485 | DeltaT = StelUtils::getDeltaTByStephensonMorrison1984(JD); |
1422 | 1460 | break; | 1486 | break; |
1423 | 1461 | case StephensonHoulden: | 1487 | case StephensonHoulden: |
1424 | 1462 | // Stephenson & Houlden (1986) algorithm for DeltaT | 1488 | // Stephenson & Houlden (1986) algorithm for DeltaT |
1425 | 1463 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1489 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1427 | 1464 | DeltaT = StelUtils::getDeltaTByStephensonHoulden(jDay); | 1490 | DeltaT = StelUtils::getDeltaTByStephensonHoulden(JD); |
1428 | 1465 | break; | 1491 | break; |
1429 | 1466 | case Espenak: | 1492 | case Espenak: |
1430 | 1467 | // Espenak (1987, 1989) algorithm for DeltaT | 1493 | // Espenak (1987, 1989) algorithm for DeltaT |
1431 | 1468 | //FIXME: n.dot | 1494 | //FIXME: n.dot |
1432 | 1469 | ndot = -23.8946; // n.dot = -23.8946 "/cy/cy ??? | 1495 | ndot = -23.8946; // n.dot = -23.8946 "/cy/cy ??? |
1434 | 1470 | DeltaT = StelUtils::getDeltaTByEspenak(jDay); | 1496 | DeltaT = StelUtils::getDeltaTByEspenak(JD); |
1435 | 1471 | break; | 1497 | break; |
1436 | 1472 | case Borkowski: | 1498 | case Borkowski: |
1437 | 1473 | // Borkowski (1988) algorithm for DeltaT, relates to ELP2000-85! | 1499 | // Borkowski (1988) algorithm for DeltaT, relates to ELP2000-85! |
1438 | 1474 | ndot = -23.895; // GZ: I see -23.895 in the paper, not -23.859; (?) // n.dot = -23.859 "/cy/cy | 1500 | ndot = -23.895; // GZ: I see -23.895 in the paper, not -23.859; (?) // n.dot = -23.859 "/cy/cy |
1440 | 1475 | DeltaT = StelUtils::getDeltaTByBorkowski(jDay); | 1501 | DeltaT = StelUtils::getDeltaTByBorkowski(JD); |
1441 | 1476 | break; | 1502 | break; |
1442 | 1477 | case SchmadelZech1988: | 1503 | case SchmadelZech1988: |
1443 | 1478 | // Schmadel & Zech (1988) algorithm for DeltaT | 1504 | // Schmadel & Zech (1988) algorithm for DeltaT |
1444 | 1479 | //FIXME: n.dot | 1505 | //FIXME: n.dot |
1445 | 1480 | ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? | 1506 | ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? |
1447 | 1481 | DeltaT = StelUtils::getDeltaTBySchmadelZech1988(jDay); | 1507 | DeltaT = StelUtils::getDeltaTBySchmadelZech1988(JD); |
1448 | 1482 | break; | 1508 | break; |
1449 | 1483 | case ChaprontTouze: | 1509 | case ChaprontTouze: |
1450 | 1484 | // Chapront-Touzé & Chapront (1991) algorithm for DeltaT | 1510 | // Chapront-Touzé & Chapront (1991) algorithm for DeltaT |
1451 | 1485 | ndot = -23.8946; // n.dot = -23.8946 "/cy/cy | 1511 | ndot = -23.8946; // n.dot = -23.8946 "/cy/cy |
1453 | 1486 | DeltaT = StelUtils::getDeltaTByChaprontTouze(jDay); | 1512 | DeltaT = StelUtils::getDeltaTByChaprontTouze(JD); |
1454 | 1487 | break; | 1513 | break; |
1455 | 1488 | case StephensonMorrison1995: | 1514 | case StephensonMorrison1995: |
1456 | 1489 | // Stephenson & Morrison (1995) algorithm for DeltaT | 1515 | // Stephenson & Morrison (1995) algorithm for DeltaT |
1457 | 1490 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1516 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1459 | 1491 | DeltaT = StelUtils::getDeltaTByStephensonMorrison1995(jDay); | 1517 | DeltaT = StelUtils::getDeltaTByStephensonMorrison1995(JD); |
1460 | 1492 | break; | 1518 | break; |
1461 | 1493 | case Stephenson1997: | 1519 | case Stephenson1997: |
1462 | 1494 | // Stephenson (1997) algorithm for DeltaT | 1520 | // Stephenson (1997) algorithm for DeltaT |
1463 | 1495 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1521 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1465 | 1496 | DeltaT = StelUtils::getDeltaTByStephenson1997(jDay); | 1522 | DeltaT = StelUtils::getDeltaTByStephenson1997(JD); |
1466 | 1497 | break; | 1523 | break; |
1467 | 1498 | case ChaprontMeeus: | 1524 | case ChaprontMeeus: |
1468 | 1499 | // Chapront, Chapront-Touze & Francou (1997) & Meeus (1998) algorithm for DeltaT | 1525 | // Chapront, Chapront-Touze & Francou (1997) & Meeus (1998) algorithm for DeltaT |
1469 | 1500 | ndot = -25.7376; // n.dot = -25.7376 "/cy/cy | 1526 | ndot = -25.7376; // n.dot = -25.7376 "/cy/cy |
1471 | 1501 | DeltaT = StelUtils::getDeltaTByChaprontMeeus(jDay); | 1527 | DeltaT = StelUtils::getDeltaTByChaprontMeeus(JD); |
1472 | 1502 | break; | 1528 | break; |
1473 | 1503 | case JPLHorizons: | 1529 | case JPLHorizons: |
1474 | 1504 | // JPL Horizons algorithm for DeltaT | 1530 | // JPL Horizons algorithm for DeltaT |
1475 | 1505 | ndot = -25.7376; // n.dot = -25.7376 "/cy/cy | 1531 | ndot = -25.7376; // n.dot = -25.7376 "/cy/cy |
1477 | 1506 | DeltaT = StelUtils::getDeltaTByJPLHorizons(jDay); | 1532 | DeltaT = StelUtils::getDeltaTByJPLHorizons(JD); |
1478 | 1507 | break; | 1533 | break; |
1479 | 1508 | case MeeusSimons: | 1534 | case MeeusSimons: |
1480 | 1509 | // Meeus & Simons (2000) algorithm for DeltaT | 1535 | // Meeus & Simons (2000) algorithm for DeltaT |
1481 | 1510 | ndot = -25.7376; // n.dot = -25.7376 "/cy/cy | 1536 | ndot = -25.7376; // n.dot = -25.7376 "/cy/cy |
1483 | 1511 | DeltaT = StelUtils::getDeltaTByMeeusSimons(jDay); | 1537 | DeltaT = StelUtils::getDeltaTByMeeusSimons(JD); |
1484 | 1512 | break; | 1538 | break; |
1485 | 1513 | case ReingoldDershowitz: | 1539 | case ReingoldDershowitz: |
1486 | 1514 | // Reingold & Dershowitz (2002, 2007) algorithm for DeltaT | 1540 | // Reingold & Dershowitz (2002, 2007) algorithm for DeltaT |
1487 | 1515 | // FIXME: n.dot | 1541 | // FIXME: n.dot |
1488 | 1516 | ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? | 1542 | ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? |
1490 | 1517 | DeltaT = StelUtils::getDeltaTByReingoldDershowitz(jDay); | 1543 | DeltaT = StelUtils::getDeltaTByReingoldDershowitz(JD); |
1491 | 1518 | break; | 1544 | break; |
1492 | 1519 | case MontenbruckPfleger: | 1545 | case MontenbruckPfleger: |
1493 | 1520 | // Montenbruck & Pfleger (2000) algorithm for DeltaT | 1546 | // Montenbruck & Pfleger (2000) algorithm for DeltaT |
1494 | 1521 | // NOTE: book not contains n.dot value | 1547 | // NOTE: book not contains n.dot value |
1495 | 1522 | // FIXME: n.dot | 1548 | // FIXME: n.dot |
1496 | 1523 | ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? | 1549 | ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? |
1498 | 1524 | DeltaT = StelUtils::getDeltaTByMontenbruckPfleger(jDay); | 1550 | DeltaT = StelUtils::getDeltaTByMontenbruckPfleger(JD); |
1499 | 1525 | break; | 1551 | break; |
1500 | 1526 | case MorrisonStephenson2004: | 1552 | case MorrisonStephenson2004: |
1501 | 1527 | // Morrison & Stephenson (2004, 2005) algorithm for DeltaT | 1553 | // Morrison & Stephenson (2004, 2005) algorithm for DeltaT |
1502 | 1528 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1554 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1504 | 1529 | DeltaT = StelUtils::getDeltaTByMorrisonStephenson2004(jDay); | 1555 | DeltaT = StelUtils::getDeltaTByMorrisonStephenson2004(JD); |
1505 | 1530 | break; | 1556 | break; |
1506 | 1531 | case Reijs: | 1557 | case Reijs: |
1507 | 1532 | // Reijs (2006) algorithm for DeltaT | 1558 | // Reijs (2006) algorithm for DeltaT |
1508 | 1533 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1559 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1510 | 1534 | DeltaT = StelUtils::getDeltaTByReijs(jDay); | 1560 | DeltaT = StelUtils::getDeltaTByReijs(JD); |
1511 | 1535 | break; | 1561 | break; |
1512 | 1536 | case EspenakMeeus: | 1562 | case EspenakMeeus: |
1513 | 1537 | // Espenak & Meeus (2006) algorithm for DeltaT | 1563 | // Espenak & Meeus (2006) algorithm for DeltaT |
1514 | 1538 | ndot = -25.858; // n.dot = -25.858 "/cy/cy | 1564 | ndot = -25.858; // n.dot = -25.858 "/cy/cy |
1516 | 1539 | DeltaT = StelUtils::getDeltaTByEspenakMeeus(jDay); | 1565 | DeltaT = StelUtils::getDeltaTByEspenakMeeus(JD); |
1517 | 1566 | break; | ||
1518 | 1567 | case EspenakMeeusZeroMoonAccel: | ||
1519 | 1568 | // This is a trying area. Something is wrong with DeltaT, maybe ndot is still not applied correctly. | ||
1520 | 1569 | // Espenak & Meeus (2006) algorithm for DeltaT | ||
1521 | 1570 | ndot = -25.858; // n.dot = -25.858 "/cy/cy | ||
1522 | 1571 | dontUseMoon = true; | ||
1523 | 1572 | DeltaT = StelUtils::getDeltaTByEspenakMeeus(JD); | ||
1524 | 1540 | break; | 1573 | break; |
1525 | 1541 | case Banjevic: | 1574 | case Banjevic: |
1526 | 1542 | // Banjevic (2006) algorithm for DeltaT | 1575 | // Banjevic (2006) algorithm for DeltaT |
1527 | 1543 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1576 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1529 | 1544 | DeltaT = StelUtils::getDeltaTByBanjevic(jDay); | 1577 | DeltaT = StelUtils::getDeltaTByBanjevic(JD); |
1530 | 1545 | break; | 1578 | break; |
1531 | 1546 | case IslamSadiqQureshi: | 1579 | case IslamSadiqQureshi: |
1532 | 1547 | // Islam, Sadiq & Qureshi (2008 + revisited 2013) algorithm for DeltaT (6 polynomials) | 1580 | // Islam, Sadiq & Qureshi (2008 + revisited 2013) algorithm for DeltaT (6 polynomials) |
1533 | 1548 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1581 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1535 | 1549 | DeltaT = StelUtils::getDeltaTByIslamSadiqQureshi(jDay); | 1582 | DeltaT = StelUtils::getDeltaTByIslamSadiqQureshi(JD); |
1536 | 1550 | dontUseMoon = true; // Seems this solutions doesn't use value of secular acceleration of the Moon | 1583 | dontUseMoon = true; // Seems this solutions doesn't use value of secular acceleration of the Moon |
1537 | 1551 | break; | 1584 | break; |
1538 | 1552 | case KhalidSultanaZaidi: | 1585 | case KhalidSultanaZaidi: |
1539 | 1553 | // M. Khalid, Mariam Sultana and Faheem Zaidi polinomial approximation of time period 1620-2013 (2014) | 1586 | // M. Khalid, Mariam Sultana and Faheem Zaidi polinomial approximation of time period 1620-2013 (2014) |
1540 | 1554 | ndot = -26.0; // n.dot = -26.0 "/cy/cy | 1587 | ndot = -26.0; // n.dot = -26.0 "/cy/cy |
1542 | 1555 | DeltaT = StelUtils::getDeltaTByKhalidSultanaZaidi(jDay); | 1588 | DeltaT = StelUtils::getDeltaTByKhalidSultanaZaidi(JD); |
1543 | 1556 | dontUseMoon = true; // Seems this solutions doesn't use value of secular acceleration of the Moon | 1589 | dontUseMoon = true; // Seems this solutions doesn't use value of secular acceleration of the Moon |
1544 | 1557 | break; | 1590 | break; |
1545 | 1558 | case Custom: | 1591 | case Custom: |
1546 | @@ -1560,14 +1593,14 @@ | |||
1547 | 1560 | ndot = getDeltaTCustomNDot(); // n.dot = custom value "/cy/cy | 1593 | ndot = getDeltaTCustomNDot(); // n.dot = custom value "/cy/cy |
1548 | 1561 | int year, month, day; | 1594 | int year, month, day; |
1549 | 1562 | Vec3f coeff = getDeltaTCustomEquationCoefficients(); | 1595 | Vec3f coeff = getDeltaTCustomEquationCoefficients(); |
1551 | 1563 | StelUtils::getDateFromJulianDay(jDay, &year, &month, &day); | 1596 | StelUtils::getDateFromJulianDay(JD, &year, &month, &day); |
1552 | 1564 | double u = (StelUtils::getDecYear(year,month,day)-getDeltaTCustomYear())/100; | 1597 | double u = (StelUtils::getDecYear(year,month,day)-getDeltaTCustomYear())/100; |
1553 | 1565 | DeltaT = coeff[0] + u*(coeff[1] + u*coeff[2]); | 1598 | DeltaT = coeff[0] + u*(coeff[1] + u*coeff[2]); |
1554 | 1566 | break; | 1599 | break; |
1555 | 1567 | } | 1600 | } |
1556 | 1568 | 1601 | ||
1557 | 1569 | if (!dontUseMoon) | 1602 | if (!dontUseMoon) |
1559 | 1570 | DeltaT += StelUtils::getMoonSecularAcceleration(jDay, ndot); | 1603 | DeltaT += StelUtils::getMoonSecularAcceleration(JD, ndot); |
1560 | 1571 | 1604 | ||
1561 | 1572 | return DeltaT; | 1605 | return DeltaT; |
1562 | 1573 | } | 1606 | } |
1563 | @@ -1604,91 +1637,94 @@ | |||
1564 | 1604 | description = q_("Correction is disabled. Use only if you know what you are doing!"); | 1637 | description = q_("Correction is disabled. Use only if you know what you are doing!"); |
1565 | 1605 | break; | 1638 | break; |
1566 | 1606 | case Schoch: // historical value. | 1639 | case Schoch: // historical value. |
1568 | 1607 | description = q_("This historical formula was obtained by C. Schoch in 1931 and was used by G. Henriksson in his article <em>Einstein's Theory of Relativity Confirmed by Ancient Solar Eclipses</em> (%1). See for more info %2here%3.").arg("2009").arg("<a href='http://journalofcosmology.com/AncientAstronomy123.html'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1640 | description = q_("This historical formula was obtained by C. Schoch in 1931 and was used by G. Henriksson in his article <em>Einstein's Theory of Relativity Confirmed by Ancient Solar Eclipses</em> (%1). See for more info %2here%3.").arg("2009").arg("<a href='http://journalofcosmology.com/AncientAstronomy123.html'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1569 | 1608 | break; | 1641 | break; |
1570 | 1609 | case Clemence: // historical value. | 1642 | case Clemence: // historical value. |
1572 | 1610 | description = q_("This empirical equation was published by G. M. Clemence in the article <em>On the system of astronomical constants</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1948AJ.....53..169C'>1948</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1643 | description = q_("This empirical equation was published by G. M. Clemence in the article <em>On the system of astronomical constants</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1948AJ.....53..169C'>1948</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1573 | 1611 | break; | 1644 | break; |
1574 | 1612 | case IAU: // historical value. | 1645 | case IAU: // historical value. |
1576 | 1613 | description = q_("This formula is based on a study of post-1650 observations of the Sun, the Moon and the planets by Spencer Jones (%1) and used by Jean Meeus in his <em>Astronomical Formulae for Calculators</em>. It was also adopted in the PC program SunTracker Pro.").arg("<a href='http://adsabs.harvard.edu/abs/1939MNRAS..99..541S'>1939</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1646 | description = q_("This formula is based on a study of post-1650 observations of the Sun, the Moon and the planets by Spencer Jones (%1) and used by Jean Meeus in his <em>Astronomical Formulae for Calculators</em>. It was also adopted in the PC program SunTracker Pro.").arg("<a href='http://adsabs.harvard.edu/abs/1939MNRAS..99..541S'>1939</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1577 | 1614 | // find year of publication of AFFC | 1647 | // find year of publication of AFFC |
1578 | 1615 | break; | 1648 | break; |
1579 | 1616 | case AstronomicalEphemeris: // historical value. | 1649 | case AstronomicalEphemeris: // historical value. |
1581 | 1617 | description = q_("This is a slightly modified version of the IAU (1952) formula which was adopted in the <em>Astronomical Ephemeris</em> and in the <em>Canon of Solar Eclipses</em> by Mucke & Meeus (1983).").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1650 | description = q_("This is a slightly modified version of the IAU (1952) formula which was adopted in the <em>Astronomical Ephemeris</em> and in the <em>Canon of Solar Eclipses</em> by Mucke & Meeus (1983).").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1582 | 1618 | // TODO: expand the sentence: ... adopted ... from 19xx-19yy? | 1651 | // TODO: expand the sentence: ... adopted ... from 19xx-19yy? |
1583 | 1619 | break; | 1652 | break; |
1584 | 1620 | case TuckermanGoldstine: // historical value. | 1653 | case TuckermanGoldstine: // historical value. |
1586 | 1621 | description = q_("The tables of Tuckerman (1962, 1964) list the positions of the Sun, the Moon and the planets at 5- and 10-day intervals from 601 BCE to 1649 CE. The same relation was also implicitly adopted in the syzygy tables of Goldstine (1973).").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1654 | description = q_("The tables of Tuckerman (1962, 1964) list the positions of the Sun, the Moon and the planets at 5- and 10-day intervals from 601 BCE to 1649 CE. The same relation was also implicitly adopted in the syzygy tables of Goldstine (1973).").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1587 | 1622 | // TODO: These tables are sometimes found cited, but I have no details. Maybe add "based on ... " ? | 1655 | // TODO: These tables are sometimes found cited, but I have no details. Maybe add "based on ... " ? |
1588 | 1623 | break; | 1656 | break; |
1589 | 1624 | case MullerStephenson: | 1657 | case MullerStephenson: |
1591 | 1625 | description = q_("This equation was published by P. M. Muller and F. R. Stephenson in the article <em>The accelerations of the earth and moon from early astronomical observations</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1975grhe.conf..459M'>1975</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1658 | description = q_("This equation was published by P. M. Muller and F. R. Stephenson in the article <em>The accelerations of the earth and moon from early astronomical observations</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1975grhe.conf..459M'>1975</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1592 | 1626 | break; | 1659 | break; |
1593 | 1627 | case Stephenson1978: | 1660 | case Stephenson1978: |
1595 | 1628 | description = q_("This equation was published by F. R. Stephenson in the article <em>Pre-Telescopic Astronomical Observations</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1978tfer.conf....5S'>1978</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1661 | description = q_("This equation was published by F. R. Stephenson in the article <em>Pre-Telescopic Astronomical Observations</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1978tfer.conf....5S'>1978</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1596 | 1629 | break; | 1662 | break; |
1597 | 1630 | case SchmadelZech1979: // outdated data fit, historical value? | 1663 | case SchmadelZech1979: // outdated data fit, historical value? |
1599 | 1631 | description = q_("This 12th-order polynomial equation (outdated and superseded by Schmadel & Zech (1988)) was published by L. D. Schmadel and G. Zech in the article <em>Polynomial approximations for the correction delta T E.T.-U.T. in the period 1800-1975</em> (%1) as fit through data published by Brouwer (1952).").arg("<a href='http://adsabs.harvard.edu/abs/1979AcA....29..101S'>1979</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1664 | description = q_("This 12th-order polynomial equation (outdated and superseded by Schmadel & Zech (1988)) was published by L. D. Schmadel and G. Zech in the article <em>Polynomial approximations for the correction delta T E.T.-U.T. in the period 1800-1975</em> (%1) as fit through data published by Brouwer (1952).").arg("<a href='http://adsabs.harvard.edu/abs/1979AcA....29..101S'>1979</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1600 | 1632 | break; | 1665 | break; |
1601 | 1633 | case MorrisonStephenson1982: | 1666 | case MorrisonStephenson1982: |
1603 | 1634 | description = q_("This algorithm was adopted in P. Bretagnon & L. Simon's <em>Planetary Programs and Tables from -4000 to +2800</em> (1986) and in the PC planetarium program RedShift.").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1667 | description = q_("This algorithm was adopted in P. Bretagnon & L. Simon's <em>Planetary Programs and Tables from -4000 to +2800</em> (1986) and in the PC planetarium program RedShift.").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1604 | 1635 | break; | 1668 | break; |
1605 | 1636 | case StephensonMorrison1984: // PRIMARY SOURCE | 1669 | case StephensonMorrison1984: // PRIMARY SOURCE |
1607 | 1637 | description = q_("This formula was published by F. R. Stephenson and L. V. Morrison in the article <em>Long-term changes in the rotation of the earth - 700 B.C. to A.D. 1980</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1984RSPTA.313...47S'>1984</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1670 | description = q_("This formula was published by F. R. Stephenson and L. V. Morrison in the article <em>Long-term changes in the rotation of the earth - 700 B.C. to A.D. 1980</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1984RSPTA.313...47S'>1984</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1608 | 1638 | break; | 1671 | break; |
1609 | 1639 | case StephensonHoulden: | 1672 | case StephensonHoulden: |
1611 | 1640 | description = q_("This algorithm is used in the PC planetarium program Guide 7.").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1673 | description = q_("This algorithm is used in the PC planetarium program Guide 7.").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1612 | 1641 | break; | 1674 | break; |
1613 | 1642 | case Espenak: // limited range, but wide availability? | 1675 | case Espenak: // limited range, but wide availability? |
1615 | 1643 | description = q_("This algorithm was given by F. Espenak in his <em>Fifty Year Canon of Solar Eclipses: 1986-2035</em> (1987) and in his <em>Fifty Year Canon of Lunar Eclipses: 1986-2035</em> (1989).").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1676 | description = q_("This algorithm was given by F. Espenak in his <em>Fifty Year Canon of Solar Eclipses: 1986-2035</em> (1987) and in his <em>Fifty Year Canon of Lunar Eclipses: 1986-2035</em> (1989).").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1616 | 1644 | break; | 1677 | break; |
1617 | 1645 | case Borkowski: // Linked to ELP2000-85, so it's important... | 1678 | case Borkowski: // Linked to ELP2000-85, so it's important... |
1619 | 1646 | description = q_("This formula was obtained by K.M. Borkowski (%1) from an analysis of 31 solar eclipse records dating between 2137 BCE and 1715 CE.").arg("<a href='http://adsabs.harvard.edu/abs/1988A&A...205L...8B'>1988</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1679 | description = q_("This formula was obtained by K.M. Borkowski (%1) from an analysis of 31 solar eclipse records dating between 2137 BCE and 1715 CE.").arg("<a href='http://adsabs.harvard.edu/abs/1988A&A...205L...8B'>1988</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1620 | 1647 | break; | 1680 | break; |
1621 | 1648 | case SchmadelZech1988: // data fit through Stephenson&Morrison1984, which itself is important. Unclear who uses this version? | 1681 | case SchmadelZech1988: // data fit through Stephenson&Morrison1984, which itself is important. Unclear who uses this version? |
1623 | 1649 | description = q_("This 12th-order polynomial equation was published by L. D. Schmadel and G. Zech in the article <em>Empirical Transformations from U.T. to E.T. for the Period 1800-1988</em> (%1) as data fit through values given by Stephenson & Morrison (1984).").arg("<a href='http://adsabs.harvard.edu/abs/1988AN....309..219S'>1988</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1682 | description = q_("This 12th-order polynomial equation was published by L. D. Schmadel and G. Zech in the article <em>Empirical Transformations from U.T. to E.T. for the Period 1800-1988</em> (%1) as data fit through values given by Stephenson & Morrison (1984).").arg("<a href='http://adsabs.harvard.edu/abs/1988AN....309..219S'>1988</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1624 | 1650 | break; | 1683 | break; |
1625 | 1651 | case ChaprontTouze: | 1684 | case ChaprontTouze: |
1627 | 1652 | description = q_("This formula was adopted by M. Chapront-Touze & J. Chapront in the shortened version of the ELP 2000-85 lunar theory in their <em>Lunar Tables and Programs from 4000 B.C. to A.D. 8000</em> (1991).").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1685 | description = q_("This formula was adopted by M. Chapront-Touze & J. Chapront in the shortened version of the ELP 2000-85 lunar theory in their <em>Lunar Tables and Programs from 4000 B.C. to A.D. 8000</em> (1991).").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1628 | 1653 | break; | 1686 | break; |
1629 | 1654 | case StephensonMorrison1995: | 1687 | case StephensonMorrison1995: |
1631 | 1655 | description = q_("This equation was published by F. R. Stephenson and L. V. Morrison in the article <em>Long-Term Fluctuations in the Earth's Rotation: 700 BC to AD 1990</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1995RSPTA.351..165S'>1995</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1688 | description = q_("This equation was published by F. R. Stephenson and L. V. Morrison in the article <em>Long-Term Fluctuations in the Earth's Rotation: 700 BC to AD 1990</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1995RSPTA.351..165S'>1995</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1632 | 1656 | break; | 1689 | break; |
1633 | 1657 | case Stephenson1997: | 1690 | case Stephenson1997: |
1635 | 1658 | description = q_("F. R. Stephenson published this formula in his book <em>Historical Eclipses and Earth's Rotation</em> (%1).").arg("<a href='http://ebooks.cambridge.org/ebook.jsf?bid=CBO9780511525186'>1997</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1691 | description = q_("F. R. Stephenson published this formula in his book <em>Historical Eclipses and Earth's Rotation</em> (%1).").arg("<a href='http://ebooks.cambridge.org/ebook.jsf?bid=CBO9780511525186'>1997</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1636 | 1659 | break; | 1692 | break; |
1637 | 1660 | case ChaprontMeeus: | 1693 | case ChaprontMeeus: |
1639 | 1661 | description = q_("From J. Meeus, <em>Astronomical Algorithms</em> (2nd ed., 1998), and widely used. Table for 1620..2000, and includes a variant of Chapront, Chapront-Touze & Francou (1997) for dates outside 1620..2000.").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1694 | description = q_("From J. Meeus, <em>Astronomical Algorithms</em> (2nd ed., 1998), and widely used. Table for 1620..2000, and includes a variant of Chapront, Chapront-Touze & Francou (1997) for dates outside 1620..2000.").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1640 | 1662 | break; | 1695 | break; |
1641 | 1663 | case JPLHorizons: | 1696 | case JPLHorizons: |
1643 | 1664 | description = q_("The JPL Solar System Dynamics Group of the NASA Jet Propulsion Laboratory use this formula in their interactive website %1JPL Horizons%2.").arg("<a href='http://ssd.jpl.nasa.gov/?horizons'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1697 | description = q_("The JPL Solar System Dynamics Group of the NASA Jet Propulsion Laboratory use this formula in their interactive website %1JPL Horizons%2.").arg("<a href='http://ssd.jpl.nasa.gov/?horizons'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1644 | 1665 | break; | 1698 | break; |
1645 | 1666 | case MeeusSimons: | 1699 | case MeeusSimons: |
1647 | 1667 | description = q_("This polynome was published by J. Meeus and L. Simons in article <em>Polynomial approximations to Delta T, 1620-2000 AD</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/2000JBAA..110..323M'>2000</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1700 | description = q_("This polynome was published by J. Meeus and L. Simons in article <em>Polynomial approximations to Delta T, 1620-2000 AD</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/2000JBAA..110..323M'>2000</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1648 | 1668 | break; | 1701 | break; |
1649 | 1669 | case MontenbruckPfleger: // uninspired | 1702 | case MontenbruckPfleger: // uninspired |
1651 | 1670 | description = q_("The fourth edition of O. Montenbruck & T. Pfleger's <em>Astronomy on the Personal Computer</em> (2000) provides simple 3rd-order polynomial data fits for the recent past.").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1703 | description = q_("The fourth edition of O. Montenbruck & T. Pfleger's <em>Astronomy on the Personal Computer</em> (2000) provides simple 3rd-order polynomial data fits for the recent past.").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1652 | 1671 | break; | 1704 | break; |
1653 | 1672 | case ReingoldDershowitz: // | 1705 | case ReingoldDershowitz: // |
1655 | 1673 | description = q_("E. M. Reingold & N. Dershowitz present this polynomial data fit in <em>Calendrical Calculations</em> (3rd ed. 2007) and in their <em>Calendrical Tabulations</em> (2002). It is based on Jean Meeus' <em>Astronomical Algorithms</em> (1991).").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1706 | description = q_("E. M. Reingold & N. Dershowitz present this polynomial data fit in <em>Calendrical Calculations</em> (3rd ed. 2007) and in their <em>Calendrical Tabulations</em> (2002). It is based on Jean Meeus' <em>Astronomical Algorithms</em> (1991).").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1656 | 1674 | break; | 1707 | break; |
1657 | 1675 | case MorrisonStephenson2004: // PRIMARY SOURCE | 1708 | case MorrisonStephenson2004: // PRIMARY SOURCE |
1659 | 1676 | 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 addendum 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(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1709 | 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 addendum 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(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1660 | 1677 | break; | 1710 | break; |
1661 | 1678 | case Reijs: | 1711 | case Reijs: |
1663 | 1679 | description = q_("From the Length of Day (LOD; as determined 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 info %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(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1712 | description = q_("From the Length of Day (LOD; as determined 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 info %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(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1664 | 1680 | break; | 1713 | break; |
1665 | 1681 | case EspenakMeeus: // GENERAL SOLUTION | 1714 | case EspenakMeeus: // GENERAL SOLUTION |
1667 | 1682 | 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 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 planetary ephemeris program SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.gov/eclipse.html'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)).append(" <em>").append(q_("Used by default.")).append("</em>"); | 1715 | 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 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 planetary ephemeris program SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.gov/eclipse.html'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)).append(" <em>").append(q_("Used by default.")).append("</em>"); |
1668 | 1716 | break; | ||
1669 | 1717 | case EspenakMeeusZeroMoonAccel: // PATCHED SOLUTION | ||
1670 | 1718 | description = q_("PATCHED VERSION WITHOUT ADDITIONAL LUNAR ACCELERATION. 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 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 planetary ephemeris program SOLEX.").arg("<a href='http://eclipse.gsfc.nasa.gov/eclipse.html'>").arg("</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)).append(" <em>").append("</em>"); | ||
1671 | 1683 | break; | 1719 | break; |
1672 | 1684 | case Banjevic: | 1720 | case Banjevic: |
1674 | 1685 | description = q_("This solution by B. Banjevic, based on Stephenson & Morrison (1984), was published in article <em>Ancient eclipses and dating the fall of Babylon</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/2006POBeo..80..251B'>2006</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1721 | description = q_("This solution by B. Banjevic, based on Stephenson & Morrison (1984), was published in article <em>Ancient eclipses and dating the fall of Babylon</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/2006POBeo..80..251B'>2006</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1675 | 1686 | break; | 1722 | break; |
1676 | 1687 | case IslamSadiqQureshi: | 1723 | case IslamSadiqQureshi: |
1678 | 1688 | description = q_("This solution by S. Islam, M. Sadiq and M. S. Qureshi, based on Meeus & Simons (2000), was published in article <em>Error Minimization of Polynomial Approximation of DeltaT</em> (%1) and revisited by Sana Islam in 2013.").arg("<a href='http://www.ias.ac.in/jaa/dec2008/JAA610.pdf'>2008</a>").append(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1724 | description = q_("This solution by S. Islam, M. Sadiq and M. S. Qureshi, based on Meeus & Simons (2000), was published in article <em>Error Minimization of Polynomial Approximation of DeltaT</em> (%1) and revisited by Sana Islam in 2013.").arg("<a href='http://www.ias.ac.in/jaa/dec2008/JAA610.pdf'>2008</a>").append(getCurrentDeltaTAlgorithmValidRangeDescription(jd, &marker)); |
1679 | 1689 | break; | 1725 | break; |
1680 | 1690 | case KhalidSultanaZaidi: | 1726 | case KhalidSultanaZaidi: |
1682 | 1691 | 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(getCurrentDeltaTAlgorithmValidRange(jd, &marker)); | 1727 | 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)); |
1683 | 1692 | break; | 1728 | break; |
1684 | 1693 | case Custom: | 1729 | case Custom: |
1685 | 1694 | description = q_("This is a quadratic formula for calculation of %1T with coefficients defined by the user.").arg(QChar(0x0394)); | 1730 | description = q_("This is a quadratic formula for calculation of %1T with coefficients defined by the user.").arg(QChar(0x0394)); |
1686 | @@ -1699,7 +1735,7 @@ | |||
1687 | 1699 | return description; | 1735 | return description; |
1688 | 1700 | } | 1736 | } |
1689 | 1701 | 1737 | ||
1691 | 1702 | QString StelCore::getCurrentDeltaTAlgorithmValidRange(double jDay, QString *marker) const | 1738 | QString StelCore::getCurrentDeltaTAlgorithmValidRangeDescription(const double JD, QString *marker) const |
1692 | 1703 | { | 1739 | { |
1693 | 1704 | QString validRange = ""; | 1740 | QString validRange = ""; |
1694 | 1705 | QString validRangeAppendix = ""; | 1741 | QString validRangeAppendix = ""; |
1695 | @@ -1707,7 +1743,7 @@ | |||
1696 | 1707 | int year, month, day; | 1743 | int year, month, day; |
1697 | 1708 | int start = 0; | 1744 | int start = 0; |
1698 | 1709 | int finish = 0; | 1745 | int finish = 0; |
1700 | 1710 | StelUtils::getDateFromJulianDay(jDay, &year, &month, &day); | 1746 | StelUtils::getDateFromJulianDay(JD, &year, &month, &day); |
1701 | 1711 | switch (getCurrentDeltaTAlgorithm()) | 1747 | switch (getCurrentDeltaTAlgorithm()) |
1702 | 1712 | { | 1748 | { |
1703 | 1713 | case WithoutCorrection: | 1749 | case WithoutCorrection: |
1704 | @@ -1818,6 +1854,7 @@ | |||
1705 | 1818 | finish = 1100; // not 1620; // GZ: Not applicable for telescopic era, and better not after 1100 (pers.comm.) | 1854 | finish = 1100; // not 1620; // GZ: Not applicable for telescopic era, and better not after 1100 (pers.comm.) |
1706 | 1819 | break; | 1855 | break; |
1707 | 1820 | case EspenakMeeus: // the default, range stated in the Canon, p. 14. | 1856 | case EspenakMeeus: // the default, range stated in the Canon, p. 14. |
1708 | 1857 | case EspenakMeeusZeroMoonAccel: | ||
1709 | 1821 | start = -1999; | 1858 | start = -1999; |
1710 | 1822 | finish = 3000; | 1859 | finish = 3000; |
1711 | 1823 | break; | 1860 | break; |
1712 | @@ -1847,7 +1884,7 @@ | |||
1713 | 1847 | validRange = q_("Valid range of usage: between years %1 and %2, %3.").arg(start).arg(finish).arg(validRangeAppendix); | 1884 | validRange = q_("Valid range of usage: between years %1 and %2, %3.").arg(start).arg(finish).arg(validRangeAppendix); |
1714 | 1848 | else | 1885 | else |
1715 | 1849 | validRange = q_("Valid range of usage: between years %1 and %2.").arg(start).arg(finish); | 1886 | validRange = q_("Valid range of usage: between years %1 and %2.").arg(start).arg(finish); |
1717 | 1850 | if (start > year || year > finish) | 1887 | if ((year < start) || (finish < year)) |
1718 | 1851 | *marker = "*"; | 1888 | *marker = "*"; |
1719 | 1852 | } | 1889 | } |
1720 | 1853 | else | 1890 | else |
1721 | @@ -1857,8 +1894,7 @@ | |||
1722 | 1857 | } | 1894 | } |
1723 | 1858 | 1895 | ||
1724 | 1859 | // return if sky plus atmosphere is bright enough from sunlight so that e.g. screen labels should be rendered dark. | 1896 | // return if sky plus atmosphere is bright enough from sunlight so that e.g. screen labels should be rendered dark. |
1727 | 1860 | // Could be renamed to isBrightDaylight() | 1897 | bool StelCore::isBrightDaylight() const |
1726 | 1861 | bool StelCore::isDay() const | ||
1728 | 1862 | { | 1898 | { |
1729 | 1863 | const Vec3d& sunPos = GETSTELMODULE(SolarSystem)->getSun()->getAltAzPosGeometric(this); | 1899 | const Vec3d& sunPos = GETSTELMODULE(SolarSystem)->getSun()->getAltAzPosGeometric(this); |
1730 | 1864 | return sunPos[2] > -0.12; // Nautical twilight (0.12 > sin (6 deg), | 1900 | return sunPos[2] > -0.12; // Nautical twilight (0.12 > sin (6 deg), |
1731 | @@ -1866,5 +1902,5 @@ | |||
1732 | 1866 | 1902 | ||
1733 | 1867 | double StelCore::getCurrentEpoch() const | 1903 | double StelCore::getCurrentEpoch() const |
1734 | 1868 | { | 1904 | { |
1736 | 1869 | return 2000.0 + (getJDay() - 2451545.0)/365.25; | 1905 | return 2000.0 + (getJD() - 2451545.0)/365.25; |
1737 | 1870 | } | 1906 | } |
1738 | 1871 | 1907 | ||
1739 | === modified file 'src/core/StelCore.hpp' | |||
1740 | --- src/core/StelCore.hpp 2015-08-02 17:12:29 +0000 | |||
1741 | +++ src/core/StelCore.hpp 2015-08-03 13:17:13 +0000 | |||
1742 | @@ -28,6 +28,7 @@ | |||
1743 | 28 | #include <QString> | 28 | #include <QString> |
1744 | 29 | #include <QStringList> | 29 | #include <QStringList> |
1745 | 30 | #include <QTime> | 30 | #include <QTime> |
1746 | 31 | #include <QPair> | ||
1747 | 31 | 32 | ||
1748 | 32 | class StelToneReproducer; | 33 | class StelToneReproducer; |
1749 | 33 | class StelSkyDrawer; | 34 | class StelSkyDrawer; |
1750 | @@ -124,6 +125,7 @@ | |||
1751 | 124 | MorrisonStephenson2004, //!< Morrison & Stephenson (2004, 2005) algorithm for DeltaT | 125 | MorrisonStephenson2004, //!< Morrison & Stephenson (2004, 2005) algorithm for DeltaT |
1752 | 125 | Reijs, //!< Reijs (2006) algorithm for DeltaT | 126 | Reijs, //!< Reijs (2006) algorithm for DeltaT |
1753 | 126 | EspenakMeeus, //!< Espenak & Meeus (2006) algorithm for DeltaT (Recommended, default) | 127 | EspenakMeeus, //!< Espenak & Meeus (2006) algorithm for DeltaT (Recommended, default) |
1754 | 128 | EspenakMeeusZeroMoonAccel, // Espenak & Meeus (2006) algorithm for DeltaT (but without additional Lunar acceleration. FOR TESTING ONLY, NONPUBLIC) | ||
1755 | 127 | Banjevic, //!< Banjevic (2006) algorithm for DeltaT | 129 | Banjevic, //!< Banjevic (2006) algorithm for DeltaT |
1756 | 128 | IslamSadiqQureshi, //!< Islam, Sadiq & Qureshi (2008 + revisited 2013) algorithm for DeltaT (6 polynomials) | 130 | IslamSadiqQureshi, //!< Islam, Sadiq & Qureshi (2008 + revisited 2013) algorithm for DeltaT (6 polynomials) |
1757 | 129 | KhalidSultanaZaidi, //!< M. Khalid, Mariam Sultana and Faheem Zaidi polinomial approximation of time period 1620-2013 (2014) | 131 | KhalidSultanaZaidi, //!< M. Khalid, Mariam Sultana and Faheem Zaidi polinomial approximation of time period 1620-2013 (2014) |
1758 | @@ -269,7 +271,7 @@ | |||
1759 | 269 | //! This is used only if the destination planet is different from the starting one. | 271 | //! This is used only if the destination planet is different from the starting one. |
1760 | 270 | void moveObserverTo(const StelLocation& target, double duration=1., double durationIfPlanetChange=1.); | 272 | void moveObserverTo(const StelLocation& target, double duration=1., double durationIfPlanetChange=1.); |
1761 | 271 | 273 | ||
1763 | 272 | // Conversion in standar Julian time format | 274 | // Conversion in standard Julian time format |
1764 | 273 | static const double JD_SECOND; | 275 | static const double JD_SECOND; |
1765 | 274 | static const double JD_MINUTE; | 276 | static const double JD_MINUTE; |
1766 | 275 | static const double JD_HOUR; | 277 | static const double JD_HOUR; |
1767 | @@ -286,26 +288,21 @@ | |||
1768 | 286 | //! Get the duration of a sidereal year for the current observer in days. | 288 | //! Get the duration of a sidereal year for the current observer in days. |
1769 | 287 | double getLocalSiderealYearLength() const; | 289 | double getLocalSiderealYearLength() const; |
1770 | 288 | 290 | ||
1772 | 289 | //! Return the startup mode, can be preset|Preset or anything else | 291 | //! Return the startup mode, can be "actual" (i.e. take current time from system), |
1773 | 292 | //! "today" (take some time e.g. on the evening of today) or "preset" (completely preconfigured). | ||
1774 | 290 | QString getStartupTimeMode(); | 293 | QString getStartupTimeMode(); |
1775 | 291 | void setStartupTimeMode(const QString& s); | 294 | void setStartupTimeMode(const QString& s); |
1776 | 292 | 295 | ||
1777 | 293 | //! Get Delta-T estimation for a given date. | ||
1778 | 294 | //! @param jDay the date and time expressed as a julian day | ||
1779 | 295 | //! @return Delta-T in seconds | ||
1780 | 296 | //! @note Thanks to Rob van Gent which create a collection from many formulas for calculation of Delta-T: http://www.staff.science.uu.nl/~gent0113/deltat/deltat.htm | ||
1781 | 297 | double getDeltaT(double jDay) const; | ||
1782 | 298 | |||
1783 | 299 | //! Get info about valid range for current algorithm for calculation of Delta-T | 296 | //! Get info about valid range for current algorithm for calculation of Delta-T |
1788 | 300 | //! @param jDay the JD | 297 | //! @param JD the Julian Day number to test. |
1789 | 301 | //! @param marker the marker for valid range | 298 | //! @param marker receives a string: "*" if jDay is outside valid range, or "?" if range unknown, else an empty string. |
1790 | 302 | //! @return valid range | 299 | //! @return valid range as explanatory string. |
1791 | 303 | QString getCurrentDeltaTAlgorithmValidRange(double jDay, QString* marker) const; | 300 | QString getCurrentDeltaTAlgorithmValidRangeDescription(const double JD, QString* marker) const; |
1792 | 304 | 301 | ||
1793 | 305 | //! Checks for altitude of sun - is it night or day? | 302 | //! Checks for altitude of sun - is it night or day? |
1794 | 306 | //! @return true if sun higher than about -6 degrees, i.e. "day" includes civil twilight. | 303 | //! @return true if sun higher than about -6 degrees, i.e. "day" includes civil twilight. |
1795 | 307 | //! @note Useful mostly for brightness-controlled GUI decisions like font colors. | 304 | //! @note Useful mostly for brightness-controlled GUI decisions like font colors. |
1797 | 308 | bool isDay() const; | 305 | bool isBrightDaylight() const; |
1798 | 309 | 306 | ||
1799 | 310 | //! Get value of the current Julian epoch (i.e. current year with decimal fraction, e.g. 2012.34567) | 307 | //! Get value of the current Julian epoch (i.e. current year with decimal fraction, e.g. 2012.34567) |
1800 | 311 | double getCurrentEpoch() const; | 308 | double getCurrentEpoch() const; |
1801 | @@ -367,16 +364,43 @@ | |||
1802 | 367 | //! Return to the default location and set default landscape with atmosphere and fog effects | 364 | //! Return to the default location and set default landscape with atmosphere and fog effects |
1803 | 368 | void returnToHome(); | 365 | void returnToHome(); |
1804 | 369 | 366 | ||
1809 | 370 | //! Set the current date in Julian Day | 367 | //! Set the current date in Julian Day (UT) |
1810 | 371 | void setJDay(double JD); | 368 | void setJD(double newJD); |
1811 | 372 | //! Get the current date in Julian Day | 369 | //! Set the current date in Julian Day (TT). |
1812 | 373 | double getJDay() const; | 370 | //! The name is derived from the classical name "Ephemeris Time", of which TT is the successor. |
1813 | 371 | //! It is still frequently used in the literature. | ||
1814 | 372 | void setJDE(double newJDE); | ||
1815 | 373 | //! Get the current date in Julian Day (UT). | ||
1816 | 374 | double getJD() const; | ||
1817 | 375 | //! Get the current date in Julian Day (TT). | ||
1818 | 376 | //! The name is derived from the classical name "Ephemeris Time", of which TT is the successor. | ||
1819 | 377 | //! It is still frequently used in the literature. | ||
1820 | 378 | double getJDE() const; | ||
1821 | 374 | 379 | ||
1823 | 375 | //! Set the current date in Modified Julian Day | 380 | //! Set the current date in Modified Julian Day (UT). |
1824 | 381 | //! MJD is simply JD-2400000.5, getting rid of large numbers and starting days at midnight. | ||
1825 | 382 | //! It is mostly used in satellite contexts. | ||
1826 | 376 | void setMJDay(double MJD); | 383 | void setMJDay(double MJD); |
1828 | 377 | //! Get the current date in Modified Julian Day | 384 | //! Get the current date in Modified Julian Day (UT) |
1829 | 378 | double getMJDay() const; | 385 | double getMJDay() const; |
1830 | 379 | 386 | ||
1831 | 387 | //! Compute Delta-T estimation for a given date. | ||
1832 | 388 | //! DeltaT is the accumulated effect of earth's rotation slowly getting slower, mostly caused by tidal braking by the Moon. | ||
1833 | 389 | //! For accurate positioning of objects in the sky, we must compute earth-based clock-dependent things like earth rotation, hour angles etc. | ||
1834 | 390 | //! using plain UT, but all orbital motions or rotation of the other planets must be computed in TT, which is a regular time frame. | ||
1835 | 391 | //! Also satellites are computed in the UT frame because (1) they are short-lived and (2) must follow paths over earth ground. | ||
1836 | 392 | //! (Note that we make no further difference between TT and DT, those are regarded equivalent for our purpose.) | ||
1837 | 393 | //! | ||
1838 | 394 | //! @param JD the date and time expressed as a Julian Day | ||
1839 | 395 | //! @return DeltaT in seconds | ||
1840 | 396 | //! @note Thanks to Rob van Gent which create a collection from many formulas for calculation of Delta-T: http://www.staff.science.uu.nl/~gent0113/deltat/deltat.htm | ||
1841 | 397 | //! @note Use this only if needed, prefer calling getDeltaT() for access to the current value. | ||
1842 | 398 | double computeDeltaT(const double JD) const; | ||
1843 | 399 | //! Get current DeltaT. | ||
1844 | 400 | double getDeltaT() const; | ||
1845 | 401 | |||
1846 | 402 | |||
1847 | 403 | |||
1848 | 380 | //! Return the preset sky time in JD | 404 | //! Return the preset sky time in JD |
1849 | 381 | double getPresetSkyTime() const; | 405 | double getPresetSkyTime() const; |
1850 | 382 | //! Set the preset sky time from a JD | 406 | //! Set the preset sky time from a JD |
1851 | @@ -415,9 +439,9 @@ | |||
1852 | 415 | //! get the initial "today time" from the config file | 439 | //! get the initial "today time" from the config file |
1853 | 416 | QTime getInitTodayTime(void); | 440 | QTime getInitTodayTime(void); |
1854 | 417 | //! set the initial "today time" from the config file | 441 | //! set the initial "today time" from the config file |
1856 | 418 | void setInitTodayTime(const QTime& t); | 442 | void setInitTodayTime(const QTime& time); |
1857 | 419 | //! Set the preset sky time from a QDateTime | 443 | //! Set the preset sky time from a QDateTime |
1859 | 420 | void setPresetSkyTime(QDateTime dt); | 444 | void setPresetSkyTime(QDateTime dateTime); |
1860 | 421 | 445 | ||
1861 | 422 | //! Add one [Earth, solar] hour to the current simulation time. | 446 | //! Add one [Earth, solar] hour to the current simulation time. |
1862 | 423 | void addHour(); | 447 | void addHour(); |
1863 | @@ -529,7 +553,7 @@ | |||
1864 | 529 | //! the selected object is of the correct type - i.e. a planet. | 553 | //! the selected object is of the correct type - i.e. a planet. |
1865 | 530 | void moveObserverToSelected(); | 554 | void moveObserverToSelected(); |
1866 | 531 | 555 | ||
1868 | 532 | //! Set year for custom equation for calculation of Delta-T | 556 | //! Set central year for custom equation for calculation of Delta-T |
1869 | 533 | //! @param y the year, e.g. 1820 | 557 | //! @param y the year, e.g. 1820 |
1870 | 534 | void setDeltaTCustomYear(float y) { deltaTCustomYear=y; } | 558 | void setDeltaTCustomYear(float y) { deltaTCustomYear=y; } |
1871 | 535 | //! Set n-dot for custom equation for calculation of Delta-T | 559 | //! Set n-dot for custom equation for calculation of Delta-T |
1872 | @@ -539,7 +563,7 @@ | |||
1873 | 539 | //! @param y the coefficients, e.g. -20,0,32 | 563 | //! @param y the coefficients, e.g. -20,0,32 |
1874 | 540 | void setDeltaTCustomEquationCoefficients(Vec3f c) { deltaTCustomEquationCoeff=c; } | 564 | void setDeltaTCustomEquationCoefficients(Vec3f c) { deltaTCustomEquationCoeff=c; } |
1875 | 541 | 565 | ||
1877 | 542 | //! Get year for custom equation for calculation of Delta-T | 566 | //! Get central year for custom equation for calculation of Delta-T |
1878 | 543 | float getDeltaTCustomYear() const { return deltaTCustomYear; } | 567 | float getDeltaTCustomYear() const { return deltaTCustomYear; } |
1879 | 544 | //! Get n-dot for custom equation for calculation of Delta-T | 568 | //! Get n-dot for custom equation for calculation of Delta-T |
1880 | 545 | float getDeltaTCustomNDot() const { return deltaTCustomNDot; } | 569 | float getDeltaTCustomNDot() const { return deltaTCustomNDot; } |
1881 | @@ -573,6 +597,8 @@ | |||
1882 | 573 | void updateTime(double deltaTime); | 597 | void updateTime(double deltaTime); |
1883 | 574 | void resetSync(); | 598 | void resetSync(); |
1884 | 575 | 599 | ||
1885 | 600 | |||
1886 | 601 | |||
1887 | 576 | // Matrices used for every coordinate transfo | 602 | // Matrices used for every coordinate transfo |
1888 | 577 | Mat4d matHeliocentricEclipticJ2000ToAltAz; // Transform from heliocentric ecliptic Cartesian (VSOP87A) to topocentric (StelObserver) altazimuthal coordinate | 603 | Mat4d matHeliocentricEclipticJ2000ToAltAz; // Transform from heliocentric ecliptic Cartesian (VSOP87A) to topocentric (StelObserver) altazimuthal coordinate |
1889 | 578 | Mat4d matAltAzToHeliocentricEclipticJ2000; // Transform from topocentric (StelObserver) altazimuthal coordinate to heliocentric ecliptic Cartesian (VSOP87A) | 604 | Mat4d matAltAzToHeliocentricEclipticJ2000; // Transform from topocentric (StelObserver) altazimuthal coordinate to heliocentric ecliptic Cartesian (VSOP87A) |
1890 | @@ -597,12 +623,14 @@ | |||
1891 | 597 | 623 | ||
1892 | 598 | // Time variables | 624 | // Time variables |
1893 | 599 | double timeSpeed; // Positive : forward, Negative : Backward, 1 = 1sec/sec | 625 | double timeSpeed; // Positive : forward, Negative : Backward, 1 = 1sec/sec |
1895 | 600 | double JDay; // Curent time in Julian day | 626 | //double JDay; // Current time in Julian day. IN V0.12 TO V0.14, this was JD in TT, and all places where UT was required had to subtract getDeltaT() explicitly. |
1896 | 627 | QPair<double,double> JD; // From 0.14 on: JD.first=JD_UT, JD.second=DeltaT=TT-UT. To gain JD_TT, compute JDE=JD.first+JD.second or just call getJDE() | ||
1897 | 628 | // Use is best with calls getJD()/setJD() and getJDE()/setJDE() to explicitly state which flavour of JD you need. | ||
1898 | 601 | double presetSkyTime; | 629 | double presetSkyTime; |
1899 | 602 | QTime initTodayTime; | 630 | QTime initTodayTime; |
1900 | 603 | QString startupTimeMode; | 631 | QString startupTimeMode; |
1903 | 604 | double secondsOfLastJDayUpdate; // Time in seconds when the time rate or time last changed | 632 | double secondsOfLastJDUpdate; // Time in seconds when the time rate or time last changed |
1904 | 605 | double JDayOfLastJDayUpdate; // JDay when the time rate or time last changed | 633 | double jdOfLastJDUpdate; // JD when the time rate or time last changed |
1905 | 606 | 634 | ||
1906 | 607 | // Variables for custom equation of Delta-T | 635 | // Variables for custom equation of Delta-T |
1907 | 608 | Vec3f deltaTCustomEquationCoeff; | 636 | Vec3f deltaTCustomEquationCoeff; |
1908 | 609 | 637 | ||
1909 | === modified file 'src/core/StelMovementMgr.cpp' | |||
1910 | --- src/core/StelMovementMgr.cpp 2015-07-24 14:56:52 +0000 | |||
1911 | +++ src/core/StelMovementMgr.cpp 2015-08-03 13:17:13 +0000 | |||
1912 | @@ -321,7 +321,7 @@ | |||
1913 | 321 | { | 321 | { |
1914 | 322 | DragHistoryEntry e; | 322 | DragHistoryEntry e; |
1915 | 323 | e.runTime=StelApp::getInstance().getTotalRunTime(); | 323 | e.runTime=StelApp::getInstance().getTotalRunTime(); |
1917 | 324 | e.jd=core->getJDay(); | 324 | e.jd=core->getJD(); |
1918 | 325 | e.x=x; | 325 | e.x=x; |
1919 | 326 | e.y=y; | 326 | e.y=y; |
1920 | 327 | timeDragHistory.append(e); | 327 | timeDragHistory.append(e); |
1921 | @@ -907,7 +907,7 @@ | |||
1922 | 907 | viewDirectionMountFrame = j2000ToMountFrame(v); | 907 | viewDirectionMountFrame = j2000ToMountFrame(v); |
1923 | 908 | } | 908 | } |
1924 | 909 | 909 | ||
1926 | 910 | void StelMovementMgr::panView(double deltaAz, double deltaAlt) | 910 | void StelMovementMgr::panView(const double deltaAz, const double deltaAlt) |
1927 | 911 | { | 911 | { |
1928 | 912 | double azVision, altVision; | 912 | double azVision, altVision; |
1929 | 913 | StelUtils::rectToSphe(&azVision,&altVision,j2000ToMountFrame(viewDirectionJ2000)); | 913 | StelUtils::rectToSphe(&azVision,&altVision,j2000ToMountFrame(viewDirectionJ2000)); |
1930 | @@ -947,7 +947,7 @@ | |||
1931 | 947 | v2[2]=0; v2.normalize(); | 947 | v2[2]=0; v2.normalize(); |
1932 | 948 | double angle = (v2^v1)[2]; | 948 | double angle = (v2^v1)[2]; |
1933 | 949 | double deltaDay = angle/(2.*M_PI)*core->getLocalSiderealDayLength(); | 949 | double deltaDay = angle/(2.*M_PI)*core->getLocalSiderealDayLength(); |
1935 | 950 | core->setJDay(core->getJDay()+deltaDay); | 950 | core->setJD(core->getJD()+deltaDay); |
1936 | 951 | addTimeDragPoint(x2, y2); | 951 | addTimeDragPoint(x2, y2); |
1937 | 952 | } | 952 | } |
1938 | 953 | else | 953 | else |
1939 | 954 | 954 | ||
1940 | === modified file 'src/core/StelMovementMgr.hpp' | |||
1941 | --- src/core/StelMovementMgr.hpp 2015-07-24 14:56:52 +0000 | |||
1942 | +++ src/core/StelMovementMgr.hpp 2015-08-03 13:17:13 +0000 | |||
1943 | @@ -117,7 +117,7 @@ | |||
1944 | 117 | //! Changes to viewing direction are instantaneous. | 117 | //! Changes to viewing direction are instantaneous. |
1945 | 118 | //! @param deltaAz change in azimuth angle in radians | 118 | //! @param deltaAz change in azimuth angle in radians |
1946 | 119 | //! @param deltaAlt change in altitude angle in radians | 119 | //! @param deltaAlt change in altitude angle in radians |
1948 | 120 | void panView(double deltaAz, double deltaAlt); | 120 | void panView(const double deltaAz, const double deltaAlt); |
1949 | 121 | 121 | ||
1950 | 122 | //! Set automove duration in seconds | 122 | //! Set automove duration in seconds |
1951 | 123 | //! @param f the number of seconds it takes for an auto-move operation to complete. | 123 | //! @param f the number of seconds it takes for an auto-move operation to complete. |
1952 | 124 | 124 | ||
1953 | === modified file 'src/core/StelObject.cpp' | |||
1954 | --- src/core/StelObject.cpp 2015-07-28 13:22:40 +0000 | |||
1955 | +++ src/core/StelObject.cpp 2015-08-03 13:17:13 +0000 | |||
1956 | @@ -42,21 +42,15 @@ | |||
1957 | 42 | // Get observer local sidereal coordinate | 42 | // Get observer local sidereal coordinate |
1958 | 43 | Vec3d StelObject::getSiderealPosGeometric(const StelCore* core) const | 43 | Vec3d StelObject::getSiderealPosGeometric(const StelCore* core) const |
1959 | 44 | { | 44 | { |
1964 | 45 | // Hour Angle corrected to Delta-T value | 45 | return Mat4d::zrotation(-core->getLocalSiderealTime())* getEquinoxEquatorialPos(core); |
1961 | 46 | // TODO: make code readable by calling siderealTime(JD_UT), this should not contain a deltaT in its algorithm. | ||
1962 | 47 | double dt = (core->getDeltaT(core->getJDay())/240.)*M_PI/180.; | ||
1963 | 48 | return Mat4d::zrotation(-core->getLocalSiderealTime()+dt)* getEquinoxEquatorialPos(core); | ||
1965 | 49 | } | 46 | } |
1966 | 50 | 47 | ||
1967 | 51 | // Get observer local sidereal coordinates, deflected by refraction | 48 | // Get observer local sidereal coordinates, deflected by refraction |
1968 | 52 | Vec3d StelObject::getSiderealPosApparent(const StelCore* core) const | 49 | Vec3d StelObject::getSiderealPosApparent(const StelCore* core) const |
1969 | 53 | { | 50 | { |
1971 | 54 | Vec3d v=getAltAzPosApparent(core); | 51 | Vec3d v=getAltAzPosApparent(core); // These already come with refraction! |
1972 | 55 | v = core->altAzToEquinoxEqu(v, StelCore::RefractionOff); | 52 | v = core->altAzToEquinoxEqu(v, StelCore::RefractionOff); |
1977 | 56 | // Hour Angle corrected to Delta-T value | 53 | return Mat4d::zrotation(-core->getLocalSiderealTime())*v; |
1974 | 57 | // TODO: make code readable by calling siderealTime(JD_UT), this should not contain a deltaT in its algorithm. | ||
1975 | 58 | double dt = (core->getDeltaT(core->getJDay())/240.)*M_PI/180.; | ||
1976 | 59 | return Mat4d::zrotation(-core->getLocalSiderealTime()+dt)*v; | ||
1978 | 60 | } | 54 | } |
1979 | 61 | 55 | ||
1980 | 62 | Vec3d StelObject::getAltAzPosGeometric(const StelCore* core) const | 56 | Vec3d StelObject::getAltAzPosGeometric(const StelCore* core) const |
1981 | @@ -204,9 +198,8 @@ | |||
1982 | 204 | // and because the ecliptical grid of J2000 is also shown for observers on other planets. | 198 | // and because the ecliptical grid of J2000 is also shown for observers on other planets. |
1983 | 205 | // The formulation here has never computed the true position of any observer planet's orbital plane except for Earth, | 199 | // The formulation here has never computed the true position of any observer planet's orbital plane except for Earth, |
1984 | 206 | // or ever displayed the coordinates in the observer planet's equivalent to Earth's ecliptical coordinates. | 200 | // or ever displayed the coordinates in the observer planet's equivalent to Earth's ecliptical coordinates. |
1986 | 207 | // As quick test you can observe if in any "Ecliptic coordinate" as seen from e.g. Mars or Jupiter the Sun was ever close to beta=0. | 201 | // As quick test you can observe if in any "Ecliptic coordinate" as seen from e.g. Mars or Jupiter the Sun was ever close to beta=0 (except if crossing the node...). |
1987 | 208 | 202 | ||
1988 | 209 | //double ecl = core->getCurrentPlanet()->getRotObliquity(2451545.0); | ||
1989 | 210 | double ecl=GETSTELMODULE(SolarSystem)->getEarth()->getRotObliquity(2451545.0); | 203 | double ecl=GETSTELMODULE(SolarSystem)->getEarth()->getRotObliquity(2451545.0); |
1990 | 211 | double ra_equ, dec_equ, lambda, beta; | 204 | double ra_equ, dec_equ, lambda, beta; |
1991 | 212 | StelUtils::rectToSphe(&ra_equ,&dec_equ,getJ2000EquatorialPos(core)); | 205 | StelUtils::rectToSphe(&ra_equ,&dec_equ,getJ2000EquatorialPos(core)); |
1992 | @@ -267,7 +260,7 @@ | |||
1993 | 267 | { | 260 | { |
1994 | 268 | Vec3f color = getInfoColor(); | 261 | Vec3f color = getInfoColor(); |
1995 | 269 | StelCore* core = StelApp::getInstance().getCore(); | 262 | StelCore* core = StelApp::getInstance().getCore(); |
1997 | 270 | if (core->isDay() && core->getSkyDrawer()->getFlagHasAtmosphere()==true) | 263 | if (core->isBrightDaylight() && core->getSkyDrawer()->getFlagHasAtmosphere()==true) |
1998 | 271 | { | 264 | { |
1999 | 272 | // make info text more readable when atmosphere enabled at daylight. | 265 | // make info text more readable when atmosphere enabled at daylight. |
2000 | 273 | color = StelUtils::strToVec3f(StelApp::getInstance().getSettings()->value("color/daylight_text_color", "0.0,0.0,0.0").toString()); | 266 | color = StelUtils::strToVec3f(StelApp::getInstance().getSettings()->value("color/daylight_text_color", "0.0,0.0,0.0").toString()); |
2001 | 274 | 267 | ||
2002 | === modified file 'src/core/StelObserver.cpp' | |||
2003 | --- src/core/StelObserver.cpp 2015-07-27 21:55:05 +0000 | |||
2004 | +++ src/core/StelObserver.cpp 2015-08-03 13:17:13 +0000 | |||
2005 | @@ -77,9 +77,9 @@ | |||
2006 | 77 | 77 | ||
2007 | 78 | // rotation: | 78 | // rotation: |
2008 | 79 | const RotationElements &r(dest->getRotationElements()); | 79 | const RotationElements &r(dest->getRotationElements()); |
2010 | 80 | lastJD = StelApp::getInstance().getCore()->getJDay(); | 80 | lastJDE = StelApp::getInstance().getCore()->getJDE(); |
2011 | 81 | 81 | ||
2013 | 82 | re.offset = r.offset + fmod(re.offset - r.offset + 360.0*( (lastJD-re.epoch)/re.period - (lastJD-r.epoch)/r.period), 360.0); | 82 | re.offset = r.offset + fmod(re.offset - r.offset + 360.0*( (lastJDE-re.epoch)/re.period - (lastJDE-r.epoch)/r.period), 360.0); |
2014 | 83 | 83 | ||
2015 | 84 | re.epoch = r.epoch; | 84 | re.epoch = r.epoch; |
2016 | 85 | re.period = r.period; | 85 | re.period = r.period; |
2017 | @@ -218,25 +218,19 @@ | |||
2018 | 218 | return rho*a; | 218 | return rho*a; |
2019 | 219 | } | 219 | } |
2020 | 220 | 220 | ||
2022 | 221 | Mat4d StelObserver::getRotAltAzToEquatorial(double jd) const | 221 | // For Earth we require JD, for other planets JDE to describe rotation! |
2023 | 222 | Mat4d StelObserver::getRotAltAzToEquatorial(double JD, double JDE) const | ||
2024 | 222 | { | 223 | { |
2025 | 223 | double lat = currentLocation.latitude; | 224 | double lat = currentLocation.latitude; |
2026 | 224 | // TODO: Figure out how to keep continuity in sky as we reach poles | 225 | // TODO: Figure out how to keep continuity in sky as we reach poles |
2027 | 225 | // otherwise sky jumps in rotation when reach poles in equatorial mode | 226 | // otherwise sky jumps in rotation when reach poles in equatorial mode |
2028 | 226 | // This is a kludge | 227 | // This is a kludge |
2030 | 227 | // GZ: Actually, why would that be? Lat should be clamped elsewhere. Added tests. | 228 | // GZ: Actually, why would that be? Lat should be clamped elsewhere. Added tests to track down problems in other locations. |
2031 | 228 | Q_ASSERT(lat <= 90.0); | 229 | Q_ASSERT(lat <= 90.0); |
2032 | 229 | Q_ASSERT(lat >= -90.0); | 230 | Q_ASSERT(lat >= -90.0); |
2033 | 230 | if( lat > 90.0 ) lat = 90.0; | 231 | if( lat > 90.0 ) lat = 90.0; |
2034 | 231 | if( lat < -90.0 ) lat = -90.0; | 232 | if( lat < -90.0 ) lat = -90.0; |
2043 | 232 | // Include a DeltaT correction. Sidereal time and longitude here are both in degrees, but DeltaT in seconds of time. | 233 | return Mat4d::zrotation((getHomePlanet()->getSiderealTime(JD, JDE)+currentLocation.longitude)*M_PI/180.) |
2036 | 233 | // 360 degrees = 24hrs; 15 degrees = 1hr = 3600s; 1 degree = 240s | ||
2037 | 234 | // Apply DeltaT correction only for Earth | ||
2038 | 235 | // TODO: make code readable by calling siderealTime(JD_UT), this should not contain a deltaT in its algorithm. | ||
2039 | 236 | double deltaT = 0.; | ||
2040 | 237 | if (getHomePlanet()->getEnglishName()=="Earth") | ||
2041 | 238 | deltaT = StelApp::getInstance().getCore()->getDeltaT(jd)/240.; | ||
2042 | 239 | return Mat4d::zrotation((getHomePlanet()->getSiderealTime(jd)+currentLocation.longitude-deltaT)*M_PI/180.) | ||
2044 | 240 | * Mat4d::yrotation((90.-lat)*M_PI/180.); | 234 | * Mat4d::yrotation((90.-lat)*M_PI/180.); |
2045 | 241 | } | 235 | } |
2046 | 242 | 236 | ||
2047 | 243 | 237 | ||
2048 | === modified file 'src/core/StelObserver.hpp' | |||
2049 | --- src/core/StelObserver.hpp 2014-02-18 06:36:58 +0000 | |||
2050 | +++ src/core/StelObserver.hpp 2015-08-03 13:17:13 +0000 | |||
2051 | @@ -50,7 +50,10 @@ | |||
2052 | 50 | Vec3d getCenterVsop87Pos(void) const; | 50 | Vec3d getCenterVsop87Pos(void) const; |
2053 | 51 | //! Get the distance between observer and home planet center in AU | 51 | //! Get the distance between observer and home planet center in AU |
2054 | 52 | double getDistanceFromCenter(void) const; | 52 | double getDistanceFromCenter(void) const; |
2056 | 53 | Mat4d getRotAltAzToEquatorial(double jd) const; | 53 | |
2057 | 54 | //! returns rotation matrix for conversion of alt-azimuthal to equatorial coordinates | ||
2058 | 55 | //! For Earth we need JD(UT), for other planets JDE! To be general, just have both in here! | ||
2059 | 56 | Mat4d getRotAltAzToEquatorial(double JD, double JDE) const; | ||
2060 | 54 | Mat4d getRotEquatorialToVsop87(void) const; | 57 | Mat4d getRotEquatorialToVsop87(void) const; |
2061 | 55 | 58 | ||
2062 | 56 | virtual const QSharedPointer<Planet> getHomePlanet(void) const; | 59 | virtual const QSharedPointer<Planet> getHomePlanet(void) const; |
2063 | 57 | 60 | ||
2064 | === modified file 'src/core/StelUtils.hpp' | |||
2065 | --- src/core/StelUtils.hpp 2015-05-10 08:29:58 +0000 | |||
2066 | +++ src/core/StelUtils.hpp 2015-08-03 13:17:13 +0000 | |||
2067 | @@ -326,7 +326,7 @@ | |||
2068 | 326 | return Vec3f(max, 0, 0); | 326 | return Vec3f(max, 0, 0); |
2069 | 327 | } | 327 | } |
2070 | 328 | 328 | ||
2072 | 329 | //! Calculate and getting sidereal period in days from semi-major axis (in AU) | 329 | //! Calculate and return sidereal period in days from semi-major axis (in AU) |
2073 | 330 | double calculateSiderealPeriod(const double SemiMajorAxis); | 330 | double calculateSiderealPeriod(const double SemiMajorAxis); |
2074 | 331 | 331 | ||
2075 | 332 | //! Convert decimal hours to hours, minutes, seconds | 332 | //! Convert decimal hours to hours, minutes, seconds |
2076 | 333 | 333 | ||
2077 | === modified file 'src/core/TrailGroup.cpp' | |||
2078 | --- src/core/TrailGroup.cpp 2015-05-12 07:00:45 +0000 | |||
2079 | +++ src/core/TrailGroup.cpp 2015-08-03 13:17:13 +0000 | |||
2080 | @@ -36,7 +36,7 @@ | |||
2081 | 36 | { | 36 | { |
2082 | 37 | glEnable(GL_BLEND); | 37 | glEnable(GL_BLEND); |
2083 | 38 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 38 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
2085 | 39 | float currentTime = core->getJDay(); | 39 | float currentTime = core->getJDE(); |
2086 | 40 | StelProjector::ModelViewTranformP transfo = core->getJ2000ModelViewTransform(); | 40 | StelProjector::ModelViewTranformP transfo = core->getJ2000ModelViewTransform(); |
2087 | 41 | transfo->combine(j2000ToTrailNativeInverted); | 41 | transfo->combine(j2000ToTrailNativeInverted); |
2088 | 42 | sPainter->setProjector(core->getProjection(transfo)); | 42 | sPainter->setProjector(core->getProjection(transfo)); |
2089 | @@ -66,12 +66,12 @@ | |||
2090 | 66 | // Add 1 point to all the curves at current time and suppress too old points | 66 | // Add 1 point to all the curves at current time and suppress too old points |
2091 | 67 | void TrailGroup::update() | 67 | void TrailGroup::update() |
2092 | 68 | { | 68 | { |
2094 | 69 | times.append(StelApp::getInstance().getCore()->getJDay()); | 69 | times.append(StelApp::getInstance().getCore()->getJDE()); |
2095 | 70 | for (QList<Trail>::Iterator iter=allTrails.begin();iter!=allTrails.end();++iter) | 70 | for (QList<Trail>::Iterator iter=allTrails.begin();iter!=allTrails.end();++iter) |
2096 | 71 | { | 71 | { |
2097 | 72 | iter->posHistory.append(j2000ToTrailNative*iter->stelObject->getJ2000EquatorialPos(StelApp::getInstance().getCore())); | 72 | iter->posHistory.append(j2000ToTrailNative*iter->stelObject->getJ2000EquatorialPos(StelApp::getInstance().getCore())); |
2098 | 73 | } | 73 | } |
2100 | 74 | if (StelApp::getInstance().getCore()->getJDay()-times.at(0)>timeExtent) | 74 | if (StelApp::getInstance().getCore()->getJDE()-times.at(0)>timeExtent) |
2101 | 75 | { | 75 | { |
2102 | 76 | times.pop_front(); | 76 | times.pop_front(); |
2103 | 77 | for (QList<Trail>::Iterator iter=allTrails.begin();iter!=allTrails.end();++iter) | 77 | for (QList<Trail>::Iterator iter=allTrails.begin();iter!=allTrails.end();++iter) |
2104 | 78 | 78 | ||
2105 | === modified file 'src/core/modules/Atmosphere.cpp' | |||
2106 | --- src/core/modules/Atmosphere.cpp 2015-02-01 20:44:54 +0000 | |||
2107 | +++ src/core/modules/Atmosphere.cpp 2015-08-03 13:17:13 +0000 | |||
2108 | @@ -220,7 +220,7 @@ | |||
2109 | 220 | } | 220 | } |
2110 | 221 | else | 221 | else |
2111 | 222 | eclipseFactor = 1.f; | 222 | eclipseFactor = 1.f; |
2113 | 223 | 223 | // TODO: compute eclipse factor also for Lunar eclipses! (lp:#1471546) | |
2114 | 224 | 224 | ||
2115 | 225 | // No need to calculate if not visible | 225 | // No need to calculate if not visible |
2116 | 226 | if (!fader.getInterstate()) | 226 | if (!fader.getInterstate()) |
2117 | 227 | 227 | ||
2118 | === modified file 'src/core/modules/Comet.cpp' | |||
2119 | --- src/core/modules/Comet.cpp 2015-03-15 15:47:35 +0000 | |||
2120 | +++ src/core/modules/Comet.cpp 2015-08-03 13:17:13 +0000 | |||
2121 | @@ -89,10 +89,10 @@ | |||
2122 | 89 | dustTailBrightnessFactor(dustTailBrightnessFact) | 89 | dustTailBrightnessFactor(dustTailBrightnessFact) |
2123 | 90 | { | 90 | { |
2124 | 91 | texMapName = atexMapName; | 91 | texMapName = atexMapName; |
2129 | 92 | lastOrbitJD =0; | 92 | lastOrbitJDE =0; |
2130 | 93 | deltaJD = StelCore::JD_SECOND; | 93 | deltaJDE = StelCore::JD_SECOND; |
2131 | 94 | deltaJDtail=15.0*StelCore::JD_MINUTE; // update tail geometry every 15 minutes only | 94 | deltaJDEtail=15.0*StelCore::JD_MINUTE; // update tail geometry every 15 minutes only |
2132 | 95 | lastJDtail=0.0; | 95 | lastJDEtail=0.0; |
2133 | 96 | orbitCached = 0; | 96 | orbitCached = 0; |
2134 | 97 | closeOrbit = acloseOrbit; | 97 | closeOrbit = acloseOrbit; |
2135 | 98 | 98 | ||
2136 | @@ -314,27 +314,27 @@ | |||
2137 | 314 | { | 314 | { |
2138 | 315 | Planet::update(deltaTime); | 315 | Planet::update(deltaTime); |
2139 | 316 | 316 | ||
2141 | 317 | // The rest used to be in computePosition(), but is better in update(). Unfortunately we need date (JD). | 317 | // The rest deals with updating tail geometries and brightness |
2142 | 318 | StelCore* core=StelApp::getInstance().getCore(); | 318 | StelCore* core=StelApp::getInstance().getCore(); |
2144 | 319 | double date=core->getJDay(); | 319 | double dateJDE=core->getJDE(); |
2145 | 320 | 320 | ||
2146 | 321 | // The CometOrbit is in fact available in userDataPtr! | 321 | // The CometOrbit is in fact available in userDataPtr! |
2147 | 322 | CometOrbit* orbit=(CometOrbit*)userDataPtr; | 322 | CometOrbit* orbit=(CometOrbit*)userDataPtr; |
2148 | 323 | Q_ASSERT(orbit); | 323 | Q_ASSERT(orbit); |
2150 | 324 | if (!orbit->objectDateValid(core->getJDay())) return; // don't do anything if out of useful date range. This allows having hundreds of comet elements. | 324 | if (!orbit->objectDateValid(dateJDE)) return; // don't do anything if out of useful date range. This allows having hundreds of comet elements. |
2151 | 325 | 325 | ||
2152 | 326 | 326 | ||
2153 | 327 | //GZ: I think we can make deltaJDtail adaptive, depending on distance to sun! For some reason though, this leads to a crash! | 327 | //GZ: I think we can make deltaJDtail adaptive, depending on distance to sun! For some reason though, this leads to a crash! |
2154 | 328 | //deltaJDtail=StelCore::JD_SECOND * qMax(1.0, qMin(eclipticPos.length(), 20.0)); | 328 | //deltaJDtail=StelCore::JD_SECOND * qMax(1.0, qMin(eclipticPos.length(), 20.0)); |
2155 | 329 | 329 | ||
2157 | 330 | if (fabs(lastJDtail-date)>deltaJDtail) | 330 | if (fabs(lastJDEtail-dateJDE)>deltaJDEtail) |
2158 | 331 | { | 331 | { |
2160 | 332 | lastJDtail=date; | 332 | lastJDEtail=dateJDE; |
2161 | 333 | 333 | ||
2162 | 334 | // The CometOrbit is in fact available in userDataPtr! | 334 | // The CometOrbit is in fact available in userDataPtr! |
2163 | 335 | CometOrbit* orbit=(CometOrbit*)userDataPtr; | 335 | CometOrbit* orbit=(CometOrbit*)userDataPtr; |
2164 | 336 | Q_ASSERT(orbit); | 336 | Q_ASSERT(orbit); |
2166 | 337 | if (!orbit->objectDateValid(date)) return; // out of useful date range. This should allow having hundreds of comet elements. | 337 | if (!orbit->objectDateValid(dateJDE)) return; // out of useful date range. This should allow having hundreds of comet elements. |
2167 | 338 | 338 | ||
2168 | 339 | if (orbit->getUpdateTails()){ | 339 | if (orbit->getUpdateTails()){ |
2169 | 340 | // Compute lengths and orientations from orbit object, but only if required. | 340 | // Compute lengths and orientations from orbit object, but only if required. |
2170 | @@ -457,7 +457,7 @@ | |||
2171 | 457 | gastailColorArr.fill(gasColor, gastailVertexArr.length()); | 457 | gastailColorArr.fill(gasColor, gastailVertexArr.length()); |
2172 | 458 | dusttailColorArr.fill(dustColor, dusttailVertexArr.length()); | 458 | dusttailColorArr.fill(dustColor, dusttailVertexArr.length()); |
2173 | 459 | } | 459 | } |
2175 | 460 | //qDebug() << "Comet " << getEnglishName() << "JD: " << date << "gasR" << gasColor[0] << " dustR" << dustColor[0]; | 460 | //qDebug() << "Comet " << getEnglishName() << "JDE: " << date << "gasR" << gasColor[0] << " dustR" << dustColor[0]; |
2176 | 461 | } | 461 | } |
2177 | 462 | 462 | ||
2178 | 463 | 463 | ||
2179 | @@ -483,7 +483,7 @@ | |||
2180 | 483 | // The CometOrbit is in fact available in userDataPtr! | 483 | // The CometOrbit is in fact available in userDataPtr! |
2181 | 484 | CometOrbit* orbit=(CometOrbit*)userDataPtr; | 484 | CometOrbit* orbit=(CometOrbit*)userDataPtr; |
2182 | 485 | Q_ASSERT(orbit); | 485 | Q_ASSERT(orbit); |
2184 | 486 | if (!orbit->objectDateValid(core->getJDay())) return; // don't draw at all if out of useful date range. This allows having hundreds of comet elements. | 486 | if (!orbit->objectDateValid(core->getJDE())) return; // don't draw at all if out of useful date range. This allows having hundreds of comet elements. |
2185 | 487 | 487 | ||
2186 | 488 | Mat4d mat = Mat4d::translation(eclipticPos) * rotLocalToParent; | 488 | Mat4d mat = Mat4d::translation(eclipticPos) * rotLocalToParent; |
2187 | 489 | // This removed totally the Planet shaking bug!!! | 489 | // This removed totally the Planet shaking bug!!! |
2188 | 490 | 490 | ||
2189 | === modified file 'src/core/modules/Comet.hpp' | |||
2190 | --- src/core/modules/Comet.hpp 2014-11-25 13:02:40 +0000 | |||
2191 | +++ src/core/modules/Comet.hpp 2015-08-03 13:17:13 +0000 | |||
2192 | @@ -96,14 +96,10 @@ | |||
2193 | 96 | //! get sidereal period for comet, days, or returns 0 if not possible (paraboloid, hyperboloid orbit) | 96 | //! get sidereal period for comet, days, or returns 0 if not possible (paraboloid, hyperboloid orbit) |
2194 | 97 | virtual double getSiderealPeriod() const; | 97 | virtual double getSiderealPeriod() const; |
2195 | 98 | 98 | ||
2196 | 99 | //! GZ: override from Planet: extend with tail details. | ||
2197 | 100 | //virtual void computePosition(const double date); | ||
2198 | 101 | |||
2199 | 102 | //! re-implementation of Planet's draw() | 99 | //! re-implementation of Planet's draw() |
2200 | 103 | virtual void draw(StelCore* core, float maxMagLabels, const QFont& planetNameFont); | 100 | virtual void draw(StelCore* core, float maxMagLabels, const QFont& planetNameFont); |
2201 | 104 | 101 | ||
2202 | 105 | // re-implementation of Planet's update() to prepare tails (extinction etc). @param deltaTime: ms (since last call) | 102 | // re-implementation of Planet's update() to prepare tails (extinction etc). @param deltaTime: ms (since last call) |
2203 | 106 | // TODO: computePosition can be removed and things added here! | ||
2204 | 107 | virtual void update(int deltaTime); | 103 | virtual void update(int deltaTime); |
2205 | 108 | 104 | ||
2206 | 109 | private: | 105 | private: |
2207 | @@ -139,8 +135,8 @@ | |||
2208 | 139 | Vec2f tailFactors; // result of latest call to getComaDiameterAndTailLengthAU(); Results cached here for infostring. [0]=Coma diameter, [1] gas tail length. | 135 | Vec2f tailFactors; // result of latest call to getComaDiameterAndTailLengthAU(); Results cached here for infostring. [0]=Coma diameter, [1] gas tail length. |
2209 | 140 | bool tailActive; //! true if there is a tail long enough to be worth drawing. Drawing tails is quite costly. | 136 | bool tailActive; //! true if there is a tail long enough to be worth drawing. Drawing tails is quite costly. |
2210 | 141 | bool tailBright; //! true if tail is bright enough to draw. | 137 | bool tailBright; //! true if tail is bright enough to draw. |
2213 | 142 | double deltaJDtail; //! like deltaJD, but time difference between tail geometry updates. | 138 | double deltaJDEtail; //! like deltaJDE, but time difference between tail geometry updates. |
2214 | 143 | double lastJDtail; //! like lastJD, but time of last tail geometry update. | 139 | double lastJDEtail; //! like lastJDE, but time of last tail geometry update. |
2215 | 144 | Mat4d gasTailRot; //! rotation matrix for gas tail parabola | 140 | Mat4d gasTailRot; //! rotation matrix for gas tail parabola |
2216 | 145 | Mat4d dustTailRot; //! rotation matrix for the skewed dust tail parabola | 141 | Mat4d dustTailRot; //! rotation matrix for the skewed dust tail parabola |
2217 | 146 | float dustTailWidthFactor; //!< empirical individual broadening of the dust tail end, compared to the gas tail end. Actually, dust tail width=2*comaWidth*dustTailWidthFactor. Default 1.5 | 142 | float dustTailWidthFactor; //!< empirical individual broadening of the dust tail end, compared to the gas tail end. Actually, dust tail width=2*comaWidth*dustTailWidthFactor. Default 1.5 |
2218 | 147 | 143 | ||
2219 | === modified file 'src/core/modules/Constellation.cpp' | |||
2220 | --- src/core/modules/Constellation.cpp 2015-07-27 14:57:16 +0000 | |||
2221 | +++ src/core/modules/Constellation.cpp 2015-08-03 13:17:13 +0000 | |||
2222 | @@ -260,7 +260,7 @@ | |||
2223 | 260 | bool visible = false; | 260 | bool visible = false; |
2224 | 261 | int year, month, day; | 261 | int year, month, day; |
2225 | 262 | // Get the current month | 262 | // Get the current month |
2227 | 263 | StelUtils::getDateFromJulianDay(StelApp::getInstance().getCore()->getJDay(), &year, &month, &day); | 263 | StelUtils::getDateFromJulianDay(StelApp::getInstance().getCore()->getJD(), &year, &month, &day); |
2228 | 264 | if (endSeason >= beginSeason) | 264 | if (endSeason >= beginSeason) |
2229 | 265 | { | 265 | { |
2230 | 266 | // OK, it's a "normal" season rule... | 266 | // OK, it's a "normal" season rule... |
2231 | 267 | 267 | ||
2232 | === modified file 'src/core/modules/LandscapeMgr.cpp' | |||
2233 | --- src/core/modules/LandscapeMgr.cpp 2015-07-13 13:42:56 +0000 | |||
2234 | +++ src/core/modules/LandscapeMgr.cpp 2015-08-03 13:17:13 +0000 | |||
2235 | @@ -233,7 +233,8 @@ | |||
2236 | 233 | Vec3d sunPos = ssystem->getSun()->getAltAzPosApparent(core); | 233 | Vec3d sunPos = ssystem->getSun()->getAltAzPosApparent(core); |
2237 | 234 | // Compute the moon position in local coordinate | 234 | // Compute the moon position in local coordinate |
2238 | 235 | Vec3d moonPos = ssystem->getMoon()->getAltAzPosApparent(core); | 235 | Vec3d moonPos = ssystem->getMoon()->getAltAzPosApparent(core); |
2240 | 236 | atmosphere->computeColor(core->getJDay(), sunPos, moonPos, | 236 | // GZ: First parameter in next call is used for particularly earth-bound computations in Schaefer's sky brightness model. Difference DeltaT makes no difference here. |
2241 | 237 | atmosphere->computeColor(core->getJDE(), sunPos, moonPos, | ||
2242 | 237 | ssystem->getMoon()->getPhaseAngle(ssystem->getEarth()->getHeliocentricEclipticPos()), | 238 | ssystem->getMoon()->getPhaseAngle(ssystem->getEarth()->getHeliocentricEclipticPos()), |
2243 | 238 | core, core->getCurrentLocation().latitude, core->getCurrentLocation().altitude, | 239 | core, core->getCurrentLocation().latitude, core->getCurrentLocation().altitude, |
2244 | 239 | 15.f, 40.f); // Temperature = 15c, relative humidity = 40% | 240 | 15.f, 40.f); // Temperature = 15c, relative humidity = 40% |
2245 | 240 | 241 | ||
2246 | === modified file 'src/core/modules/MinorPlanet.cpp' | |||
2247 | --- src/core/modules/MinorPlanet.cpp 2015-01-30 17:31:11 +0000 | |||
2248 | +++ src/core/modules/MinorPlanet.cpp 2015-08-03 13:17:13 +0000 | |||
2249 | @@ -64,8 +64,8 @@ | |||
2250 | 64 | pTypeStr) | 64 | pTypeStr) |
2251 | 65 | { | 65 | { |
2252 | 66 | texMapName = atexMapName; | 66 | texMapName = atexMapName; |
2255 | 67 | lastOrbitJD =0; | 67 | lastOrbitJDE =0; |
2256 | 68 | deltaJD = StelCore::JD_SECOND; | 68 | deltaJDE = StelCore::JD_SECOND; |
2257 | 69 | orbitCached = 0; | 69 | orbitCached = 0; |
2258 | 70 | closeOrbit = acloseOrbit; | 70 | closeOrbit = acloseOrbit; |
2259 | 71 | semiMajorAxis = 0.; | 71 | semiMajorAxis = 0.; |
2260 | @@ -143,7 +143,7 @@ | |||
2261 | 143 | { | 143 | { |
2262 | 144 | semiMajorAxis = value; | 144 | semiMajorAxis = value; |
2263 | 145 | // GZ: in case we have very many asteroids, this helps improving speed usually without sacrificing accuracy: | 145 | // GZ: in case we have very many asteroids, this helps improving speed usually without sacrificing accuracy: |
2265 | 146 | deltaJD = 2.0*semiMajorAxis*StelCore::JD_SECOND; | 146 | deltaJDE = 2.0*semiMajorAxis*StelCore::JD_SECOND; |
2266 | 147 | } | 147 | } |
2267 | 148 | 148 | ||
2268 | 149 | void MinorPlanet::setMinorPlanetNumber(int number) | 149 | void MinorPlanet::setMinorPlanetNumber(int number) |
2269 | 150 | 150 | ||
2270 | === modified file 'src/core/modules/Orbit.cpp' | |||
2271 | --- src/core/modules/Orbit.cpp 2015-02-23 09:56:53 +0000 | |||
2272 | +++ src/core/modules/Orbit.cpp 2015-08-03 13:17:13 +0000 | |||
2273 | @@ -222,15 +222,6 @@ | |||
2274 | 222 | const double cj = cos(parentRotJ2000Longitude); | 222 | const double cj = cos(parentRotJ2000Longitude); |
2275 | 223 | const double sj = sin(parentRotJ2000Longitude); | 223 | const double sj = sin(parentRotJ2000Longitude); |
2276 | 224 | 224 | ||
2277 | 225 | // rotateToVsop87[0] = c_nod; | ||
2278 | 226 | // rotateToVsop87[1] = -s_nod * c_obl; | ||
2279 | 227 | // rotateToVsop87[2] = s_nod * s_obl; | ||
2280 | 228 | // rotateToVsop87[3] = s_nod; | ||
2281 | 229 | // rotateToVsop87[4] = c_nod * c_obl; | ||
2282 | 230 | // rotateToVsop87[5] = -c_nod * s_obl; | ||
2283 | 231 | // rotateToVsop87[6] = 0.0; | ||
2284 | 232 | // rotateToVsop87[7] = s_obl; | ||
2285 | 233 | // rotateToVsop87[8] = c_obl; | ||
2286 | 234 | rotateToVsop87[0] = c_nod*cj-s_nod*c_obl*sj; | 225 | rotateToVsop87[0] = c_nod*cj-s_nod*c_obl*sj; |
2287 | 235 | rotateToVsop87[1] = -c_nod*sj-s_nod*c_obl*cj; | 226 | rotateToVsop87[1] = -c_nod*sj-s_nod*c_obl*cj; |
2288 | 236 | rotateToVsop87[2] = s_nod*s_obl; | 227 | rotateToVsop87[2] = s_nod*s_obl; |
2289 | @@ -243,20 +234,20 @@ | |||
2290 | 243 | // qDebug() << "CometOrbit::()...done"; | 234 | // qDebug() << "CometOrbit::()...done"; |
2291 | 244 | } | 235 | } |
2292 | 245 | 236 | ||
2294 | 246 | void CometOrbit::positionAtTimevInVSOP87Coordinates(double JD, double *v, bool updateVelocityVector) | 237 | void CometOrbit::positionAtTimevInVSOP87Coordinates(double JDE, double *v, bool updateVelocityVector) |
2295 | 247 | { | 238 | { |
2297 | 248 | JD -= t0; | 239 | JDE -= t0; |
2298 | 249 | double rCosNu,rSinNu; | 240 | double rCosNu,rSinNu; |
2299 | 250 | // temporary solve freezes for near-parabolic comets - using (e < 0.9999) for elliptical orbits | 241 | // temporary solve freezes for near-parabolic comets - using (e < 0.9999) for elliptical orbits |
2300 | 251 | // TODO: improve calculations orbits for near-parabolic comets --AW | 242 | // TODO: improve calculations orbits for near-parabolic comets --AW |
2301 | 252 | // if (e < 0.9999) InitEll(q,n,e,JD,a1,a2); | 243 | // if (e < 0.9999) InitEll(q,n,e,JD,a1,a2); |
2303 | 253 | if (e < 1.0) InitEll(q,n,e,JD,rCosNu,rSinNu); // GZ: After solving with Laguerre-Conway, I dare to go for 1.0. | 244 | if (e < 1.0) InitEll(q,n,e,JDE,rCosNu,rSinNu); // GZ: After solving with Laguerre-Conway, I dare to go for 1.0. |
2304 | 254 | else if (e > 1.0) | 245 | else if (e > 1.0) |
2305 | 255 | { | 246 | { |
2306 | 256 | // qDebug() << "Hyperbolic orbit for ecc=" << e << ", i=" << i << ", w=" << w << ", Mean Motion n=" << n; | 247 | // qDebug() << "Hyperbolic orbit for ecc=" << e << ", i=" << i << ", w=" << w << ", Mean Motion n=" << n; |
2308 | 257 | InitHyp(q,n,e,JD,rCosNu,rSinNu); | 248 | InitHyp(q,n,e,JDE,rCosNu,rSinNu); |
2309 | 258 | } | 249 | } |
2311 | 259 | else InitPar(q,n,JD,rCosNu,rSinNu); | 250 | else InitPar(q,n,JDE,rCosNu,rSinNu); |
2312 | 260 | double p0,p1,p2, s0, s1, s2; | 251 | double p0,p1,p2, s0, s1, s2; |
2313 | 261 | Init3D(i,Om,w,rCosNu,rSinNu,p0,p1,p2, s0, s1, s2, updateVelocityVector, e, q); | 252 | Init3D(i,Om,w,rCosNu,rSinNu,p0,p1,p2, s0, s1, s2, updateVelocityVector, e, q); |
2314 | 262 | v[0] = rotateToVsop87[0]*p0 + rotateToVsop87[1]*p1 + rotateToVsop87[2]*p2; | 253 | v[0] = rotateToVsop87[0]*p0 + rotateToVsop87[1]*p1 + rotateToVsop87[2]*p2; |
2315 | @@ -475,34 +466,34 @@ | |||
2316 | 475 | } | 466 | } |
2317 | 476 | 467 | ||
2318 | 477 | // Return the offset from the center. | 468 | // Return the offset from the center. |
2320 | 478 | Vec3d EllipticalOrbit::positionAtTime(const double JD) const | 469 | Vec3d EllipticalOrbit::positionAtTime(const double JDE) const |
2321 | 479 | { | 470 | { |
2322 | 480 | double meanMotion = 2.0 * M_PI / period; | 471 | double meanMotion = 2.0 * M_PI / period; |
2324 | 481 | double meanAnomaly = meanAnomalyAtEpoch + (JD-epoch) * meanMotion; | 472 | double meanAnomaly = meanAnomalyAtEpoch + (JDE-epoch) * meanMotion; |
2325 | 482 | double E = eccentricAnomaly(meanAnomaly); | 473 | double E = eccentricAnomaly(meanAnomaly); |
2326 | 483 | 474 | ||
2327 | 484 | return positionAtE(E); | 475 | return positionAtE(E); |
2328 | 485 | } | 476 | } |
2329 | 486 | 477 | ||
2331 | 487 | //void EllipticalOrbit::positionAtTime(double JD, double * X, double * Y, double * Z) const | 478 | //void EllipticalOrbit::positionAtTime(double JDE, double * X, double * Y, double * Z) const |
2332 | 488 | //{ | 479 | //{ |
2334 | 489 | // Vec3d pos = positionAtTime(JD); | 480 | // Vec3d pos = positionAtTime(JDE); |
2335 | 490 | // *X=pos[2]; | 481 | // *X=pos[2]; |
2336 | 491 | // *Y=pos[0]; | 482 | // *Y=pos[0]; |
2337 | 492 | // *Z=pos[1]; | 483 | // *Z=pos[1]; |
2338 | 493 | //} | 484 | //} |
2339 | 494 | 485 | ||
2341 | 495 | //void EllipticalOrbit::positionAtTimev(double JD, double* v) | 486 | //void EllipticalOrbit::positionAtTimev(double JDE, double* v) |
2342 | 496 | //{ | 487 | //{ |
2344 | 497 | // Vec3d pos = positionAtTime(JD); | 488 | // Vec3d pos = positionAtTime(JDE); |
2345 | 498 | // v[0]=pos[2]; | 489 | // v[0]=pos[2]; |
2346 | 499 | // v[1]=pos[0]; | 490 | // v[1]=pos[0]; |
2347 | 500 | // v[2]=pos[1]; | 491 | // v[2]=pos[1]; |
2348 | 501 | //} | 492 | //} |
2349 | 502 | 493 | ||
2351 | 503 | void EllipticalOrbit::positionAtTimevInVSOP87Coordinates(const double JD, double* v) const | 494 | void EllipticalOrbit::positionAtTimevInVSOP87Coordinates(const double JDE, double* v) const |
2352 | 504 | { | 495 | { |
2354 | 505 | Vec3d pos = positionAtTime(JD); | 496 | Vec3d pos = positionAtTime(JDE); |
2355 | 506 | v[0] = rotateToVsop87[0]*pos[0] + rotateToVsop87[1]*pos[1] + rotateToVsop87[2]*pos[2]; | 497 | v[0] = rotateToVsop87[0]*pos[0] + rotateToVsop87[1]*pos[1] + rotateToVsop87[2]*pos[2]; |
2356 | 507 | v[1] = rotateToVsop87[3]*pos[0] + rotateToVsop87[4]*pos[1] + rotateToVsop87[5]*pos[2]; | 498 | v[1] = rotateToVsop87[3]*pos[0] + rotateToVsop87[4]*pos[1] + rotateToVsop87[5]*pos[2]; |
2357 | 508 | v[2] = rotateToVsop87[6]*pos[0] + rotateToVsop87[7]*pos[1] + rotateToVsop87[8]*pos[2]; | 499 | v[2] = rotateToVsop87[6]*pos[0] + rotateToVsop87[7]*pos[1] + rotateToVsop87[8]*pos[2]; |
2358 | @@ -529,12 +520,12 @@ | |||
2359 | 529 | } | 520 | } |
2360 | 530 | 521 | ||
2361 | 531 | 522 | ||
2363 | 532 | Vec3d CachingOrbit::positionAtTime(double jd) const | 523 | Vec3d CachingOrbit::positionAtTime(double JDE) const |
2364 | 533 | { | 524 | { |
2366 | 534 | if (jd != lastTime) | 525 | if (JDE != lastTime) |
2367 | 535 | { | 526 | { |
2370 | 536 | lastTime = jd; | 527 | lastTime = JDE; |
2371 | 537 | lastPosition = computePosition(jd); | 528 | lastPosition = computePosition(JDE); |
2372 | 538 | } | 529 | } |
2373 | 539 | return lastPosition; | 530 | return lastPosition; |
2374 | 540 | } | 531 | } |
2375 | 541 | 532 | ||
2376 | === modified file 'src/core/modules/Orbit.hpp' | |||
2377 | --- src/core/modules/Orbit.hpp 2015-02-23 09:56:53 +0000 | |||
2378 | +++ src/core/modules/Orbit.hpp 2015-08-03 13:17:13 +0000 | |||
2379 | @@ -51,10 +51,10 @@ | |||
2380 | 51 | // which is the reference frame for VSOP87 | 51 | // which is the reference frame for VSOP87 |
2381 | 52 | // In order to rotate to VSOP87 | 52 | // In order to rotate to VSOP87 |
2382 | 53 | // parentRotObliquity and parentRotAscendingnode must be supplied. | 53 | // parentRotObliquity and parentRotAscendingnode must be supplied. |
2384 | 54 | void positionAtTimevInVSOP87Coordinates(const double JD, double* v) const; | 54 | void positionAtTimevInVSOP87Coordinates(const double JDE, double* v) const; |
2385 | 55 | 55 | ||
2386 | 56 | // Original one | 56 | // Original one |
2388 | 57 | Vec3d positionAtTime(const double JD) const; | 57 | Vec3d positionAtTime(const double JDE) const; |
2389 | 58 | double getPeriod() const; | 58 | double getPeriod() const; |
2390 | 59 | double getBoundingRadius() const; | 59 | double getBoundingRadius() const; |
2391 | 60 | virtual void sample(double, double, int, OrbitSampleProc&) const; | 60 | virtual void sample(double, double, int, OrbitSampleProc&) const; |
2392 | @@ -92,13 +92,13 @@ | |||
2393 | 92 | ); | 92 | ); |
2394 | 93 | // Compute the orbit for a specified Julian day and return a "stellarium compliant" function | 93 | // Compute the orbit for a specified Julian day and return a "stellarium compliant" function |
2395 | 94 | // GZ: new optional variable: updateVelocityVector, true required for dust tail orientation! | 94 | // GZ: new optional variable: updateVelocityVector, true required for dust tail orientation! |
2397 | 95 | void positionAtTimevInVSOP87Coordinates(double JD, double* v, bool updateVelocityVector=true); | 95 | void positionAtTimevInVSOP87Coordinates(double JDE, double* v, bool updateVelocityVector=true); |
2398 | 96 | // updating the tails is a bit expensive. try not to overdo it. | 96 | // updating the tails is a bit expensive. try not to overdo it. |
2399 | 97 | bool getUpdateTails() const { return updateTails; } | 97 | bool getUpdateTails() const { return updateTails; } |
2400 | 98 | void setUpdateTails(const bool update){ updateTails=update; } | 98 | void setUpdateTails(const bool update){ updateTails=update; } |
2402 | 99 | //! return speed value [AU/d] last computed by positionAtTimevInVSOP87Coordinates(JD, v, true) | 99 | //! return speed value [AU/d] last computed by positionAtTimevInVSOP87Coordinates(JDE, v, true) |
2403 | 100 | Vec3d getVelocity() const { return rdot; } | 100 | Vec3d getVelocity() const { return rdot; } |
2405 | 101 | bool objectDateValid(const double JD) const { return (fabs(t0-JD)<orbitGood); } | 101 | bool objectDateValid(const double JDE) const { return (fabs(t0-JDE)<orbitGood); } |
2406 | 102 | private: | 102 | private: |
2407 | 103 | const double q; //! perihel distance | 103 | const double q; //! perihel distance |
2408 | 104 | const double e; //! eccentricity | 104 | const double e; //! eccentricity |
2409 | @@ -134,11 +134,11 @@ | |||
2410 | 134 | public: | 134 | public: |
2411 | 135 | CachingOrbit() : lastTime(1.0e-30) {} //; | 135 | CachingOrbit() : lastTime(1.0e-30) {} //; |
2412 | 136 | 136 | ||
2414 | 137 | virtual Vec3d computePosition(double jd) const = 0; | 137 | virtual Vec3d computePosition(double JDE) const = 0; |
2415 | 138 | virtual double getPeriod() const = 0; | 138 | virtual double getPeriod() const = 0; |
2416 | 139 | virtual double getBoundingRadius() const = 0; | 139 | virtual double getBoundingRadius() const = 0; |
2417 | 140 | 140 | ||
2419 | 141 | Vec3d positionAtTime(double jd) const; | 141 | Vec3d positionAtTime(double JDE) const; |
2420 | 142 | 142 | ||
2421 | 143 | virtual void sample(double, double, int, OrbitSampleProc& proc) const; | 143 | virtual void sample(double, double, int, OrbitSampleProc& proc) const; |
2422 | 144 | 144 | ||
2423 | 145 | 145 | ||
2424 | === modified file 'src/core/modules/Planet.cpp' | |||
2425 | --- src/core/modules/Planet.cpp 2015-07-28 13:20:32 +0000 | |||
2426 | +++ src/core/modules/Planet.cpp 2015-08-03 13:17:13 +0000 | |||
2427 | @@ -86,7 +86,7 @@ | |||
2428 | 86 | axisRotation(0.), | 86 | axisRotation(0.), |
2429 | 87 | rings(NULL), | 87 | rings(NULL), |
2430 | 88 | sphereScale(1.f), | 88 | sphereScale(1.f), |
2432 | 89 | lastJD(J2000), | 89 | lastJDE(J2000), |
2433 | 90 | coordFunc(coordFunc), | 90 | coordFunc(coordFunc), |
2434 | 91 | userDataPtr(auserDataPtr), | 91 | userDataPtr(auserDataPtr), |
2435 | 92 | osculatingFunc(osculatingFunc), | 92 | osculatingFunc(osculatingFunc), |
2436 | @@ -97,11 +97,11 @@ | |||
2437 | 97 | { | 97 | { |
2438 | 98 | texMapName = atexMapName; | 98 | texMapName = atexMapName; |
2439 | 99 | normalMapName = anormalMapName; | 99 | normalMapName = anormalMapName; |
2442 | 100 | lastOrbitJD =0; | 100 | lastOrbitJDE =0; |
2443 | 101 | deltaJD = StelCore::JD_SECOND; | 101 | deltaJDE = StelCore::JD_SECOND; |
2444 | 102 | orbitCached = 0; | 102 | orbitCached = 0; |
2445 | 103 | closeOrbit = acloseOrbit; | 103 | closeOrbit = acloseOrbit; |
2447 | 104 | deltaOrbitJD = 0; | 104 | deltaOrbitJDE = 0; |
2448 | 105 | distance = 0; | 105 | distance = 0; |
2449 | 106 | 106 | ||
2450 | 107 | // Initialize pType with the key found in pTypeMap, or mark planet type as undefined. | 107 | // Initialize pType with the key found in pTypeMap, or mark planet type as undefined. |
2451 | @@ -118,7 +118,7 @@ | |||
2452 | 118 | nativeName = ""; | 118 | nativeName = ""; |
2453 | 119 | if (englishName!="Pluto") | 119 | if (englishName!="Pluto") |
2454 | 120 | { | 120 | { |
2456 | 121 | deltaJD = 0.001*StelCore::JD_SECOND; | 121 | deltaJDE = 0.001*StelCore::JD_SECOND; |
2457 | 122 | } | 122 | } |
2458 | 123 | flagLabels = true; | 123 | flagLabels = true; |
2459 | 124 | flagNativeName = true; | 124 | flagNativeName = true; |
2460 | @@ -383,7 +383,7 @@ | |||
2461 | 383 | re.precessionRate = _precessionRate; | 383 | re.precessionRate = _precessionRate; |
2462 | 384 | re.siderealPeriod = _siderealPeriod; // used for drawing orbit lines | 384 | re.siderealPeriod = _siderealPeriod; // used for drawing orbit lines |
2463 | 385 | 385 | ||
2465 | 386 | deltaOrbitJD = re.siderealPeriod/ORBIT_SEGMENTS; | 386 | deltaOrbitJDE = re.siderealPeriod/ORBIT_SEGMENTS; |
2466 | 387 | } | 387 | } |
2467 | 388 | 388 | ||
2468 | 389 | Vec3d Planet::getJ2000EquatorialPos(const StelCore *core) const | 389 | Vec3d Planet::getJ2000EquatorialPos(const StelCore *core) const |
2469 | @@ -393,12 +393,12 @@ | |||
2470 | 393 | 393 | ||
2471 | 394 | // Compute the position in the parent Planet coordinate system | 394 | // Compute the position in the parent Planet coordinate system |
2472 | 395 | // Actually call the provided function to compute the ecliptical position | 395 | // Actually call the provided function to compute the ecliptical position |
2474 | 396 | void Planet::computePositionWithoutOrbits(const double dateJD) | 396 | void Planet::computePositionWithoutOrbits(const double dateJDE) |
2475 | 397 | { | 397 | { |
2477 | 398 | if (fabs(lastJD-dateJD)>deltaJD) | 398 | if (fabs(lastJDE-dateJDE)>deltaJDE) |
2478 | 399 | { | 399 | { |
2481 | 400 | coordFunc(dateJD, eclipticPos, userDataPtr); | 400 | coordFunc(dateJDE, eclipticPos, userDataPtr); |
2482 | 401 | lastJD = dateJD; | 401 | lastJDE = dateJDE; |
2483 | 402 | } | 402 | } |
2484 | 403 | } | 403 | } |
2485 | 404 | 404 | ||
2486 | @@ -406,11 +406,11 @@ | |||
2487 | 406 | // TODO: For earth, decide whether this should be Capitaine's omega_A (angle eclipticPoleJ2000//axis) or epsilon_A (angle axis//current ecliptic pole) | 406 | // TODO: For earth, decide whether this should be Capitaine's omega_A (angle eclipticPoleJ2000//axis) or epsilon_A (angle axis//current ecliptic pole) |
2488 | 407 | // For now, it is epsilon_A, the angle between earth's rotational axis and mean ecliptic of date. | 407 | // For now, it is epsilon_A, the angle between earth's rotational axis and mean ecliptic of date. |
2489 | 408 | // Details: e.g. Hilton etal, Report on Precession and the Ecliptic, Cel.Mech.Dyn.Astr.94:351-67 (2006), Fig1. | 408 | // Details: e.g. Hilton etal, Report on Precession and the Ecliptic, Cel.Mech.Dyn.Astr.94:351-67 (2006), Fig1. |
2491 | 409 | double Planet::getRotObliquity(double JDay) const | 409 | double Planet::getRotObliquity(double JDE) const |
2492 | 410 | { | 410 | { |
2493 | 411 | // JDay=2451545.0 for J2000.0 | 411 | // JDay=2451545.0 for J2000.0 |
2494 | 412 | if (englishName=="Earth") | 412 | if (englishName=="Earth") |
2496 | 413 | return get_mean_ecliptical_obliquity(JDay) *M_PI/180.0; | 413 | return get_mean_ecliptical_obliquity(JDE) *M_PI/180.0; |
2497 | 414 | else | 414 | else |
2498 | 415 | return re.obliquity; | 415 | return re.obliquity; |
2499 | 416 | } | 416 | } |
2500 | @@ -459,28 +459,30 @@ | |||
2501 | 459 | return res; | 459 | return res; |
2502 | 460 | } | 460 | } |
2503 | 461 | 461 | ||
2505 | 462 | void Planet::computePosition(const double dateJD) | 462 | void Planet::computePosition(const double dateJDE) |
2506 | 463 | { | 463 | { |
2507 | 464 | // Make sure the parent position is computed for the dateJD, otherwise | 464 | // Make sure the parent position is computed for the dateJD, otherwise |
2508 | 465 | // getHeliocentricPos() would return incorect values. | 465 | // getHeliocentricPos() would return incorect values. |
2509 | 466 | if (parent) | 466 | if (parent) |
2511 | 467 | parent->computePositionWithoutOrbits(dateJD); | 467 | parent->computePositionWithoutOrbits(dateJDE); |
2512 | 468 | 468 | ||
2514 | 469 | if (orbitFader.getInterstate()>0.000001 && deltaOrbitJD > 0 && (fabs(lastOrbitJD-dateJD)>deltaOrbitJD || !orbitCached)) | 469 | if (orbitFader.getInterstate()>0.000001 && deltaOrbitJDE > 0 && (fabs(lastOrbitJDE-dateJDE)>deltaOrbitJDE || !orbitCached)) |
2515 | 470 | { | 470 | { |
2516 | 471 | StelCore *core=StelApp::getInstance().getCore(); | ||
2517 | 472 | |||
2518 | 471 | double calc_date; | 473 | double calc_date; |
2519 | 472 | // int delta_points = (int)(0.5 + (date - lastOrbitJD)/date_increment); | 474 | // int delta_points = (int)(0.5 + (date - lastOrbitJD)/date_increment); |
2520 | 473 | int delta_points; | 475 | int delta_points; |
2521 | 474 | 476 | ||
2523 | 475 | if( dateJD > lastOrbitJD ) | 477 | if( dateJDE > lastOrbitJDE ) |
2524 | 476 | { | 478 | { |
2526 | 477 | delta_points = (int)(0.5 + (dateJD - lastOrbitJD)/deltaOrbitJD); | 479 | delta_points = (int)(0.5 + (dateJDE - lastOrbitJDE)/deltaOrbitJDE); |
2527 | 478 | } | 480 | } |
2528 | 479 | else | 481 | else |
2529 | 480 | { | 482 | { |
2531 | 481 | delta_points = (int)(-0.5 + (dateJD - lastOrbitJD)/deltaOrbitJD); | 483 | delta_points = (int)(-0.5 + (dateJDE - lastOrbitJDE)/deltaOrbitJDE); |
2532 | 482 | } | 484 | } |
2534 | 483 | double new_date = lastOrbitJD + delta_points*deltaOrbitJD; | 485 | double new_date = lastOrbitJDE + delta_points*deltaOrbitJDE; |
2535 | 484 | 486 | ||
2536 | 485 | // qDebug( "Updating orbit coordinates for %s (delta %f) (%d points)\n", getEnglishName().toUtf8().data(), deltaOrbitJD, delta_points); | 487 | // qDebug( "Updating orbit coordinates for %s (delta %f) (%d points)\n", getEnglishName().toUtf8().data(), deltaOrbitJD, delta_points); |
2537 | 486 | 488 | ||
2538 | @@ -492,13 +494,13 @@ | |||
2539 | 492 | if(d + delta_points >= ORBIT_SEGMENTS ) | 494 | if(d + delta_points >= ORBIT_SEGMENTS ) |
2540 | 493 | { | 495 | { |
2541 | 494 | // calculate new points | 496 | // calculate new points |
2543 | 495 | calc_date = new_date + (d-ORBIT_SEGMENTS/2)*deltaOrbitJD; | 497 | calc_date = new_date + (d-ORBIT_SEGMENTS/2)*deltaOrbitJDE; |
2544 | 496 | 498 | ||
2545 | 497 | // date increments between points will not be completely constant though | 499 | // date increments between points will not be completely constant though |
2547 | 498 | computeTransMatrix(calc_date); | 500 | computeTransMatrix(calc_date-core->computeDeltaT(calc_date)/86400.0, calc_date); |
2548 | 499 | if (osculatingFunc) | 501 | if (osculatingFunc) |
2549 | 500 | { | 502 | { |
2551 | 501 | (*osculatingFunc)(dateJD,calc_date,eclipticPos); | 503 | (*osculatingFunc)(dateJDE,calc_date,eclipticPos); |
2552 | 502 | } | 504 | } |
2553 | 503 | else | 505 | else |
2554 | 504 | { | 506 | { |
2555 | @@ -514,7 +516,7 @@ | |||
2556 | 514 | } | 516 | } |
2557 | 515 | } | 517 | } |
2558 | 516 | 518 | ||
2560 | 517 | lastOrbitJD = new_date; | 519 | lastOrbitJDE = new_date; |
2561 | 518 | } | 520 | } |
2562 | 519 | else if( delta_points < 0 && abs(delta_points) < ORBIT_SEGMENTS && orbitCached) | 521 | else if( delta_points < 0 && abs(delta_points) < ORBIT_SEGMENTS && orbitCached) |
2563 | 520 | { | 522 | { |
2564 | @@ -524,11 +526,11 @@ | |||
2565 | 524 | if(d + delta_points < 0 ) | 526 | if(d + delta_points < 0 ) |
2566 | 525 | { | 527 | { |
2567 | 526 | // calculate new points | 528 | // calculate new points |
2569 | 527 | calc_date = new_date + (d-ORBIT_SEGMENTS/2)*deltaOrbitJD; | 529 | calc_date = new_date + (d-ORBIT_SEGMENTS/2)*deltaOrbitJDE; |
2570 | 528 | 530 | ||
2572 | 529 | computeTransMatrix(calc_date); | 531 | computeTransMatrix(calc_date-core->computeDeltaT(calc_date)/86400.0, calc_date); |
2573 | 530 | if (osculatingFunc) { | 532 | if (osculatingFunc) { |
2575 | 531 | (*osculatingFunc)(dateJD,calc_date,eclipticPos); | 533 | (*osculatingFunc)(dateJDE,calc_date,eclipticPos); |
2576 | 532 | } | 534 | } |
2577 | 533 | else | 535 | else |
2578 | 534 | { | 536 | { |
2579 | @@ -544,7 +546,7 @@ | |||
2580 | 544 | } | 546 | } |
2581 | 545 | } | 547 | } |
2582 | 546 | 548 | ||
2584 | 547 | lastOrbitJD = new_date; | 549 | lastOrbitJDE = new_date; |
2585 | 548 | 550 | ||
2586 | 549 | } | 551 | } |
2587 | 550 | else if( delta_points || !orbitCached) | 552 | else if( delta_points || !orbitCached) |
2588 | @@ -553,11 +555,11 @@ | |||
2589 | 553 | // update all points (less efficient) | 555 | // update all points (less efficient) |
2590 | 554 | for( int d=0; d<ORBIT_SEGMENTS; d++ ) | 556 | for( int d=0; d<ORBIT_SEGMENTS; d++ ) |
2591 | 555 | { | 557 | { |
2594 | 556 | calc_date = dateJD + (d-ORBIT_SEGMENTS/2)*deltaOrbitJD; | 558 | calc_date = dateJDE + (d-ORBIT_SEGMENTS/2)*deltaOrbitJDE; |
2595 | 557 | computeTransMatrix(calc_date); | 559 | computeTransMatrix(calc_date-core->computeDeltaT(calc_date)/86400.0, calc_date); |
2596 | 558 | if (osculatingFunc) | 560 | if (osculatingFunc) |
2597 | 559 | { | 561 | { |
2599 | 560 | (*osculatingFunc)(dateJD,calc_date,eclipticPos); | 562 | (*osculatingFunc)(dateJDE,calc_date,eclipticPos); |
2600 | 561 | } | 563 | } |
2601 | 562 | else | 564 | else |
2602 | 563 | { | 565 | { |
2603 | @@ -567,36 +569,36 @@ | |||
2604 | 567 | orbit[d] = getHeliocentricEclipticPos(); | 569 | orbit[d] = getHeliocentricEclipticPos(); |
2605 | 568 | } | 570 | } |
2606 | 569 | 571 | ||
2608 | 570 | lastOrbitJD = dateJD; | 572 | lastOrbitJDE = dateJDE; |
2609 | 571 | if (!osculatingFunc) orbitCached = 1; | 573 | if (!osculatingFunc) orbitCached = 1; |
2610 | 572 | } | 574 | } |
2611 | 573 | 575 | ||
2612 | 574 | 576 | ||
2613 | 575 | // calculate actual Planet position | 577 | // calculate actual Planet position |
2615 | 576 | coordFunc(dateJD, eclipticPos, userDataPtr); | 578 | coordFunc(dateJDE, eclipticPos, userDataPtr); |
2616 | 577 | 579 | ||
2618 | 578 | lastJD = dateJD; | 580 | lastJDE = dateJDE; |
2619 | 579 | 581 | ||
2620 | 580 | } | 582 | } |
2622 | 581 | else if (fabs(lastJD-dateJD)>deltaJD) | 583 | else if (fabs(lastJDE-dateJDE)>deltaJDE) |
2623 | 582 | { | 584 | { |
2624 | 583 | // calculate actual Planet position | 585 | // calculate actual Planet position |
2626 | 584 | coordFunc(dateJD, eclipticPos, userDataPtr); | 586 | coordFunc(dateJDE, eclipticPos, userDataPtr); |
2627 | 585 | // XXX: do we need to do that even when the orbit is not visible? | 587 | // XXX: do we need to do that even when the orbit is not visible? |
2628 | 586 | for( int d=0; d<ORBIT_SEGMENTS; d++ ) | 588 | for( int d=0; d<ORBIT_SEGMENTS; d++ ) |
2629 | 587 | orbit[d]=getHeliocentricPos(orbitP[d]); | 589 | orbit[d]=getHeliocentricPos(orbitP[d]); |
2631 | 588 | lastJD = dateJD; | 590 | lastJDE = dateJDE; |
2632 | 589 | } | 591 | } |
2633 | 590 | 592 | ||
2634 | 591 | } | 593 | } |
2635 | 592 | 594 | ||
2636 | 593 | // Compute the transformation matrix from the local Planet coordinate system to the parent Planet coordinate system. | 595 | // Compute the transformation matrix from the local Planet coordinate system to the parent Planet coordinate system. |
2638 | 594 | // In case of the planets, this makes the axis point to the respective celestial pole. | 596 | // In case of the planets, this makes the axis point to their respective celestial poles. |
2639 | 595 | // TODO: Verify for the other planets if their axes are relative to J2000 ecliptic (VSOP87A XY plane) or relative to (precessed) ecliptic of date? | 597 | // TODO: Verify for the other planets if their axes are relative to J2000 ecliptic (VSOP87A XY plane) or relative to (precessed) ecliptic of date? |
2641 | 596 | void Planet::computeTransMatrix(double jd) | 598 | void Planet::computeTransMatrix(double JD, double JDE) |
2642 | 597 | { | 599 | { |
2645 | 598 | // TODO: correct this for earth with the new model. | 600 | // We have to call with both to correct this for earth with the new model. |
2646 | 599 | axisRotation = getSiderealTime(jd); | 601 | axisRotation = getSiderealTime(JD, JDE); |
2647 | 600 | 602 | ||
2648 | 601 | // Special case - heliocentric coordinates are relative to eclipticJ2000 (VSOP87A XY plane), | 603 | // Special case - heliocentric coordinates are relative to eclipticJ2000 (VSOP87A XY plane), |
2649 | 602 | // not solar equator... | 604 | // not solar equator... |
2650 | @@ -611,7 +613,7 @@ | |||
2651 | 611 | // ADS: 2011A&A...534A..22V = A&A 534, A22 (2011): Vondrak, Capitane, Wallace: New Precession Expressions, valid for long time intervals: | 613 | // ADS: 2011A&A...534A..22V = A&A 534, A22 (2011): Vondrak, Capitane, Wallace: New Precession Expressions, valid for long time intervals: |
2652 | 612 | // See also Hilton et al, Report on Precession and the Ecliptic. Cel.Mech.Dyn.Astr. 94:351-367 (2006). | 614 | // See also Hilton et al, Report on Precession and the Ecliptic. Cel.Mech.Dyn.Astr. 94:351-367 (2006). |
2653 | 613 | double eps_A, chi_A, omega_A, psi_A; | 615 | double eps_A, chi_A, omega_A, psi_A; |
2655 | 614 | getPrecessionAnglesVondrak(jd, &eps_A, &chi_A, &omega_A, &psi_A); | 616 | getPrecessionAnglesVondrak(JDE, &eps_A, &chi_A, &omega_A, &psi_A); |
2656 | 615 | // GZ This is the right combination for precession of the equator: Nodal rotation psi_A, | 617 | // GZ This is the right combination for precession of the equator: Nodal rotation psi_A, |
2657 | 616 | // then rotation by omega_A, the angle between EclPoleJ2000 and EarthPoleOfDate. | 618 | // then rotation by omega_A, the angle between EclPoleJ2000 and EarthPoleOfDate. |
2658 | 617 | // The final rotation by chi_A rotates the equinox (zero degree). | 619 | // The final rotation by chi_A rotates the equinox (zero degree). |
2659 | @@ -619,7 +621,7 @@ | |||
2660 | 619 | rotLocalToParent= Mat4d::zrotation(-psi_A) * Mat4d::xrotation(-omega_A) * Mat4d::zrotation(chi_A); | 621 | rotLocalToParent= Mat4d::zrotation(-psi_A) * Mat4d::xrotation(-omega_A) * Mat4d::zrotation(chi_A); |
2661 | 620 | } | 622 | } |
2662 | 621 | else | 623 | else |
2664 | 622 | rotLocalToParent = Mat4d::zrotation(re.ascendingNode - re.precessionRate*(jd-re.epoch)) * Mat4d::xrotation(re.obliquity); | 624 | rotLocalToParent = Mat4d::zrotation(re.ascendingNode - re.precessionRate*(JDE-re.epoch)) * Mat4d::xrotation(re.obliquity); |
2665 | 623 | } | 625 | } |
2666 | 624 | } | 626 | } |
2667 | 625 | 627 | ||
2668 | @@ -646,15 +648,16 @@ | |||
2669 | 646 | } | 648 | } |
2670 | 647 | 649 | ||
2671 | 648 | 650 | ||
2674 | 649 | // Compute the z rotation to use from equatorial to geographic coordinates | 651 | // Compute the z rotation to use from equatorial to geographic coordinates. |
2675 | 650 | double Planet::getSiderealTime(double jd) const | 652 | // We need both JD and JDE here: For Earth we use JD(UT), for other planets JDE(TT). |
2676 | 653 | double Planet::getSiderealTime(double JD, double JDE) const | ||
2677 | 651 | { | 654 | { |
2678 | 652 | if (englishName=="Earth") | 655 | if (englishName=="Earth") |
2679 | 653 | { // GZ I wanted to be sure that nutation is just those ignorable few arcseconds. | 656 | { // GZ I wanted to be sure that nutation is just those ignorable few arcseconds. |
2680 | 654 | //qDebug() << "Difference apparent-mean sidereal times (s): " << (get_apparent_sidereal_time(jd)- get_mean_sidereal_time(jd))* 240.0; // 1degree=4min=240s. | 657 | //qDebug() << "Difference apparent-mean sidereal times (s): " << (get_apparent_sidereal_time(jd)- get_mean_sidereal_time(jd))* 240.0; // 1degree=4min=240s. |
2681 | 655 | // TODO: Reactivate Nutation (but following IAU-2000A) after fixing JD_UT/JD_ET issues, then change this call back to apparent_sidereal_time. | 658 | // TODO: Reactivate Nutation (but following IAU-2000A) after fixing JD_UT/JD_ET issues, then change this call back to apparent_sidereal_time. |
2682 | 656 | //return get_apparent_sidereal_time(jd); | 659 | //return get_apparent_sidereal_time(jd); |
2684 | 657 | return get_mean_sidereal_time(jd); | 660 | return get_mean_sidereal_time(JD); |
2685 | 658 | 661 | ||
2686 | 659 | // In the newer precession/nutation literature (starting around 2006) there are two sets of algorithms: | 662 | // In the newer precession/nutation literature (starting around 2006) there are two sets of algorithms: |
2687 | 660 | // "Classical" sidereal time (Greenwich hour angle GHA) and a solution based on Earth Rotational Angle ERA. | 663 | // "Classical" sidereal time (Greenwich hour angle GHA) and a solution based on Earth Rotational Angle ERA. |
2688 | @@ -663,7 +666,7 @@ | |||
2689 | 663 | 666 | ||
2690 | 664 | } | 667 | } |
2691 | 665 | 668 | ||
2693 | 666 | double t = jd - re.epoch; | 669 | double t = JDE - re.epoch; |
2694 | 667 | // oops... avoid division by zero (typical case for moons with chaotic period of rotation) | 670 | // oops... avoid division by zero (typical case for moons with chaotic period of rotation) |
2695 | 668 | double rotations = 1.f; // NOTE: Maybe 1e-3 will be better? | 671 | double rotations = 1.f; // NOTE: Maybe 1e-3 will be better? |
2696 | 669 | if (re.period!=0.) // OK, it's not a moon with chaotic period of rotation :) | 672 | if (re.period!=0.) // OK, it's not a moon with chaotic period of rotation :) |
2697 | @@ -679,24 +682,24 @@ | |||
2698 | 679 | { | 682 | { |
2699 | 680 | // use semi-empirical coefficient for GRS drift | 683 | // use semi-empirical coefficient for GRS drift |
2700 | 681 | // qDebug() << "Jupiter: offset = " << re.offset << " --> rotation = " << (remainder * 360. + re.offset - 0.2483 * qAbs(jd - 2456172)); | 684 | // qDebug() << "Jupiter: offset = " << re.offset << " --> rotation = " << (remainder * 360. + re.offset - 0.2483 * qAbs(jd - 2456172)); |
2702 | 682 | return remainder * 360. + re.offset - 0.2483 * qAbs(jd - 2456172); | 685 | return remainder * 360. + re.offset - 0.2483 * qAbs(JDE - 2456172); |
2703 | 683 | } | 686 | } |
2704 | 684 | else | 687 | else |
2705 | 685 | { | 688 | { |
2706 | 686 | // http://www.projectpluto.com/grs_form.htm | 689 | // http://www.projectpluto.com/grs_form.htm |
2707 | 687 | // CM( System II) = 181.62 + 870.1869147 * jd + correction [870d rotation every day] | 690 | // CM( System II) = 181.62 + 870.1869147 * jd + correction [870d rotation every day] |
2708 | 688 | const double rad = M_PI/180.; | 691 | const double rad = M_PI/180.; |
2710 | 689 | double jup_mean = (jd - 2455636.938) * 360. / 4332.89709; | 692 | double jup_mean = (JDE - 2455636.938) * 360. / 4332.89709; |
2711 | 690 | double eqn_center = 5.55 * sin( rad*jup_mean); | 693 | double eqn_center = 5.55 * sin( rad*jup_mean); |
2713 | 691 | double angle = (jd - 2451870.628) * 360. / 398.884 - eqn_center; | 694 | double angle = (JDE - 2451870.628) * 360. / 398.884 - eqn_center; |
2714 | 692 | //double correction = 11 * sin( rad*angle) + 5 * cos( rad*angle)- 1.25 * cos( rad*jup_mean) - eqn_center; // original correction | 695 | //double correction = 11 * sin( rad*angle) + 5 * cos( rad*angle)- 1.25 * cos( rad*jup_mean) - eqn_center; // original correction |
2715 | 693 | double correction = 25.8 + 11 * sin( rad*angle) - 2.5 * cos( rad*jup_mean) - eqn_center; // light speed correction not used because in stellarium the jd is manipulated for that | 696 | double correction = 25.8 + 11 * sin( rad*angle) - 2.5 * cos( rad*jup_mean) - eqn_center; // light speed correction not used because in stellarium the jd is manipulated for that |
2717 | 694 | double cm2=181.62 + 870.1869147 * jd + correction; | 697 | double cm2=181.62 + 870.1869147 * JDE + correction; // Central Meridian II |
2718 | 695 | cm2=cm2 - 360.0*(int)(cm2/360.); | 698 | cm2=cm2 - 360.0*(int)(cm2/360.); |
2719 | 696 | // http://www.skyandtelescope.com/observing/transit-times-of-jupiters-great-red-spot/ writes: | 699 | // http://www.skyandtelescope.com/observing/transit-times-of-jupiters-great-red-spot/ writes: |
2720 | 697 | // The predictions assume the Red Spot was at Jovian System II longitude 216° in September 2014 and continues to drift 1.25° per month, based on historical trends noted by JUPOS. | 700 | // The predictions assume the Red Spot was at Jovian System II longitude 216° in September 2014 and continues to drift 1.25° per month, based on historical trends noted by JUPOS. |
2721 | 698 | // GRS longitude was at 2014-09-08 216d with a drift of 1.25d every month | 701 | // GRS longitude was at 2014-09-08 216d with a drift of 1.25d every month |
2723 | 699 | double longitudeGRS=216+1.25*( jd - 2456908)/30; | 702 | double longitudeGRS=216+1.25*( JDE - 2456908)/30; |
2724 | 700 | // qDebug() << "Jupiter: CM2 = " << cm2 << " longitudeGRS = " << longitudeGRS << " --> rotation = " << (cm2 - longitudeGRS); | 703 | // qDebug() << "Jupiter: CM2 = " << cm2 << " longitudeGRS = " << longitudeGRS << " --> rotation = " << (cm2 - longitudeGRS); |
2725 | 701 | return cm2 - longitudeGRS + 25.; // + 25 = Jupiter Texture not 0d | 704 | return cm2 - longitudeGRS + 25.; // + 25 = Jupiter Texture not 0d |
2726 | 702 | // To verify: | 705 | // To verify: |
2727 | @@ -799,7 +802,7 @@ | |||
2728 | 799 | distance = (obsHelioPos-getHeliocentricEclipticPos()).length(); | 802 | distance = (obsHelioPos-getHeliocentricEclipticPos()).length(); |
2729 | 800 | // improve fps by juggling updates for asteroids. They must be fast if close to observer, but can be slow if further away. | 803 | // improve fps by juggling updates for asteroids. They must be fast if close to observer, but can be slow if further away. |
2730 | 801 | if (pType == Planet::isAsteroid) | 804 | if (pType == Planet::isAsteroid) |
2732 | 802 | deltaJD=distance*StelCore::JD_SECOND; | 805 | deltaJDE=distance*StelCore::JD_SECOND; |
2733 | 803 | return distance; | 806 | return distance; |
2734 | 804 | } | 807 | } |
2735 | 805 | 808 | ||
2736 | @@ -929,8 +932,8 @@ | |||
2737 | 929 | { | 932 | { |
2738 | 930 | // add rings computation | 933 | // add rings computation |
2739 | 931 | // implemented from Meeus, Astr.Alg.1992 | 934 | // implemented from Meeus, Astr.Alg.1992 |
2742 | 932 | const double jd=core->getJDay(); | 935 | const double jde=core->getJDE(); |
2743 | 933 | const double T=(jd-2451545.0)/36525.0; | 936 | const double T=(jde-2451545.0)/36525.0; |
2744 | 934 | const double i=((0.000004*T-0.012998)*T+28.075216)*M_PI/180.0; | 937 | const double i=((0.000004*T-0.012998)*T+28.075216)*M_PI/180.0; |
2745 | 935 | const double Omega=((0.000412*T+1.394681)*T+169.508470)*M_PI/180.0; | 938 | const double Omega=((0.000412*T+1.394681)*T+169.508470)*M_PI/180.0; |
2746 | 936 | static SolarSystem *ssystem=GETSTELMODULE(SolarSystem); | 939 | static SolarSystem *ssystem=GETSTELMODULE(SolarSystem); |
2747 | @@ -968,8 +971,8 @@ | |||
2748 | 968 | { | 971 | { |
2749 | 969 | // add rings computation | 972 | // add rings computation |
2750 | 970 | // implemented from Meeus, Astr.Alg.1992 | 973 | // implemented from Meeus, Astr.Alg.1992 |
2753 | 971 | const double jd=core->getJDay(); | 974 | const double jde=core->getJDE(); |
2754 | 972 | const double T=(jd-2451545.0)/36525.0; | 975 | const double T=(jde-2451545.0)/36525.0; |
2755 | 973 | const double i=((0.000004*T-0.012998)*T+28.075216)*M_PI/180.0; | 976 | const double i=((0.000004*T-0.012998)*T+28.075216)*M_PI/180.0; |
2756 | 974 | const double Omega=((0.000412*T+1.394681)*T+169.508470)*M_PI/180.0; | 977 | const double Omega=((0.000412*T+1.394681)*T+169.508470)*M_PI/180.0; |
2757 | 975 | SolarSystem *ssystem=GETSTELMODULE(SolarSystem); | 978 | SolarSystem *ssystem=GETSTELMODULE(SolarSystem); |
2758 | @@ -1006,8 +1009,8 @@ | |||
2759 | 1006 | { | 1009 | { |
2760 | 1007 | // add rings computation | 1010 | // add rings computation |
2761 | 1008 | // implemented from Meeus, Astr.Alg.1992 | 1011 | // implemented from Meeus, Astr.Alg.1992 |
2764 | 1009 | const double jd=core->getJDay(); | 1012 | const double jde=core->getJDE(); |
2765 | 1010 | const double T=(jd-2451545.0)/36525.0; | 1013 | const double T=(jde-2451545.0)/36525.0; |
2766 | 1011 | const double i=((0.000004*T-0.012998)*T+28.075216)*M_PI/180.0; | 1014 | const double i=((0.000004*T-0.012998)*T+28.075216)*M_PI/180.0; |
2767 | 1012 | const double Omega=((0.000412*T+1.394681)*T+169.508470)*M_PI/180.0; | 1015 | const double Omega=((0.000412*T+1.394681)*T+169.508470)*M_PI/180.0; |
2768 | 1013 | static SolarSystem *ssystem=GETSTELMODULE(SolarSystem); | 1016 | static SolarSystem *ssystem=GETSTELMODULE(SolarSystem); |
2769 | 1014 | 1017 | ||
2770 | === modified file 'src/core/modules/Planet.hpp' | |||
2771 | --- src/core/modules/Planet.hpp 2015-07-27 13:25:39 +0000 | |||
2772 | +++ src/core/modules/Planet.hpp 2015-08-03 13:17:13 +0000 | |||
2773 | @@ -33,7 +33,7 @@ | |||
2774 | 33 | // The last variable is the userData pointer. | 33 | // The last variable is the userData pointer. |
2775 | 34 | typedef void (*posFuncType)(double, double*, void*); | 34 | typedef void (*posFuncType)(double, double*, void*); |
2776 | 35 | 35 | ||
2778 | 36 | typedef void (OsculatingFunctType)(double jd0,double jd,double xyz[3]); | 36 | typedef void (OsculatingFunctType)(double jde0,double jde,double xyz[3]); |
2779 | 37 | 37 | ||
2780 | 38 | // epoch J2000: 12 UT on 1 Jan 2000 | 38 | // epoch J2000: 12 UT on 1 Jan 2000 |
2781 | 39 | #define J2000 2451545.0 | 39 | #define J2000 2451545.0 |
2782 | @@ -51,7 +51,7 @@ | |||
2783 | 51 | RotationElements(void) : period(1.), offset(0.), epoch(J2000), obliquity(0.), ascendingNode(0.), precessionRate(0.), siderealPeriod(0.) {} | 51 | RotationElements(void) : period(1.), offset(0.), epoch(J2000), obliquity(0.), ascendingNode(0.), precessionRate(0.), siderealPeriod(0.) {} |
2784 | 52 | float period; // (sidereal) rotation period [earth days] | 52 | float period; // (sidereal) rotation period [earth days] |
2785 | 53 | float offset; // rotation at epoch [degrees] | 53 | float offset; // rotation at epoch [degrees] |
2787 | 54 | double epoch; // JD (TD) of epoch for these elements | 54 | double epoch; // JDE (JD TT) of epoch for these elements |
2788 | 55 | float obliquity; // tilt of rotation axis w.r.t. ecliptic [radians] | 55 | float obliquity; // tilt of rotation axis w.r.t. ecliptic [radians] |
2789 | 56 | float ascendingNode; // long. of ascending node of equator on the ecliptic [radians] | 56 | float ascendingNode; // long. of ascending node of equator on the ecliptic [radians] |
2790 | 57 | float precessionRate; // rate of precession of rotation axis in [rads/JulianCentury(36525d)] | 57 | float precessionRate; // rate of precession of rotation axis in [rads/JulianCentury(36525d)] |
2791 | @@ -192,20 +192,22 @@ | |||
2792 | 192 | const QString getApparentMagnitudeAlgorithmString() const { return vMagAlgorithmMap.value(vMagAlgorithm); } | 192 | const QString getApparentMagnitudeAlgorithmString() const { return vMagAlgorithmMap.value(vMagAlgorithm); } |
2793 | 193 | void setApparentMagnitudeAlgorithm(QString algorithm); | 193 | void setApparentMagnitudeAlgorithm(QString algorithm); |
2794 | 194 | 194 | ||
2797 | 195 | // Compute the z rotation to use from equatorial to geographic coordinates | 195 | //! Compute the z rotation to use from equatorial to geographic coordinates. For general applicability we need both time flavours: |
2798 | 196 | double getSiderealTime(double jd) const; | 196 | //! @param JD is JD(UT) for Earth |
2799 | 197 | //! @param JDE is used for other locations | ||
2800 | 198 | double getSiderealTime(double JD, double JDE) const; | ||
2801 | 197 | Mat4d getRotEquatorialToVsop87(void) const; | 199 | Mat4d getRotEquatorialToVsop87(void) const; |
2802 | 198 | void setRotEquatorialToVsop87(const Mat4d &m); | 200 | void setRotEquatorialToVsop87(const Mat4d &m); |
2803 | 199 | 201 | ||
2804 | 200 | const RotationElements &getRotationElements(void) const {return re;} | 202 | const RotationElements &getRotationElements(void) const {return re;} |
2805 | 201 | 203 | ||
2806 | 202 | // Compute the position in the parent Planet coordinate system | 204 | // Compute the position in the parent Planet coordinate system |
2810 | 203 | void computePositionWithoutOrbits(const double dateJD); | 205 | void computePositionWithoutOrbits(const double dateJDE); |
2811 | 204 | //virtual void computePosition(const double dateJD);// GZ: gets overridden in Comet! | 206 | void computePosition(const double dateJDE); |
2809 | 205 | void computePosition(const double dateJD);// GZ: gets overridden in Comet! | ||
2812 | 206 | 207 | ||
2815 | 207 | // Compute the transformation matrix from the local Planet coordinate to the parent Planet coordinate | 208 | // Compute the transformation matrix from the local Planet coordinate to the parent Planet coordinate. |
2816 | 208 | void computeTransMatrix(double date); | 209 | // This requires both flavours of JD in cases involving Earth. |
2817 | 210 | void computeTransMatrix(double JD, double JDE); | ||
2818 | 209 | 211 | ||
2819 | 210 | // Get the phase angle (rad) for an observer at pos obsPos in heliocentric coordinates (in AU) | 212 | // Get the phase angle (rad) for an observer at pos obsPos in heliocentric coordinates (in AU) |
2820 | 211 | double getPhaseAngle(const Vec3d& obsPos) const; | 213 | double getPhaseAngle(const Vec3d& obsPos) const; |
2821 | @@ -223,7 +225,7 @@ | |||
2822 | 223 | double getRotAscendingnode(void) const {return re.ascendingNode;} | 225 | double getRotAscendingnode(void) const {return re.ascendingNode;} |
2823 | 224 | // return angle between axis and normal of ecliptic plane (or, for a moon, equatorial/reference plane defined by parent). | 226 | // return angle between axis and normal of ecliptic plane (or, for a moon, equatorial/reference plane defined by parent). |
2824 | 225 | // TODO: decide if this is always angle between axis and J2000 ecliptic, or should be axis//current ecliptic! | 227 | // TODO: decide if this is always angle between axis and J2000 ecliptic, or should be axis//current ecliptic! |
2826 | 226 | double getRotObliquity(double JDay) const; | 228 | double getRotObliquity(double JDE) const; |
2827 | 227 | 229 | ||
2828 | 228 | //! Get the Planet position in the parent Planet ecliptic coordinate in AU | 230 | //! Get the Planet position in the parent Planet ecliptic coordinate in AU |
2829 | 229 | Vec3d getEclipticPos() const; | 231 | Vec3d getEclipticPos() const; |
2830 | @@ -277,9 +279,9 @@ | |||
2831 | 277 | void drawOrbit(const StelCore*); | 279 | void drawOrbit(const StelCore*); |
2832 | 278 | Vec3d orbit[ORBIT_SEGMENTS+1]; // store heliocentric coordinates for drawing the orbit | 280 | Vec3d orbit[ORBIT_SEGMENTS+1]; // store heliocentric coordinates for drawing the orbit |
2833 | 279 | Vec3d orbitP[ORBIT_SEGMENTS+1]; // store local coordinate for orbit | 281 | Vec3d orbitP[ORBIT_SEGMENTS+1]; // store local coordinate for orbit |
2837 | 280 | double lastOrbitJD; | 282 | double lastOrbitJDE; |
2838 | 281 | double deltaJD; // time difference between positional updates. | 283 | double deltaJDE; // time difference between positional updates. |
2839 | 282 | double deltaOrbitJD; | 284 | double deltaOrbitJDE; |
2840 | 283 | bool orbitCached; // whether orbit calculations are cached for drawing orbit yet | 285 | bool orbitCached; // whether orbit calculations are cached for drawing orbit yet |
2841 | 284 | bool closeOrbit; // whether to connect the beginning of the orbit line to | 286 | bool closeOrbit; // whether to connect the beginning of the orbit line to |
2842 | 285 | // the end: good for elliptical orbits, bad for parabolic | 287 | // the end: good for elliptical orbits, bad for parabolic |
2843 | @@ -336,8 +338,8 @@ | |||
2844 | 336 | double distance; // Temporary variable used to store the distance to a given point | 338 | double distance; // Temporary variable used to store the distance to a given point |
2845 | 337 | // it is used for sorting while drawing | 339 | // it is used for sorting while drawing |
2846 | 338 | float sphereScale; // Artificial scaling for better viewing | 340 | float sphereScale; // Artificial scaling for better viewing |
2849 | 339 | double lastJD; // caches JD of last positional computation | 341 | double lastJDE; // caches JDE of last positional computation |
2850 | 340 | // The callback for the calculation of the equatorial rect heliocentric position at time JD. | 342 | // The callback for the calculation of the equatorial rect heliocentric position at time JDE. |
2851 | 341 | posFuncType coordFunc; | 343 | posFuncType coordFunc; |
2852 | 342 | void* userDataPtr; // this is always used with an Orbit object. | 344 | void* userDataPtr; // this is always used with an Orbit object. |
2853 | 343 | 345 | ||
2854 | 344 | 346 | ||
2855 | === modified file 'src/core/modules/SolarSystem.cpp' | |||
2856 | --- src/core/modules/SolarSystem.cpp 2015-07-27 14:57:16 +0000 | |||
2857 | +++ src/core/modules/SolarSystem.cpp 2015-08-03 13:17:13 +0000 | |||
2858 | @@ -1024,47 +1024,49 @@ | |||
2859 | 1024 | 1024 | ||
2860 | 1025 | // Compute the position for every elements of the solar system. | 1025 | // Compute the position for every elements of the solar system. |
2861 | 1026 | // The order is not important since the position is computed relatively to the mother body | 1026 | // The order is not important since the position is computed relatively to the mother body |
2863 | 1027 | void SolarSystem::computePositions(double date, const Vec3d& observerPos) | 1027 | void SolarSystem::computePositions(double dateJDE, const Vec3d& observerPos) |
2864 | 1028 | { | 1028 | { |
2865 | 1029 | if (flagLightTravelTime) | 1029 | if (flagLightTravelTime) |
2866 | 1030 | { | 1030 | { |
2867 | 1031 | foreach (PlanetP p, systemPlanets) | 1031 | foreach (PlanetP p, systemPlanets) |
2868 | 1032 | { | 1032 | { |
2870 | 1033 | p->computePositionWithoutOrbits(date); | 1033 | p->computePositionWithoutOrbits(dateJDE); |
2871 | 1034 | } | 1034 | } |
2872 | 1035 | foreach (PlanetP p, systemPlanets) | 1035 | foreach (PlanetP p, systemPlanets) |
2873 | 1036 | { | 1036 | { |
2874 | 1037 | const double light_speed_correction = (p->getHeliocentricEclipticPos()-observerPos).length() * (AU / (SPEED_OF_LIGHT * 86400)); | 1037 | const double light_speed_correction = (p->getHeliocentricEclipticPos()-observerPos).length() * (AU / (SPEED_OF_LIGHT * 86400)); |
2876 | 1038 | p->computePosition(date-light_speed_correction); | 1038 | p->computePosition(dateJDE-light_speed_correction); |
2877 | 1039 | } | 1039 | } |
2878 | 1040 | } | 1040 | } |
2879 | 1041 | else | 1041 | else |
2880 | 1042 | { | 1042 | { |
2881 | 1043 | foreach (PlanetP p, systemPlanets) | 1043 | foreach (PlanetP p, systemPlanets) |
2882 | 1044 | { | 1044 | { |
2884 | 1045 | p->computePosition(date); | 1045 | p->computePosition(dateJDE); |
2885 | 1046 | } | 1046 | } |
2886 | 1047 | } | 1047 | } |
2888 | 1048 | computeTransMatrices(date, observerPos); | 1048 | computeTransMatrices(dateJDE, observerPos); |
2889 | 1049 | } | 1049 | } |
2890 | 1050 | 1050 | ||
2891 | 1051 | // Compute the transformation matrix for every elements of the solar system. | 1051 | // Compute the transformation matrix for every elements of the solar system. |
2892 | 1052 | // The elements have to be ordered hierarchically, eg. it's important to compute earth before moon. | 1052 | // The elements have to be ordered hierarchically, eg. it's important to compute earth before moon. |
2894 | 1053 | void SolarSystem::computeTransMatrices(double date, const Vec3d& observerPos) | 1053 | void SolarSystem::computeTransMatrices(double dateJDE, const Vec3d& observerPos) |
2895 | 1054 | { | 1054 | { |
2896 | 1055 | double dateJD=dateJDE - (StelApp::getInstance().getCore()->computeDeltaT(dateJDE))/86400.0; | ||
2897 | 1056 | |||
2898 | 1055 | if (flagLightTravelTime) | 1057 | if (flagLightTravelTime) |
2899 | 1056 | { | 1058 | { |
2900 | 1057 | foreach (PlanetP p, systemPlanets) | 1059 | foreach (PlanetP p, systemPlanets) |
2901 | 1058 | { | 1060 | { |
2902 | 1059 | const double light_speed_correction = (p->getHeliocentricEclipticPos()-observerPos).length() * (AU / (SPEED_OF_LIGHT * 86400)); | 1061 | const double light_speed_correction = (p->getHeliocentricEclipticPos()-observerPos).length() * (AU / (SPEED_OF_LIGHT * 86400)); |
2904 | 1060 | p->computeTransMatrix(date-light_speed_correction); | 1062 | p->computeTransMatrix(dateJD-light_speed_correction, dateJDE-light_speed_correction); |
2905 | 1061 | } | 1063 | } |
2906 | 1062 | } | 1064 | } |
2907 | 1063 | else | 1065 | else |
2908 | 1064 | { | 1066 | { |
2909 | 1065 | foreach (PlanetP p, systemPlanets) | 1067 | foreach (PlanetP p, systemPlanets) |
2910 | 1066 | { | 1068 | { |
2912 | 1067 | p->computeTransMatrix(date); | 1069 | p->computeTransMatrix(dateJD, dateJDE); |
2913 | 1068 | } | 1070 | } |
2914 | 1069 | } | 1071 | } |
2915 | 1070 | } | 1072 | } |
2916 | 1071 | 1073 | ||
2917 | === modified file 'src/core/modules/SolarSystem.hpp' | |||
2918 | --- src/core/modules/SolarSystem.hpp 2015-07-05 19:48:33 +0000 | |||
2919 | +++ src/core/modules/SolarSystem.hpp 2015-08-03 13:17:13 +0000 | |||
2920 | @@ -342,9 +342,9 @@ | |||
2921 | 342 | 342 | ||
2922 | 343 | //! Compute the position and transform matrix for every element of the solar system. | 343 | //! Compute the position and transform matrix for every element of the solar system. |
2923 | 344 | //! @param observerPos Position of the observer in heliocentric ecliptic frame (Required for light travel time computation). | 344 | //! @param observerPos Position of the observer in heliocentric ecliptic frame (Required for light travel time computation). |
2925 | 345 | //! @param date the date in JDay | 345 | //! @param dateJDE the Julian Day in JDE (Ephemeris Time or equivalent) |
2926 | 346 | //! \deprecated ??? In the "deprecated" section, but used in SolarSystem::init() | 346 | //! \deprecated ??? In the "deprecated" section, but used in SolarSystem::init() |
2928 | 347 | void computePositions(double date, const Vec3d& observerPos = Vec3d(0.)); | 347 | void computePositions(double dateJDE, const Vec3d& observerPos = Vec3d(0.)); |
2929 | 348 | 348 | ||
2930 | 349 | //! Get the list of all the bodies of the solar system. | 349 | //! Get the list of all the bodies of the solar system. |
2931 | 350 | //! \deprecated Used in LandscapeMgr::update(), but commented out. | 350 | //! \deprecated Used in LandscapeMgr::update(), but commented out. |
2932 | @@ -372,7 +372,7 @@ | |||
2933 | 372 | 372 | ||
2934 | 373 | //! Compute the transformation matrix for every elements of the solar system. | 373 | //! Compute the transformation matrix for every elements of the solar system. |
2935 | 374 | //! observerPos is needed for light travel time computation. | 374 | //! observerPos is needed for light travel time computation. |
2937 | 375 | void computeTransMatrices(double date, const Vec3d& observerPos = Vec3d(0.)); | 375 | void computeTransMatrices(double dateJDE, const Vec3d& observerPos = Vec3d(0.)); |
2938 | 376 | 376 | ||
2939 | 377 | //! Draw a nice animated pointer around the object. | 377 | //! Draw a nice animated pointer around the object. |
2940 | 378 | void drawPointer(const StelCore* core); | 378 | void drawPointer(const StelCore* core); |
2941 | 379 | 379 | ||
2942 | === modified file 'src/core/modules/StarWrapper.cpp' | |||
2943 | --- src/core/modules/StarWrapper.cpp 2015-06-12 18:45:39 +0000 | |||
2944 | +++ src/core/modules/StarWrapper.cpp 2015-08-03 13:17:13 +0000 | |||
2945 | @@ -247,7 +247,7 @@ | |||
2946 | 247 | { | 247 | { |
2947 | 248 | // Calculate next minimum or maximum light | 248 | // Calculate next minimum or maximum light |
2948 | 249 | double vsEpoch = 2400000+vEpoch; | 249 | double vsEpoch = 2400000+vEpoch; |
2950 | 250 | double npDate = vsEpoch + vPeriod * ::floor(1.0 + (core->getJDay() - vsEpoch)/vPeriod); | 250 | double npDate = vsEpoch + vPeriod * ::floor(1.0 + (core->getJDE() - vsEpoch)/vPeriod); |
2951 | 251 | QString nextDate = StelUtils::julianDayToISO8601String(npDate).replace("T", " "); | 251 | QString nextDate = StelUtils::julianDayToISO8601String(npDate).replace("T", " "); |
2952 | 252 | if (ebsFlag) | 252 | if (ebsFlag) |
2953 | 253 | oss << q_("Next minimum light: %1 UTC").arg(nextDate) << "<br />"; | 253 | oss << q_("Next minimum light: %1 UTC").arg(nextDate) << "<br />"; |
2954 | 254 | 254 | ||
2955 | === modified file 'src/core/modules/StarWrapper.hpp' | |||
2956 | --- src/core/modules/StarWrapper.hpp 2015-01-02 16:18:33 +0000 | |||
2957 | +++ src/core/modules/StarWrapper.hpp 2015-08-03 13:17:13 +0000 | |||
2958 | @@ -77,7 +77,7 @@ | |||
2959 | 77 | { | 77 | { |
2960 | 78 | static const double d2000 = 2451545.0; | 78 | static const double d2000 = 2451545.0; |
2961 | 79 | Vec3f v; | 79 | Vec3f v; |
2963 | 80 | s->getJ2000Pos(z, (M_PI/180.)*(0.0001/3600.) * ((core->getJDay()-d2000)/365.25) / a->star_position_scale, v); | 80 | s->getJ2000Pos(z, (M_PI/180.)*(0.0001/3600.) * ((core->getJDE()-d2000)/365.25) / a->star_position_scale, v); |
2964 | 81 | return Vec3d(v[0], v[1], v[2]); | 81 | return Vec3d(v[0], v[1], v[2]); |
2965 | 82 | } | 82 | } |
2966 | 83 | Vec3f getInfoColor(void) const | 83 | Vec3f getInfoColor(void) const |
2967 | 84 | 84 | ||
2968 | === modified file 'src/core/modules/ZodiacalLight.cpp' | |||
2969 | --- src/core/modules/ZodiacalLight.cpp 2015-06-30 18:34:14 +0000 | |||
2970 | +++ src/core/modules/ZodiacalLight.cpp 2015-08-03 13:17:13 +0000 | |||
2971 | @@ -93,7 +93,7 @@ | |||
2972 | 93 | // Test if we are not on Earth. Texture would not fit, so don't draw then. | 93 | // Test if we are not on Earth. Texture would not fit, so don't draw then. |
2973 | 94 | if (core->getCurrentLocation().planetName != "Earth") return; | 94 | if (core->getCurrentLocation().planetName != "Earth") return; |
2974 | 95 | 95 | ||
2976 | 96 | double currentJD=core->getJDay(); | 96 | double currentJD=core->getJD(); |
2977 | 97 | if (qAbs(currentJD - lastJD) > 0.25f) // should be enough to update position every 6 hours. | 97 | if (qAbs(currentJD - lastJD) > 0.25f) // should be enough to update position every 6 hours. |
2978 | 98 | { | 98 | { |
2979 | 99 | // update vertices | 99 | // update vertices |
2980 | 100 | 100 | ||
2981 | === modified file 'src/core/modules/ZoneArray.cpp' | |||
2982 | --- src/core/modules/ZoneArray.cpp 2015-02-08 15:35:27 +0000 | |||
2983 | +++ src/core/modules/ZoneArray.cpp 2015-08-03 13:17:13 +0000 | |||
2984 | @@ -467,7 +467,7 @@ | |||
2985 | 467 | StelSkyDrawer* drawer = core->getSkyDrawer(); | 467 | StelSkyDrawer* drawer = core->getSkyDrawer(); |
2986 | 468 | Vec3f vf; | 468 | Vec3f vf; |
2987 | 469 | static const double d2000 = 2451545.0; | 469 | static const double d2000 = 2451545.0; |
2989 | 470 | const float movementFactor = (M_PI/180)*(0.0001/3600) * ((core->getJDay()-d2000)/365.25) / star_position_scale; | 470 | const float movementFactor = (M_PI/180)*(0.0001/3600) * ((core->getJDE()-d2000)/365.25) / star_position_scale; |
2990 | 471 | 471 | ||
2991 | 472 | // GZ, added for extinction | 472 | // GZ, added for extinction |
2992 | 473 | const Extinction& extinction=core->getSkyDrawer()->getExtinction(); | 473 | const Extinction& extinction=core->getSkyDrawer()->getExtinction(); |
2993 | @@ -549,7 +549,7 @@ | |||
2994 | 549 | QList<StelObjectP > &result) | 549 | QList<StelObjectP > &result) |
2995 | 550 | { | 550 | { |
2996 | 551 | static const double d2000 = 2451545.0; | 551 | static const double d2000 = 2451545.0; |
2998 | 552 | const double movementFactor = (M_PI/180.)*(0.0001/3600.) * ((core->getJDay()-d2000)/365.25)/ star_position_scale; | 552 | const double movementFactor = (M_PI/180.)*(0.0001/3600.) * ((core->getJDE()-d2000)/365.25)/ star_position_scale; |
2999 | 553 | const SpecialZoneData<Star> *const z = getZones()+index; | 553 | const SpecialZoneData<Star> *const z = getZones()+index; |
3000 | 554 | Vec3f tmp; | 554 | Vec3f tmp; |
3001 | 555 | Vec3f vf(v[0], v[1], v[2]); | 555 | Vec3f vf(v[0], v[1], v[2]); |
3002 | 556 | 556 | ||
3003 | === modified file 'src/core/planetsephems/sidereal_time.c' | |||
3004 | --- src/core/planetsephems/sidereal_time.c 2015-07-27 11:16:32 +0000 | |||
3005 | +++ src/core/planetsephems/sidereal_time.c 2015-08-03 13:17:13 +0000 | |||
3006 | @@ -209,18 +209,18 @@ | |||
3007 | 209 | {-3.0, 0.0, 0.0, 0.0}}; | 209 | {-3.0, 0.0, 0.0, 0.0}}; |
3008 | 210 | 210 | ||
3009 | 211 | /* cache values */ | 211 | /* cache values */ |
3011 | 212 | static double c_JD = 0.0, c_longitude = 0.0, c_obliquity = 0.0, c_ecliptic = 0.0; | 212 | static double c_JDE = 0.0, c_longitude = 0.0, c_obliquity = 0.0, c_ecliptic = 0.0; |
3012 | 213 | 213 | ||
3013 | 214 | 214 | ||
3014 | 215 | /* Calculate nutation of longitude and obliquity in degrees from Julian Ephemeris Day | 215 | /* Calculate nutation of longitude and obliquity in degrees from Julian Ephemeris Day |
3016 | 216 | * params : JD Julian Day, nutation Pointer to store nutation. | 216 | * params : JDE Julian Day (ET/TT), nutation Pointer to store nutation. |
3017 | 217 | * Meeus, Astr. Alg. (1st ed., 1994), Chapter 21 pg 131-134 Using Table 21A */ | 217 | * Meeus, Astr. Alg. (1st ed., 1994), Chapter 21 pg 131-134 Using Table 21A */ |
3018 | 218 | /* GZ: Changed: ecliptic obliquity used to be constant J2000.0. | 218 | /* GZ: Changed: ecliptic obliquity used to be constant J2000.0. |
3019 | 219 | * If you don't compute this, you may as well forget about nutation! | 219 | * If you don't compute this, you may as well forget about nutation! |
3020 | 220 | * 2015: Laskar's 1986 formula replaced by Vondrak 2011. c_ecliptic is now epsilon_A, Vondrak's obliquity of date. | 220 | * 2015: Laskar's 1986 formula replaced by Vondrak 2011. c_ecliptic is now epsilon_A, Vondrak's obliquity of date. |
3021 | 221 | * TODO: replace this whole function with Nutation IAU2000A or compatible version. | 221 | * TODO: replace this whole function with Nutation IAU2000A or compatible version. |
3022 | 222 | */ | 222 | */ |
3024 | 223 | void get_nutation (double JD, struct ln_nutation * nutation) | 223 | void get_nutation (double JDE, struct ln_nutation * nutation) |
3025 | 224 | { | 224 | { |
3026 | 225 | 225 | ||
3027 | 226 | double D,M,MM,F,O,T; | 226 | double D,M,MM,F,O,T; |
3028 | @@ -228,16 +228,16 @@ | |||
3029 | 228 | int i; | 228 | int i; |
3030 | 229 | 229 | ||
3031 | 230 | /* should we bother recalculating nutation */ | 230 | /* should we bother recalculating nutation */ |
3033 | 231 | if (fabs(JD - c_JD) > LN_NUTATION_EPOCH_THRESHOLD) | 231 | if (fabs(JDE - c_JDE) > LN_NUTATION_EPOCH_THRESHOLD) |
3034 | 232 | { | 232 | { |
3035 | 233 | /* set the new epoch */ | 233 | /* set the new epoch */ |
3037 | 234 | c_JD = JD; | 234 | c_JDE = JDE; |
3038 | 235 | 235 | ||
3039 | 236 | /* set ecliptic. GZ: This is constant only, J2000.0. WRONG! */ | 236 | /* set ecliptic. GZ: This is constant only, J2000.0. WRONG! */ |
3040 | 237 | /* c_ecliptic = 23.0 + 26.0 / 60.0 + 27.407 / 3600.0; */ | 237 | /* c_ecliptic = 23.0 + 26.0 / 60.0 + 27.407 / 3600.0; */ |
3041 | 238 | 238 | ||
3042 | 239 | /* calc T */ | 239 | /* calc T */ |
3044 | 240 | T = (JD - 2451545.0)/36525; | 240 | T = (JDE - 2451545.0)/36525; |
3045 | 241 | /* GZotti: we don't need those. * / | 241 | /* GZotti: we don't need those. * / |
3046 | 242 | T2 = T * T; | 242 | T2 = T * T; |
3047 | 243 | T3 = T2 * T; | 243 | T3 = T2 * T; |
3048 | @@ -361,7 +361,7 @@ | |||
3049 | 361 | /* Calculate the apparent sidereal time at the meridian of Greenwich of a given date. | 361 | /* Calculate the apparent sidereal time at the meridian of Greenwich of a given date. |
3050 | 362 | * returns apparent sidereal time (degrees). | 362 | * returns apparent sidereal time (degrees). |
3051 | 363 | * Formula 11.1, 11.4 pg 83 */ | 363 | * Formula 11.1, 11.4 pg 83 */ |
3053 | 364 | double get_apparent_sidereal_time (double JD) | 364 | double get_apparent_sidereal_time (double JD, double JDE) |
3054 | 365 | { | 365 | { |
3055 | 366 | double correction, sidereal; | 366 | double correction, sidereal; |
3056 | 367 | struct ln_nutation nutation; | 367 | struct ln_nutation nutation; |
3057 | @@ -371,9 +371,9 @@ | |||
3058 | 371 | /* get the mean sidereal time */ | 371 | /* get the mean sidereal time */ |
3059 | 372 | sidereal = get_mean_sidereal_time (JD); | 372 | sidereal = get_mean_sidereal_time (JD); |
3060 | 373 | 373 | ||
3064 | 374 | /* add corrections for nutation in longitude and for the true obliquity of | 374 | /* add corrections for nutation in longitude and for the true obliquity of the ecliptic |
3065 | 375 | the ecliptic */ | 375 | */ |
3066 | 376 | get_nutation (JD, &nutation); | 376 | get_nutation (JDE, &nutation); |
3067 | 377 | 377 | ||
3068 | 378 | /* GZ: This was the only place where this was used. I added the summation here. */ | 378 | /* GZ: This was the only place where this was used. I added the summation here. */ |
3069 | 379 | correction = (nutation.deltaPsi * cos ((nutation.ecliptic+nutation.deltaEps)*M_PI/180.)); | 379 | correction = (nutation.deltaPsi * cos ((nutation.ecliptic+nutation.deltaEps)*M_PI/180.)); |
3070 | 380 | 380 | ||
3071 | === modified file 'src/core/planetsephems/sidereal_time.h' | |||
3072 | --- src/core/planetsephems/sidereal_time.h 2014-02-05 17:01:25 +0000 | |||
3073 | +++ src/core/planetsephems/sidereal_time.h 2015-08-03 13:17:13 +0000 | |||
3074 | @@ -28,8 +28,8 @@ | |||
3075 | 28 | /* Calculate mean sidereal time from date. */ | 28 | /* Calculate mean sidereal time from date. */ |
3076 | 29 | double get_mean_sidereal_time (double JD); | 29 | double get_mean_sidereal_time (double JD); |
3077 | 30 | 30 | ||
3080 | 31 | /* Calculate apparent sidereal time from date.*/ | 31 | /* Calculate apparent sidereal time from date. We need JD(UT) and JDE(TT) here to accurately compute nutation. */ |
3081 | 32 | double get_apparent_sidereal_time (double JD); | 32 | double get_apparent_sidereal_time (double JD, double JDE); |
3082 | 33 | /* Calculate mean ecliptical obliquity in degrees. */ | 33 | /* Calculate mean ecliptical obliquity in degrees. */ |
3083 | 34 | double get_mean_ecliptical_obliquity(double JDE); | 34 | double get_mean_ecliptical_obliquity(double JDE); |
3084 | 35 | /* Calculate nutation in longitude in degrees. */ | 35 | /* Calculate nutation in longitude in degrees. */ |
3085 | 36 | 36 | ||
3086 | === modified file 'src/gui/ConfigurationDialog.cpp' | |||
3087 | --- src/gui/ConfigurationDialog.cpp 2015-07-27 14:57:16 +0000 | |||
3088 | +++ src/gui/ConfigurationDialog.cpp 2015-08-03 13:17:13 +0000 | |||
3089 | @@ -931,8 +931,8 @@ | |||
3090 | 931 | void ConfigurationDialog::setFixedDateTimeToCurrent(void) | 931 | void ConfigurationDialog::setFixedDateTimeToCurrent(void) |
3091 | 932 | { | 932 | { |
3092 | 933 | StelCore* core = StelApp::getInstance().getCore(); | 933 | StelCore* core = StelApp::getInstance().getCore(); |
3095 | 934 | double JD = core->getJDay(); | 934 | double JD = core->getJD(); |
3096 | 935 | ui->fixedDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(JD+StelUtils::getGMTShiftFromQT(JD)/24-core->getDeltaT(JD)/86400)); | 935 | ui->fixedDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(JD+StelUtils::getGMTShiftFromQT(JD)/24)); |
3097 | 936 | ui->fixedTimeRadio->setChecked(true); | 936 | ui->fixedTimeRadio->setChecked(true); |
3098 | 937 | setStartupTimeMode(); | 937 | setStartupTimeMode(); |
3099 | 938 | } | 938 | } |
3100 | @@ -1252,6 +1252,8 @@ | |||
3101 | 1252 | algorithms->addItem(q_("Morrison & Stephenson (2004, 2005)"), "MorrisonStephenson2004"); | 1252 | algorithms->addItem(q_("Morrison & Stephenson (2004, 2005)"), "MorrisonStephenson2004"); |
3102 | 1253 | // Espenak & Meeus (2006) used by default | 1253 | // Espenak & Meeus (2006) used by default |
3103 | 1254 | algorithms->addItem(q_("Espenak & Meeus (2006)").append(" *"), "EspenakMeeus"); | 1254 | algorithms->addItem(q_("Espenak & Meeus (2006)").append(" *"), "EspenakMeeus"); |
3104 | 1255 | // GZ: I want to try out some things. Something is still wrong with eclipses, see lp:1275092. | ||
3105 | 1256 | //algorithms->addItem(q_("Espenak & Meeus (2006) no extra moon acceleration"), "EspenakMeeusZeroMoonAccel"); | ||
3106 | 1255 | algorithms->addItem(q_("Reijs (2006)"), "Reijs"); | 1257 | algorithms->addItem(q_("Reijs (2006)"), "Reijs"); |
3107 | 1256 | algorithms->addItem(q_("Banjevic (2006)"), "Banjevic"); | 1258 | algorithms->addItem(q_("Banjevic (2006)"), "Banjevic"); |
3108 | 1257 | algorithms->addItem(q_("Islam, Sadiq & Qureshi (2008, 2013)"), "IslamSadiqQureshi"); | 1259 | algorithms->addItem(q_("Islam, Sadiq & Qureshi (2008, 2013)"), "IslamSadiqQureshi"); |
3109 | 1258 | 1260 | ||
3110 | === modified file 'src/gui/DateTimeDialog.cpp' | |||
3111 | --- src/gui/DateTimeDialog.cpp 2015-02-05 15:36:01 +0000 | |||
3112 | +++ src/gui/DateTimeDialog.cpp 2015-08-03 13:17:13 +0000 | |||
3113 | @@ -54,13 +54,9 @@ | |||
3114 | 54 | void DateTimeDialog::createDialogContent() | 54 | void DateTimeDialog::createDialogContent() |
3115 | 55 | { | 55 | { |
3116 | 56 | ui->setupUi(dialog); | 56 | ui->setupUi(dialog); |
3118 | 57 | double cjd = StelApp::getInstance().getCore()->getJDay(); | 57 | double jd = StelApp::getInstance().getCore()->getJD(); |
3119 | 58 | // UTC -> local tz | 58 | // UTC -> local tz |
3125 | 59 | // Add in a DeltaT correction. Divide DeltaT by 86400 to convert from seconds to days. | 59 | setDateTime(jd + (StelApp::getInstance().getLocaleMgr().getGMTShift(jd)/24.0)); |
3121 | 60 | double deltaT = 0.; | ||
3122 | 61 | if (StelApp::getInstance().getCore()->getCurrentLocation().planetName=="Earth") | ||
3123 | 62 | deltaT = StelApp::getInstance().getCore()->getDeltaT(cjd)/86400.; | ||
3124 | 63 | setDateTime(cjd + (StelApp::getInstance().getLocaleMgr().getGMTShift(cjd)/24.0)-deltaT); | ||
3126 | 64 | 60 | ||
3127 | 65 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); | 61 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
3128 | 66 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); | 62 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
3129 | @@ -115,15 +111,15 @@ | |||
3130 | 115 | minute = dmin; | 111 | minute = dmin; |
3131 | 116 | second = ds; | 112 | second = ds; |
3132 | 117 | pushToWidgets(); | 113 | pushToWidgets(); |
3134 | 118 | StelApp::getInstance().getCore()->setJDay(newJd()); | 114 | StelApp::getInstance().getCore()->setJD(newJd()); |
3135 | 119 | return true; | 115 | return true; |
3136 | 120 | } | 116 | } |
3137 | 121 | 117 | ||
3138 | 122 | bool DateTimeDialog::validJd(double jday) | 118 | bool DateTimeDialog::validJd(double jday) |
3139 | 123 | { | 119 | { |
3140 | 124 | pushToWidgets(); | 120 | pushToWidgets(); |
3143 | 125 | StelCore *core = StelApp::getInstance().getCore(); | 121 | StelApp::getInstance().getCore()->setJD(jday); |
3144 | 126 | core->setJDay(jday+core->getDeltaT(jday)/86400.); | 122 | |
3145 | 127 | return true; | 123 | return true; |
3146 | 128 | } | 124 | } |
3147 | 129 | 125 | ||
3148 | @@ -211,11 +207,8 @@ | |||
3149 | 211 | { | 207 | { |
3150 | 212 | double cjd; | 208 | double cjd; |
3151 | 213 | StelUtils::getJDFromDate(&cjd, year, month, day, hour, minute, second); | 209 | StelUtils::getJDFromDate(&cjd, year, month, day, hour, minute, second); |
3157 | 214 | // Add in a DeltaT correction. Divide DeltaT by 86400 to convert from seconds to days. | 210 | cjd -= (StelApp::getInstance().getLocaleMgr().getGMTShift(cjd)/24.0); // local tz -> UTC |
3158 | 215 | double deltaT = 0.; | 211 | |
3154 | 216 | if (StelApp::getInstance().getCore()->getCurrentLocation().planetName=="Earth") | ||
3155 | 217 | deltaT = StelApp::getInstance().getCore()->getDeltaT(cjd)/86400.; | ||
3156 | 218 | cjd -= (StelApp::getInstance().getLocaleMgr().getGMTShift(cjd)/24.0-deltaT); // local tz -> UTC | ||
3159 | 219 | return cjd; | 212 | return cjd; |
3160 | 220 | } | 213 | } |
3161 | 221 | 214 | ||
3162 | @@ -236,25 +229,25 @@ | |||
3163 | 236 | } | 229 | } |
3164 | 237 | ui->spinner_jd->setValue(jd); | 230 | ui->spinner_jd->setValue(jd); |
3165 | 238 | ui->spinner_mjd->setValue(mjd); | 231 | ui->spinner_mjd->setValue(mjd); |
3166 | 232 | if (jd<2299161) // 1582-10-15 | ||
3167 | 233 | ui->dateTimeTab->setToolTip(q_("Date and Time in Julian calendar")); | ||
3168 | 234 | else | ||
3169 | 235 | ui->dateTimeTab->setToolTip(q_("Date and Time in Gregorian calendar")); | ||
3170 | 239 | connectSpinnerEvents(); | 236 | connectSpinnerEvents(); |
3171 | 240 | } | 237 | } |
3172 | 241 | 238 | ||
3173 | 242 | /************************************************************************ | 239 | /************************************************************************ |
3175 | 243 | Send newJd to spinner_* | 240 | Prepare date elements from newJd and send to spinner_* |
3176 | 244 | ************************************************************************/ | 241 | ************************************************************************/ |
3177 | 245 | void DateTimeDialog::setDateTime(double newJd) | 242 | void DateTimeDialog::setDateTime(double newJd) |
3178 | 246 | { | 243 | { |
3179 | 247 | if (this->visible()) { | 244 | if (this->visible()) { |
3186 | 248 | // Add in a DeltaT correction. Divide DeltaT by 86400 to convert from seconds to days. | 245 | newJd += (StelApp::getInstance().getLocaleMgr().getGMTShift(newJd)/24.0); // UTC -> local tz |
3181 | 249 | double deltaT = 0.; | ||
3182 | 250 | if (StelApp::getInstance().getCore()->getCurrentLocation().planetName=="Earth") | ||
3183 | 251 | deltaT = StelApp::getInstance().getCore()->getDeltaT(newJd)/86400.; | ||
3184 | 252 | double newJdC = newJd - deltaT; | ||
3185 | 253 | newJd += (StelApp::getInstance().getLocaleMgr().getGMTShift(newJd)/24.0-deltaT); // UTC -> local tz | ||
3187 | 254 | StelUtils::getDateFromJulianDay(newJd, &year, &month, &day); | 246 | StelUtils::getDateFromJulianDay(newJd, &year, &month, &day); |
3188 | 255 | StelUtils::getTimeFromJulianDay(newJd, &hour, &minute, &second); | 247 | StelUtils::getTimeFromJulianDay(newJd, &hour, &minute, &second); |
3191 | 256 | jd = newJdC; | 248 | jd = newJd; |
3192 | 257 | mjd = newJdC-2400000.5; | 249 | mjd = newJd-2400000.5; |
3193 | 250 | |||
3194 | 258 | pushToWidgets(); | 251 | pushToWidgets(); |
3195 | 259 | } | 252 | } |
3196 | 260 | } | 253 | } |
3197 | 261 | 254 | ||
3198 | === modified file 'src/gui/SearchDialog.cpp' | |||
3199 | --- src/gui/SearchDialog.cpp 2015-05-09 10:26:41 +0000 | |||
3200 | +++ src/gui/SearchDialog.cpp 2015-08-03 13:17:13 +0000 | |||
3201 | @@ -478,7 +478,7 @@ | |||
3202 | 478 | case ecliptic: | 478 | case ecliptic: |
3203 | 479 | { | 479 | { |
3204 | 480 | double ra, dec; | 480 | double ra, dec; |
3206 | 481 | StelUtils::eclToEqu(ui->AxisXSpinBox->valueRadians(), ui->AxisYSpinBox->valueRadians(), core->getCurrentPlanet()->getRotObliquity(core->getJDay()), &ra, &dec); | 481 | StelUtils::eclToEqu(ui->AxisXSpinBox->valueRadians(), ui->AxisYSpinBox->valueRadians(), core->getCurrentPlanet()->getRotObliquity(core->getJDE()), &ra, &dec); |
3207 | 482 | StelUtils::spheToRect(ra, dec, pos); | 482 | StelUtils::spheToRect(ra, dec, pos); |
3208 | 483 | pos = core->equinoxEquToJ2000(pos); | 483 | pos = core->equinoxEquToJ2000(pos); |
3209 | 484 | break; | 484 | break; |
3210 | 485 | 485 | ||
3211 | === modified file 'src/gui/StelGui.cpp' | |||
3212 | --- src/gui/StelGui.cpp 2015-03-09 12:26:02 +0000 | |||
3213 | +++ src/gui/StelGui.cpp 2015-08-03 13:17:13 +0000 | |||
3214 | @@ -523,7 +523,7 @@ | |||
3215 | 523 | forceRefreshGui(); | 523 | forceRefreshGui(); |
3216 | 524 | } | 524 | } |
3217 | 525 | 525 | ||
3219 | 526 | dateTimeDialog->setDateTime(core->getJDay()); | 526 | dateTimeDialog->setDateTime(core->getJD()); |
3220 | 527 | } | 527 | } |
3221 | 528 | 528 | ||
3222 | 529 | #ifndef DISABLE_SCRIPTING | 529 | #ifndef DISABLE_SCRIPTING |
3223 | 530 | 530 | ||
3224 | === modified file 'src/gui/StelGuiItems.cpp' | |||
3225 | --- src/gui/StelGuiItems.cpp 2015-08-02 17:12:29 +0000 | |||
3226 | +++ src/gui/StelGuiItems.cpp 2015-08-03 13:17:13 +0000 | |||
3227 | @@ -537,56 +537,49 @@ | |||
3228 | 537 | updateText(true); | 537 | updateText(true); |
3229 | 538 | } | 538 | } |
3230 | 539 | 539 | ||
3231 | 540 | // create text elements and tooltips in bottom toolbar. | ||
3232 | 540 | // Make sure to avoid any change if not necessary to avoid triggering useless redraw | 541 | // Make sure to avoid any change if not necessary to avoid triggering useless redraw |
3233 | 541 | void BottomStelBar::updateText(bool updatePos) | 542 | void BottomStelBar::updateText(bool updatePos) |
3234 | 542 | { | 543 | { |
3235 | 543 | StelCore* core = StelApp::getInstance().getCore(); | 544 | StelCore* core = StelApp::getInstance().getCore(); |
3249 | 544 | double jd = core->getJDay(); | 545 | double jd = core->getJD(); |
3250 | 545 | double deltaT = 0.; | 546 | double deltaT = core->getDeltaT(); |
3251 | 546 | double sigma = -1.; | 547 | double sigma = StelUtils::getDeltaTStandardError(jd); |
3252 | 547 | QString sigmaInfo = ""; | 548 | QString sigmaInfo = ""; |
3253 | 548 | QString validRangeInfo = ""; | 549 | QString validRangeMarker = ""; |
3254 | 549 | bool displayDeltaT = false; | 550 | core->getCurrentDeltaTAlgorithmValidRangeDescription(jd, &validRangeMarker); |
3242 | 550 | if (core->getCurrentLocation().planetName.contains("Earth")) | ||
3243 | 551 | { | ||
3244 | 552 | deltaT = core->getDeltaT(jd); | ||
3245 | 553 | displayDeltaT = true; | ||
3246 | 554 | sigma = StelUtils::getDeltaTStandardError(jd); | ||
3247 | 555 | core->getCurrentDeltaTAlgorithmValidRange(jd, &validRangeInfo); | ||
3248 | 556 | } | ||
3255 | 557 | 551 | ||
3256 | 558 | const StelLocaleMgr& locmgr = StelApp::getInstance().getLocaleMgr(); | 552 | const StelLocaleMgr& locmgr = StelApp::getInstance().getLocaleMgr(); |
3259 | 559 | double dt = deltaT/86400.; // A DeltaT correction. Divide DeltaT by 86400 to convert from seconds to days. | 553 | QString tz = locmgr.getPrintableTimeZoneLocal(jd); |
3258 | 560 | QString tz = locmgr.getPrintableTimeZoneLocal(jd-dt); | ||
3260 | 561 | QString newDateInfo = " "; | 554 | QString newDateInfo = " "; |
3261 | 562 | if (getFlagShowTime()) | 555 | if (getFlagShowTime()) |
3262 | 563 | { | 556 | { |
3263 | 564 | if (getFlagShowTz()) | 557 | if (getFlagShowTz()) |
3265 | 565 | newDateInfo = QString("%1 %2 %3").arg(locmgr.getPrintableDateLocal(jd-dt)).arg(locmgr.getPrintableTimeLocal(jd-dt)).arg(tz); | 558 | newDateInfo = QString("%1 %2 %3").arg(locmgr.getPrintableDateLocal(jd)).arg(locmgr.getPrintableTimeLocal(jd)).arg(tz); |
3266 | 566 | else | 559 | else |
3268 | 567 | newDateInfo = QString("%1 %2").arg(locmgr.getPrintableDateLocal(jd-dt)).arg(locmgr.getPrintableTimeLocal(jd-dt)); | 560 | newDateInfo = QString("%1 %2").arg(locmgr.getPrintableDateLocal(jd)).arg(locmgr.getPrintableTimeLocal(jd)); |
3269 | 568 | } | 561 | } |
3271 | 569 | QString newDateAppx = QString("JD %1").arg(jd-dt, 0, 'f', 5); | 562 | QString newDateAppx = QString("JD %1").arg(jd, 0, 'f', 5); |
3272 | 570 | if (getFlagTimeJd()) | 563 | if (getFlagTimeJd()) |
3273 | 571 | { | 564 | { |
3274 | 572 | newDateAppx = newDateInfo; | 565 | newDateAppx = newDateInfo; |
3276 | 573 | newDateInfo = QString("JD %1").arg(jd-dt, 0, 'f', 5); | 566 | newDateInfo = QString("JD %1").arg(jd, 0, 'f', 5); |
3277 | 574 | } | 567 | } |
3278 | 575 | 568 | ||
3279 | 576 | if (datetime->text()!=newDateInfo) | 569 | if (datetime->text()!=newDateInfo) |
3280 | 577 | { | 570 | { |
3281 | 578 | updatePos = true; | 571 | updatePos = true; |
3282 | 579 | datetime->setText(newDateInfo); | 572 | datetime->setText(newDateInfo); |
3284 | 580 | if (displayDeltaT && core->getCurrentDeltaTAlgorithm()!=StelCore::WithoutCorrection) | 573 | if (core->getCurrentDeltaTAlgorithm()!=StelCore::WithoutCorrection) |
3285 | 581 | { | 574 | { |
3286 | 582 | if (sigma>0) | 575 | if (sigma>0) |
3287 | 583 | sigmaInfo = QString("; %1(%2T) = %3s").arg(QChar(0x03c3)).arg(QChar(0x0394)).arg(sigma, 3, 'f', 1); | 576 | sigmaInfo = QString("; %1(%2T) = %3s").arg(QChar(0x03c3)).arg(QChar(0x0394)).arg(sigma, 3, 'f', 1); |
3288 | 584 | 577 | ||
3289 | 585 | QString deltaTInfo = ""; | 578 | QString deltaTInfo = ""; |
3290 | 586 | if (qAbs(deltaT)>60.) | 579 | if (qAbs(deltaT)>60.) |
3292 | 587 | deltaTInfo = QString("%1 (%2s)%3").arg(StelUtils::hoursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2).arg(validRangeInfo); | 580 | deltaTInfo = QString("%1 (%2s)%3").arg(StelUtils::hoursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2).arg(validRangeMarker); |
3293 | 588 | else | 581 | else |
3295 | 589 | deltaTInfo = QString("%1s%2").arg(deltaT, 3, 'f', 3).arg(validRangeInfo); | 582 | deltaTInfo = QString("%1s%2").arg(deltaT, 3, 'f', 3).arg(validRangeMarker); |
3296 | 590 | 583 | ||
3297 | 591 | datetime->setToolTip(QString("<p style='white-space:pre'>%1T = %2 [n-dot @ -23.8946\"/cy%3%4]<br>%5</p>").arg(QChar(0x0394)).arg(deltaTInfo).arg(QChar(0x00B2)).arg(sigmaInfo).arg(newDateAppx)); | 584 | datetime->setToolTip(QString("<p style='white-space:pre'>%1T = %2 [n-dot @ -23.8946\"/cy%3%4]<br>%5</p>").arg(QChar(0x0394)).arg(deltaTInfo).arg(QChar(0x00B2)).arg(sigmaInfo).arg(newDateAppx)); |
3298 | 592 | } | 585 | } |
3299 | @@ -594,6 +587,7 @@ | |||
3300 | 594 | datetime->setToolTip(QString("%1").arg(newDateAppx)); | 587 | datetime->setToolTip(QString("%1").arg(newDateAppx)); |
3301 | 595 | } | 588 | } |
3302 | 596 | 589 | ||
3303 | 590 | // build location tooltip | ||
3304 | 597 | QString newLocation = ""; | 591 | QString newLocation = ""; |
3305 | 598 | const StelLocation* loc = &core->getCurrentLocation(); | 592 | const StelLocation* loc = &core->getCurrentLocation(); |
3306 | 599 | const StelTranslator& trans = locmgr.getSkyTranslator(); | 593 | const StelTranslator& trans = locmgr.getSkyTranslator(); |
3307 | @@ -633,6 +627,8 @@ | |||
3308 | 633 | } | 627 | } |
3309 | 634 | 628 | ||
3310 | 635 | QString str; | 629 | QString str; |
3311 | 630 | |||
3312 | 631 | // build fov tooltip | ||
3313 | 636 | QTextStream wos(&str); | 632 | QTextStream wos(&str); |
3314 | 637 | if (getFlagFovDms()) | 633 | if (getFlagFovDms()) |
3315 | 638 | { | 634 | { |
3316 | @@ -659,6 +655,8 @@ | |||
3317 | 659 | } | 655 | } |
3318 | 660 | 656 | ||
3319 | 661 | str=""; | 657 | str=""; |
3320 | 658 | |||
3321 | 659 | // build fps tooltip | ||
3322 | 662 | QTextStream wos2(&str); | 660 | QTextStream wos2(&str); |
3323 | 663 | wos2 << qSetRealNumberPrecision(3) << StelApp::getInstance().getFps() << " FPS"; | 661 | wos2 << qSetRealNumberPrecision(3) << StelApp::getInstance().getFps() << " FPS"; |
3324 | 664 | if (fps->text()!=str) | 662 | if (fps->text()!=str) |
3325 | 665 | 663 | ||
3326 | === modified file 'src/gui/dateTimeDialogGui.ui' | |||
3327 | --- src/gui/dateTimeDialogGui.ui 2015-02-05 15:36:01 +0000 | |||
3328 | +++ src/gui/dateTimeDialogGui.ui 2015-08-03 13:17:13 +0000 | |||
3329 | @@ -557,7 +557,7 @@ | |||
3330 | 557 | </widget> | 557 | </widget> |
3331 | 558 | <widget class="QWidget" name="julianDateTab"> | 558 | <widget class="QWidget" name="julianDateTab"> |
3332 | 559 | <attribute name="title"> | 559 | <attribute name="title"> |
3334 | 560 | <string>Julian Date</string> | 560 | <string>Julian Day</string> |
3335 | 561 | </attribute> | 561 | </attribute> |
3336 | 562 | <layout class="QGridLayout" name="gridLayout_3"> | 562 | <layout class="QGridLayout" name="gridLayout_3"> |
3337 | 563 | <property name="leftMargin"> | 563 | <property name="leftMargin"> |
3338 | @@ -599,7 +599,7 @@ | |||
3339 | 599 | <item> | 599 | <item> |
3340 | 600 | <widget class="QLabel" name="label_5"> | 600 | <widget class="QLabel" name="label_5"> |
3341 | 601 | <property name="toolTip"> | 601 | <property name="toolTip"> |
3343 | 602 | <string>Julian Date</string> | 602 | <string>Julian Day</string> |
3344 | 603 | </property> | 603 | </property> |
3345 | 604 | <property name="text"> | 604 | <property name="text"> |
3346 | 605 | <string notr="true">JD:</string> | 605 | <string notr="true">JD:</string> |
3347 | @@ -664,7 +664,7 @@ | |||
3348 | 664 | <item> | 664 | <item> |
3349 | 665 | <widget class="QLabel" name="label_6"> | 665 | <widget class="QLabel" name="label_6"> |
3350 | 666 | <property name="toolTip"> | 666 | <property name="toolTip"> |
3352 | 667 | <string>Modified Julian Date</string> | 667 | <string>Modified Julian Day</string> |
3353 | 668 | </property> | 668 | </property> |
3354 | 669 | <property name="text"> | 669 | <property name="text"> |
3355 | 670 | <string notr="true">MJD:</string> | 670 | <string notr="true">MJD:</string> |
3356 | 671 | 671 | ||
3357 | === modified file 'src/scripting/StelMainScriptAPI.cpp' | |||
3358 | --- src/scripting/StelMainScriptAPI.cpp 2015-07-21 20:42:50 +0000 | |||
3359 | +++ src/scripting/StelMainScriptAPI.cpp 2015-08-03 13:17:13 +0000 | |||
3360 | @@ -104,17 +104,17 @@ | |||
3361 | 104 | } | 104 | } |
3362 | 105 | 105 | ||
3363 | 106 | //! Set the current date in Julian Day | 106 | //! Set the current date in Julian Day |
3365 | 107 | //! @param JD the Julian Date | 107 | //! @param JD the Julian Date (UT) |
3366 | 108 | void StelMainScriptAPI::setJDay(double JD) | 108 | void StelMainScriptAPI::setJDay(double JD) |
3367 | 109 | { | 109 | { |
3369 | 110 | StelApp::getInstance().getCore()->setJDay(JD); | 110 | StelApp::getInstance().getCore()->setJD(JD); |
3370 | 111 | } | 111 | } |
3371 | 112 | 112 | ||
3372 | 113 | //! Get the current date in Julian Day | 113 | //! Get the current date in Julian Day |
3374 | 114 | //! @return the Julian Date | 114 | //! @return the Julian Date (UT) |
3375 | 115 | double StelMainScriptAPI::getJDay() const | 115 | double StelMainScriptAPI::getJDay() const |
3376 | 116 | { | 116 | { |
3378 | 117 | return StelApp::getInstance().getCore()->getJDay(); | 117 | return StelApp::getInstance().getCore()->getJD(); |
3379 | 118 | } | 118 | } |
3380 | 119 | 119 | ||
3381 | 120 | //! Set the current date in Modified Julian Day | 120 | //! Set the current date in Modified Julian Day |
3382 | @@ -131,31 +131,42 @@ | |||
3383 | 131 | return StelApp::getInstance().getCore()->getMJDay(); | 131 | return StelApp::getInstance().getCore()->getMJDay(); |
3384 | 132 | } | 132 | } |
3385 | 133 | 133 | ||
3387 | 134 | void StelMainScriptAPI::setDate(const QString& dt, const QString& spec, const bool &enableDeltaT) | 134 | void StelMainScriptAPI::setDate(const QString& dateStr, const QString& spec, const bool &dateIsDT) |
3388 | 135 | { | 135 | { |
3389 | 136 | bool relativeTime = false; | ||
3390 | 137 | if (dt.startsWith("+") || dt.startsWith("-") || (dt.startsWith("now") && (dt.startsWith("+") || dt.startsWith("-")))) | ||
3391 | 138 | relativeTime = true; | ||
3392 | 139 | double JD = jdFromDateString(dt, spec); | ||
3393 | 140 | StelCore* core = StelApp::getInstance().getCore(); | 136 | StelCore* core = StelApp::getInstance().getCore(); |
3395 | 141 | if (relativeTime) | 137 | double JD = jdFromDateString(dateStr, spec); |
3396 | 138 | if (dateIsDT) | ||
3397 | 142 | { | 139 | { |
3399 | 143 | core->setJDay(JD); | 140 | qWarning() << "StelMainScriptAPI::setDate() called with final Boolean set to indicate Dynamical Time. This is new in 0.14, make sure you did this intentionally."; |
3400 | 141 | qWarning() << "This warning will go away in Stellarium 0.16, please update the script by then to be sure."; | ||
3401 | 142 | core->setJDE(JD); | ||
3402 | 144 | } | 143 | } |
3403 | 145 | else | 144 | else |
3417 | 146 | { | 145 | core->setJD(JD); |
3418 | 147 | if (enableDeltaT) | 146 | |
3419 | 148 | { | 147 | // bool relativeTime = false; |
3420 | 149 | // add Delta-T correction for date | 148 | // if (dateStr.startsWith("+") || dateStr.startsWith("-") || (dateStr.startsWith("now") && (dateStr.startsWith("+") || dateStr.startsWith("-")))) |
3421 | 150 | core->setJDay(JD + core->getDeltaT(JD)/86400); | 149 | // relativeTime = true; |
3422 | 151 | } | 150 | // double JD = jdFromDateString(dateStr, spec); |
3423 | 152 | else | 151 | // StelCore* core = StelApp::getInstance().getCore(); |
3424 | 153 | { | 152 | // if (relativeTime) |
3425 | 154 | // set date without Delta-T correction | 153 | // { |
3426 | 155 | // compatible with 0.11 | 154 | // core->setJDay(JD); |
3427 | 156 | core->setJDay(JD); | 155 | // } |
3428 | 157 | } | 156 | // else |
3429 | 158 | } | 157 | // { |
3430 | 158 | // if (dateIsDT) | ||
3431 | 159 | // { | ||
3432 | 160 | // // add Delta-T correction for date | ||
3433 | 161 | // core->setJDay(JD + core->getDeltaT(JD)/86400); | ||
3434 | 162 | // } | ||
3435 | 163 | // else | ||
3436 | 164 | // { | ||
3437 | 165 | // // set date without Delta-T correction | ||
3438 | 166 | // // compatible with 0.11 | ||
3439 | 167 | // core->setJDay(JD); | ||
3440 | 168 | // } | ||
3441 | 169 | // } | ||
3442 | 159 | } | 170 | } |
3443 | 160 | 171 | ||
3444 | 161 | QString StelMainScriptAPI::getDate(const QString& spec) | 172 | QString StelMainScriptAPI::getDate(const QString& spec) |
3445 | @@ -168,7 +179,7 @@ | |||
3446 | 168 | 179 | ||
3447 | 169 | QString StelMainScriptAPI::getDeltaT() const | 180 | QString StelMainScriptAPI::getDeltaT() const |
3448 | 170 | { | 181 | { |
3450 | 171 | return StelUtils::hoursToHmsStr(StelApp::getInstance().getCore()->getDeltaT(getJDay())/3600.); | 182 | return StelUtils::hoursToHmsStr(StelApp::getInstance().getCore()->getDeltaT()/3600.); |
3451 | 172 | } | 183 | } |
3452 | 173 | 184 | ||
3453 | 174 | QString StelMainScriptAPI::getDeltaTAlgorithm() const | 185 | QString StelMainScriptAPI::getDeltaTAlgorithm() const |
3454 | @@ -691,7 +702,7 @@ | |||
3455 | 691 | if (nowRe.capturedTexts().at(1)=="now") | 702 | if (nowRe.capturedTexts().at(1)=="now") |
3456 | 692 | jd = StelUtils::getJDFromSystem(); | 703 | jd = StelUtils::getJDFromSystem(); |
3457 | 693 | else | 704 | else |
3459 | 694 | jd = core->getJDay(); | 705 | jd = core->getJD(); |
3460 | 695 | 706 | ||
3461 | 696 | if (nowRe.capturedTexts().at(8) == "sidereal") | 707 | if (nowRe.capturedTexts().at(8) == "sidereal") |
3462 | 697 | { | 708 | { |
3463 | 698 | 709 | ||
3464 | === modified file 'src/scripting/StelMainScriptAPI.hpp' | |||
3465 | --- src/scripting/StelMainScriptAPI.hpp 2015-07-21 20:42:50 +0000 | |||
3466 | +++ src/scripting/StelMainScriptAPI.hpp 2015-08-03 13:17:13 +0000 | |||
3467 | @@ -44,22 +44,22 @@ | |||
3468 | 44 | 44 | ||
3469 | 45 | // These functions will be available in scripts | 45 | // These functions will be available in scripts |
3470 | 46 | public slots: | 46 | public slots: |
3473 | 47 | //! Set the current date in Julian Day | 47 | //! Set the current date as Julian Day number |
3474 | 48 | //! @param JD the Julian Date | 48 | //! @param JD the Julian Day number |
3475 | 49 | void setJDay(double JD); | 49 | void setJDay(double JD); |
3478 | 50 | //! Get the current date in Julian Day | 50 | //! Get the current date as Julian Day number |
3479 | 51 | //! @return the Julian Date | 51 | //! @return the Julian Day number |
3480 | 52 | double getJDay() const; | 52 | double getJDay() const; |
3481 | 53 | 53 | ||
3484 | 54 | //! Set the current date in Modified Julian Day | 54 | //! Set the current date as Modified Julian Day |
3485 | 55 | //! @param MJD the Modified Julian Date | 55 | //! @param MJD the Modified Julian Day |
3486 | 56 | void setMJDay(double MJD); | 56 | void setMJDay(double MJD); |
3489 | 57 | //! Get the current date in Modified Julian Day | 57 | //! Get the current date as Modified Julian Day |
3490 | 58 | //! @return the Modified Julian Date | 58 | //! @return the Modified Julian Day |
3491 | 59 | double getMJDay() const; | 59 | double getMJDay() const; |
3492 | 60 | 60 | ||
3493 | 61 | //! set the date in ISO format, e.g. "2008-03-24T13:21:01" | 61 | //! set the date in ISO format, e.g. "2008-03-24T13:21:01" |
3495 | 62 | //! @param dt the date string to use. Formats: | 62 | //! @param dateStr the date string to use. Formats: |
3496 | 63 | //! - ISO, e.g. "2008-03-24T13:21:01" | 63 | //! - ISO, e.g. "2008-03-24T13:21:01" |
3497 | 64 | //! - "now" (set sim time to real time) | 64 | //! - "now" (set sim time to real time) |
3498 | 65 | //! - relative, e.g. "+ 4 days", "-2 weeks". can use these | 65 | //! - relative, e.g. "+ 4 days", "-2 weeks". can use these |
3499 | @@ -71,8 +71,9 @@ | |||
3500 | 71 | //! of the unit is 1. i.e. use "+ 1 days" not "+1 day". | 71 | //! of the unit is 1. i.e. use "+ 1 days" not "+1 day". |
3501 | 72 | //! @note when sidereal time is used, the length of time for | 72 | //! @note when sidereal time is used, the length of time for |
3502 | 73 | //! each unit is dependent on the current planet. By contrast | 73 | //! each unit is dependent on the current planet. By contrast |
3504 | 74 | //! when sidereal timeis not specified (i.e. solar time is used) | 74 | //! when sidereal time is not specified (i.e. solar time is used) |
3505 | 75 | //! the value is conventional - i.e. 1 day means 1 Earth Solar day. | 75 | //! the value is conventional - i.e. 1 day means 1 Earth Solar day. |
3506 | 76 | // TODO: This calls for implementing "sol" days (planets's solar days)! | ||
3507 | 76 | //! @param spec "local" or "utc" - only has an effect when | 77 | //! @param spec "local" or "utc" - only has an effect when |
3508 | 77 | //! the ISO date type is used. Defaults to "utc". | 78 | //! the ISO date type is used. Defaults to "utc". |
3509 | 78 | //! @param enableDeltaT is \a true or \a false - enable Delta-T correction or not. | 79 | //! @param enableDeltaT is \a true or \a false - enable Delta-T correction or not. |
3510 | @@ -81,7 +82,11 @@ | |||
3511 | 81 | //! or earlier, you should call \b core.setDeltaTAlgorithm("WithoutCorrection"); | 82 | //! or earlier, you should call \b core.setDeltaTAlgorithm("WithoutCorrection"); |
3512 | 82 | //! before running \b core.setDate(); for disabling DeltaT correction. | 83 | //! before running \b core.setDate(); for disabling DeltaT correction. |
3513 | 83 | //! @note starting with version 0.13.2 all relative dates are set without DeltaT correction. | 84 | //! @note starting with version 0.13.2 all relative dates are set without DeltaT correction. |
3515 | 84 | void setDate(const QString& dt, const QString& spec="utc", const bool& enableDeltaT=true); | 85 | //! @note starting with version 0.14.0 the final optional Boolean argument has a different meaning and default! |
3516 | 86 | //! @param dateIsTT \a true if the given date is formulated in Dynamical Time, i.e. with DeltaT added. | ||
3517 | 87 | // GZ JDfix for 0.14: I estimate 99.7% of users will want to set UT-based dates here. We could use an awkward name like dateIsUTbased=true to keep default value true. | ||
3518 | 88 | //void setDate(const QString& dt, const QString& spec="utc", const bool& enableDeltaT=true); | ||
3519 | 89 | void setDate(const QString& dateStr, const QString& spec="utc", const bool& dateIsDT=false); | ||
3520 | 85 | 90 | ||
3521 | 86 | //! get the simulation date and time as a string in ISO format, | 91 | //! get the simulation date and time as a string in ISO format, |
3522 | 87 | //! e.g. "2008-03-24T13:21:01" | 92 | //! e.g. "2008-03-24T13:21:01" |
I think it ready to merge