Merge lp:~stellarium/stellarium/deltaT-advanced into lp:stellarium
- deltaT-advanced
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Alexander Wolf | ||||
Approved revision: | 5814 | ||||
Merged at revision: | 5822 | ||||
Proposed branch: | lp:~stellarium/stellarium/deltaT-advanced | ||||
Merge into: | lp:stellarium | ||||
Diff against target: |
3043 lines (+2156/-340) 19 files modified
data/gui/normalStyle.css (+6/-0) po/stellarium/POTFILES.in (+1/-0) src/CMakeLists.txt (+3/-0) src/core/SimbadSearcher.hpp (+1/-1) src/core/StelCore.cpp (+441/-2) src/core/StelCore.hpp (+101/-17) src/core/StelObserver.cpp (+1/-1) src/core/StelUtils.cpp (+537/-16) src/core/StelUtils.hpp (+163/-4) src/gui/ConfigurationDialog.cpp (+100/-1) src/gui/ConfigurationDialog.hpp (+8/-0) src/gui/CustomDeltaTEquationDialog.cpp (+122/-0) src/gui/CustomDeltaTEquationDialog.hpp (+69/-0) src/gui/CustomDeltaTEquationDialog.ui (+262/-0) src/gui/DateTimeDialog.cpp (+3/-3) src/gui/StelGuiItems.cpp (+15/-7) src/gui/configurationDialog.ui (+321/-286) src/scripting/StelMainScriptAPI.cpp (+1/-1) src/tests/testDeltaT.cpp (+1/-1) |
||||
To merge this branch: | bzr merge lp:~stellarium/stellarium/deltaT-advanced | ||||
Related bugs: |
|
||||
Related blueprints: |
Take DeltaT into computations
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexander Wolf | Approve | ||
gzotti | Pending | ||
Review via email: mp+148938@code.launchpad.net |
This proposal supersedes a proposal from 2013-02-15.
Commit message
Description of the change
Implementation of GUI which give users choose and apply different formulae for DeltaT calculations.
gzotti (georg-zotti) wrote : Posted in a previous version of this proposal | # |
barrykgerdes (barrygastro) wrote : Posted in a previous version of this proposal | # |
Hi George
I see you have added a nebula texture for Eta Carina
There is already a four panel mozaic of the eta carina area that I provided years ago along with many others
We originally stopped adding nebula because we were going to use DSS images.
If you check the images available in the wiki you will find the package.
Barry
> To: <email address hidden>
> From: <email address hidden>
> Subject: Re: [Merge] lp:~stellarium/stellarium/deltaT-advanced into lp:stellarium
> Date: Sat, 16 Feb 2013 15:46:20 +0000
>
> Review: Needs Fixing
>
> In all, it looks great. However, there is still the problem that in "current time/real-time" mode, the time displayed is not the system (PC clock) time, but system time corrected by DeltaT. This must be fixed before merge, IMHO. Small changes (docfix etc.) can be done later.
> I also had liked the warning signs for "out of recommended range", if possible.
> I am afraid the JPL Horizons value for the present time cannot be correct, and likewise Meeus&Simmons (2000), Montenbruck&
>
> --
> https:/
> Your team Stellarium is requested to review the proposed merge of lp:~stellarium/stellarium/deltaT-advanced into lp:stellarium.
gzotti (georg-zotti) wrote : Posted in a previous version of this proposal | # |
Dear Barry,
thanks for the info. There was just a bug report on eta Car, and one of my
best shots from 2002 (slide film, hand guided, remember? ;-D happened to
have been this. What are the plans/state on DSS?
Regards,
Georg.
On Sa, 16.02.2013, 21:31, barrykgerdes wrote:
>
> Hi George
> I see you have added a nebula texture for Eta Carina
> There is already a four panel mozaic of the eta carina area that I
> provided years ago along with many others
> We originally stopped adding nebula because we were going to use DSS
> images.
> If you check the images available in the wiki you will find the package.
>
> Barry
>
>
>> To: <email address hidden>
>> From: <email address hidden>
>> Subject: Re: [Merge] lp:~stellarium/stellarium/deltaT-advanced into
>> lp:stellarium
>> Date: Sat, 16 Feb 2013 15:46:20 +0000
>>
>> Review: Needs Fixing
>>
>> In all, it looks great. However, there is still the problem that in
>> "current time/real-time" mode, the time displayed is not the system (PC
>> clock) time, but system time corrected by DeltaT. This must be fixed
>> before merge, IMHO. Small changes (docfix etc.) can be done later.
>> I also had liked the warning signs for "out of recommended range", if
>> possible.
>> I am afraid the JPL Horizons value for the present time cannot be
>> correct, and likewise Meeus&Simmons (2000), Montenbruck&
>>
>> --
>> https:/
>> Your team Stellarium is requested to review the proposed merge of
>> lp:~stellarium/stellarium/deltaT-advanced into lp:stellarium.
>
> --
> https:/
> You are reviewing the proposed merge of
> lp:~stellarium/stellarium/deltaT-advanced into lp:stellarium.
>
barrykgerdes (barrygastro) wrote : Posted in a previous version of this proposal | # |
Hi George
I don't know what is going on about the DSS. It was supposed to be a requirement for 1.0.0 but since Fabien has reduced his input , the program for release of 1.0.0 has been forgotten. I think there is some dificulty with hosting, Fabien had it all ready to roll, but I still have the Virgo version (0.10.3) that accesses the DSS so I use this. I have a suite of images that I have collected from our astro imaging group including some of mine and Trevor's of around 30MB with about 190 images. It contains many improved Messier's and better positions. It includes mosaics of Rho ophiuchus ,SMC and LMC. Large areas need to be mosaics as registration gets poor with fields over 1 degree. We have a very dark site in mid western NSW where we go every new moon to photograph (all digital and guided these days). I have access to some really good highres images of eta carina enhanced with H alpha that are very highly detailed.
Barry
> To: <email address hidden>
> From: <email address hidden>
> Subject: RE: [Merge] lp:~stellarium/stellarium/deltaT-advanced into lp:stellarium
> Date: Sat, 16 Feb 2013 20:52:20 +0000
>
> Dear Barry,
>
> thanks for the info. There was just a bug report on eta Car, and one of my
> best shots from 2002 (slide film, hand guided, remember? ;-D happened to
> have been this. What are the plans/state on DSS?
>
> Regards,
> Georg.
>
> On Sa, 16.02.2013, 21:31, barrykgerdes wrote:
> >
> > Hi George
> > I see you have added a nebula texture for Eta Carina
> > There is already a four panel mozaic of the eta carina area that I
> > provided years ago along with many others
> > We originally stopped adding nebula because we were going to use DSS
> > images.
> > If you check the images available in the wiki you will find the package.
> >
> > Barry
> >
> >
> >> To: <email address hidden>
> >> From: <email address hidden>
> >> Subject: Re: [Merge] lp:~stellarium/stellarium/deltaT-advanced into
> >> lp:stellarium
> >> Date: Sat, 16 Feb 2013 15:46:20 +0000
> >>
> >> Review: Needs Fixing
> >>
> >> In all, it looks great. However, there is still the problem that in
> >> "current time/real-time" mode, the time displayed is not the system (PC
> >> clock) time, but system time corrected by DeltaT. This must be fixed
> >> before merge, IMHO. Small changes (docfix etc.) can be done later.
> >> I also had liked the warning signs for "out of recommended range", if
> >> possible.
> >> I am afraid the JPL Horizons value for the present time cannot be
> >> correct, and likewise Meeus&Simmons (2000), Montenbruck&
> >>
> >> --
> >> https:/
> >> Your team Stellarium is requested to review the proposed merge of
> >> lp:~stellarium/stellarium/deltaT-advanced into lp:stellarium.
> >
> > --
> > https:/
> > You are reviewing the proposed merge of
> > lp:~stellarium/stellarium/deltaT-advanced into lp:stellarium.
> >
>
>
>
> --
> https:/
> Your team Stellarium is requested to review the proposed merge of...
Alexander Wolf (alexwolf) wrote : Posted in a previous version of this proposal | # |
Startup time fixed via correction Delta-T (IMHO this is better way) + implemented getting and showing valid range usage of Delta-T for different algorithms (possible value: within valid range; not in valid range (*); valid range are unknown (?)).
Alexander Wolf (alexwolf) : | # |
gzotti (georg-zotti) wrote : Posted in a previous version of this proposal | # |
The current solution is fine. The only distraction is that when changing DeltaT algorithm, displayed (zone) time changes. Should not matter if you just select your favorite version and save settings - on next startup all is fine. The optimal solution would IMHO be if the displayed time - and with it the sky image in the background (which depends on UT, i.e. mean solar time) - would not jump, but e.g. for solar eclipses you can target&lock the sun.
Another tiny GUI issue: One of the options of the dropdown [e.g. Espenak-Meeus (2006)] should be marked as "default".
More formulae can then be added to trunk as required. Wow, this is really unique!
Preview Diff
1 | === modified file 'data/gui/normalStyle.css' |
2 | --- data/gui/normalStyle.css 2013-02-09 14:19:04 +0000 |
3 | +++ data/gui/normalStyle.css 2013-02-17 21:34:20 +0000 |
4 | @@ -166,6 +166,12 @@ |
5 | padding-left:11px; |
6 | } |
7 | |
8 | +QTextBrowser#deltaTAlgorithmDescription { |
9 | + background: transparent; |
10 | + padding: 0px; |
11 | + margin: 0px; |
12 | +} |
13 | + |
14 | /***************************************************SearchDialog********************************************************/ |
15 | |
16 | QFrame#horizontalSearchLayout { |
17 | |
18 | === modified file 'po/stellarium/POTFILES.in' |
19 | --- po/stellarium/POTFILES.in 2012-11-03 13:35:53 +0000 |
20 | +++ po/stellarium/POTFILES.in 2013-02-17 21:34:20 +0000 |
21 | @@ -27,6 +27,7 @@ |
22 | src/gui/ScriptConsole.cpp |
23 | src/gui/SearchDialog.cpp |
24 | src/gui/ShortcutsDialog.cpp |
25 | +src/gui/CustomDeltaTEquationDialog.cpp |
26 | src/main.cpp |
27 | |
28 | # Translations of strings not contained in the source code |
29 | |
30 | === modified file 'src/CMakeLists.txt' |
31 | --- src/CMakeLists.txt 2013-01-12 17:31:51 +0000 |
32 | +++ src/CMakeLists.txt 2013-02-17 21:34:20 +0000 |
33 | @@ -414,6 +414,8 @@ |
34 | gui/AddRemoveLandscapesDialog.cpp |
35 | gui/AtmosphereDialog.hpp |
36 | gui/AtmosphereDialog.cpp |
37 | + gui/CustomDeltaTEquationDialog.hpp |
38 | + gui/CustomDeltaTEquationDialog.cpp |
39 | gui/StelDialog.hpp |
40 | gui/StelDialog.cpp) |
41 | |
42 | @@ -427,6 +429,7 @@ |
43 | gui/searchDialogGui.ui |
44 | gui/configurationDialog.ui |
45 | gui/AtmosphereDialog.ui |
46 | + gui/CustomDeltaTEquationDialog.ui |
47 | gui/addRemoveLandscapesDialog.ui) |
48 | |
49 | IF(ENABLE_SCRIPT_CONSOLE) |
50 | |
51 | === modified file 'src/core/SimbadSearcher.hpp' |
52 | --- src/core/SimbadSearcher.hpp 2012-03-14 14:18:10 +0000 |
53 | +++ src/core/SimbadSearcher.hpp 2013-02-17 21:34:20 +0000 |
54 | @@ -32,7 +32,7 @@ |
55 | class SimbadLookupReply : public QObject |
56 | { |
57 | Q_OBJECT |
58 | - Q_ENUMS(SimbadLookupStatus); |
59 | + Q_ENUMS(SimbadLookupStatus) |
60 | |
61 | public: |
62 | friend class SimbadSearcher; |
63 | |
64 | === modified file 'src/core/StelCore.cpp' |
65 | --- src/core/StelCore.cpp 2013-02-08 16:40:32 +0000 |
66 | +++ src/core/StelCore.cpp 2013-02-17 21:34:20 +0000 |
67 | @@ -36,6 +36,7 @@ |
68 | #include "renderer/GenericVertexTypes.hpp" |
69 | #include "renderer/StelRenderer.hpp" |
70 | #include "LandscapeMgr.hpp" |
71 | +#include "StelTranslator.hpp" |
72 | |
73 | #include <QSettings> |
74 | #include <QDebug> |
75 | @@ -103,6 +104,17 @@ |
76 | } |
77 | position = new StelObserver(location); |
78 | |
79 | + // Delta-T stuff |
80 | + // Define default algorithm for time correction (Delta T) |
81 | + QString tmpDT = conf->value("navigation/time_correction_algorithm", "EspenakMeeus").toString(); |
82 | + setCurrentDeltaTAlgorithmKey(tmpDT); |
83 | + |
84 | + // Define variables of custom equation for calculation of Delta T |
85 | + // Default: ndot = -26.0 "/cy/cy; year = 1820; DeltaT = -20 + 32*u^2, where u = (currentYear-1820)/100 |
86 | + setCustomYear(conf->value("custom_time_correction/year", 1820.0).toFloat()); |
87 | + setCustomNDot(conf->value("custom_time_correction/ndot", -26.0).toFloat()); |
88 | + setCustomEquationCoefficients(StelUtils::strToVec3f(conf->value("custom_time_correction/coefficients", "-20,0,32").toString())); |
89 | + |
90 | // Time stuff |
91 | setTimeNow(); |
92 | |
93 | @@ -138,7 +150,7 @@ |
94 | skyDrawer->init(); |
95 | |
96 | QString tmpstr = conf->value("projection/type", "ProjectionStereographic").toString(); |
97 | - setCurrentProjectionTypeKey(tmpstr); |
98 | + setCurrentProjectionTypeKey(tmpstr); |
99 | } |
100 | |
101 | |
102 | @@ -855,7 +867,9 @@ |
103 | //! Set stellarium time to current real world time |
104 | void StelCore::setTimeNow() |
105 | { |
106 | - setJDay(StelUtils::getJDFromSystem()); |
107 | + double JD = StelUtils::getJDFromSystem(); |
108 | + // add Delta-T correction for actual time |
109 | + setJDay(JD+getDeltaT(JD)/86400); |
110 | } |
111 | |
112 | void StelCore::setTodayTime(const QTime& target) |
113 | @@ -1213,3 +1227,428 @@ |
114 | { |
115 | startupTimeMode = s; |
116 | } |
117 | + |
118 | +double StelCore::getDeltaT(double jDay) |
119 | +{ |
120 | + double DeltaT = 0.; |
121 | + double ndot = 0.; |
122 | + bool dontUseMoon = false; |
123 | + switch (getCurrentDeltaTAlgorithm()) { |
124 | + case WithoutCorrection: |
125 | + // Without correction, DeltaT is disabled |
126 | + DeltaT = 0.; |
127 | + dontUseMoon = true; |
128 | + break; |
129 | + case Schoch: |
130 | + // Schoch (1931) algorithm for DeltaT |
131 | + ndot = -29.68; // n.dot = -29.68"/cy/cy |
132 | + DeltaT = StelUtils::getDeltaTBySchoch(jDay); |
133 | + break; |
134 | + case Clemence: |
135 | + // Clemence (1948) algorithm for DeltaT |
136 | + ndot = -22.44; // n.dot = -22.44 "/cy/cy |
137 | + DeltaT = StelUtils::getDeltaTByClemence(jDay); |
138 | + break; |
139 | + case IAU: |
140 | + // IAU (1952) algorithm for DeltaT, based on observations by Spencer Jones (1939) |
141 | + ndot = -22.44; // n.dot = -22.44 "/cy/cy |
142 | + DeltaT = StelUtils::getDeltaTByIAU(jDay); |
143 | + break; |
144 | + case AstronomicalEphemeris: |
145 | + // Astronomical Ephemeris (1960) algorithm for DeltaT |
146 | + ndot = -22.44; // n.dot = -22.44 "/cy/cy |
147 | + DeltaT = StelUtils::getDeltaTByAstronomicalEphemeris(jDay); |
148 | + break; |
149 | + case TuckermanGoldstine: |
150 | + // Tuckerman (1962, 1964) & Goldstine (1973) algorithm for DeltaT |
151 | + //FIXME: n.dot |
152 | + ndot = -22.44; // n.dot = -22.44 "/cy/cy ??? |
153 | + DeltaT = StelUtils::getDeltaTByTuckermanGoldstine(jDay); |
154 | + break; |
155 | + case MullerStephenson: |
156 | + // Muller & Stephenson (1975) algorithm for DeltaT |
157 | + ndot = -37.5; // n.dot = -37.5 "/cy/cy |
158 | + DeltaT = StelUtils::getDeltaTByMullerStephenson(jDay); |
159 | + break; |
160 | + case Stephenson1978: |
161 | + // Stephenson (1978) algorithm for DeltaT |
162 | + ndot = -30.0; // n.dot = -30.0 "/cy/cy |
163 | + DeltaT = StelUtils::getDeltaTByStephenson1978(jDay); |
164 | + break; |
165 | + case SchmadelZech1979: |
166 | + // Schmadel & Zech (1979) algorithm for DeltaT |
167 | + ndot = -23.8946; // n.dot = -23.8946 "/cy/cy |
168 | + DeltaT = StelUtils::getDeltaTBySchmadelZech1979(jDay); |
169 | + break; |
170 | + case MorrisonStephenson1982: |
171 | + // Morrison & Stephenson (1982) algorithm for DeltaT (used by RedShift) |
172 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy |
173 | + DeltaT = StelUtils::getDeltaTByMorrisonStephenson1982(jDay); |
174 | + break; |
175 | + case StephensonMorrison1984: |
176 | + // Stephenson & Morrison (1984) algorithm for DeltaT |
177 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy |
178 | + DeltaT = StelUtils::getDeltaTByStephensonMorrison1984(jDay); |
179 | + break; |
180 | + case StephensonHoulden: |
181 | + // Stephenson & Houlden (1986) algorithm for DeltaT |
182 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy |
183 | + DeltaT = StelUtils::getDeltaTByStephensonHoulden(jDay); |
184 | + break; |
185 | + case Espenak: |
186 | + // Espenak (1987, 1989) algorithm for DeltaT |
187 | + //FIXME: n.dot |
188 | + ndot = -23.8946; // n.dot = -23.8946 "/cy/cy ??? |
189 | + DeltaT = StelUtils::getDeltaTByEspenak(jDay); |
190 | + break; |
191 | + case Borkowski: |
192 | + // Borkowski (1988) algorithm for DeltaT |
193 | + ndot = -23.859; // n.dot = -23.859 "/cy/cy |
194 | + DeltaT = StelUtils::getDeltaTByBorkowski(jDay); |
195 | + break; |
196 | + case SchmadelZech1988: |
197 | + // Schmadel & Zech (1988) algorithm for DeltaT |
198 | + //FIXME: n.dot |
199 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? |
200 | + DeltaT = StelUtils::getDeltaTBySchmadelZech1988(jDay); |
201 | + break; |
202 | + case ChaprontTouze: |
203 | + // Chapront-Touzé & Chapront (1991) algorithm for DeltaT |
204 | + ndot = -23.8946; // n.dot = -23.8946 "/cy/cy |
205 | + DeltaT = StelUtils::getDeltaTByChaprontTouze(jDay); |
206 | + break; |
207 | + case StephensonMorrison1995: |
208 | + // Stephenson & Morrison (1995) algorithm for DeltaT |
209 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy |
210 | + DeltaT = StelUtils::getDeltaTByStephensonMorrison1995(jDay); |
211 | + break; |
212 | + case Stephenson1997: |
213 | + // Stephenson (1997) algorithm for DeltaT |
214 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy |
215 | + DeltaT = StelUtils::getDeltaTByStephenson1997(jDay); |
216 | + break; |
217 | + case ChaprontFrancou: |
218 | + // Chapront, Chapront-Touzé & Francou (1997) algorithm for DeltaT |
219 | + ndot = -25.7376; // n.dot = -25.7376 "/cy/cy |
220 | + DeltaT = StelUtils::getDeltaTByChaprontFrancou(jDay); |
221 | + break; |
222 | + case Meeus: |
223 | + // Meeus (1998) algorithm for DeltaT |
224 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy |
225 | + DeltaT = StelUtils::getDeltaTByMeeus(jDay); |
226 | + break; |
227 | + case JPLHorizons: |
228 | + // JPL Horizons algorithm for DeltaT |
229 | + ndot = -25.7376; // n.dot = -25.7376 "/cy/cy |
230 | + DeltaT = StelUtils::getDeltaTByJPLHorizons(jDay); |
231 | + break; |
232 | + case MeeusSimons: |
233 | + // Meeus & Simons (2000) algorithm for DeltaT |
234 | + ndot = -25.7376; // n.dot = -25.7376 "/cy/cy |
235 | + DeltaT = StelUtils::getDeltaTByMeeusSimons(jDay); |
236 | + break; |
237 | + case MontenbruckPfleger: |
238 | + // Montenbruck & Pfleger (2000) algorithm for DeltaT |
239 | + // NOTE: book not contains n.dot value |
240 | + // FIXME: n.dot |
241 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? |
242 | + DeltaT = StelUtils::getDeltaTByMontenbruckPfleger(jDay); |
243 | + break; |
244 | + case ReingoldDershowitz: |
245 | + // Reingold & Dershowitz (2001, 2002) algorithm for DeltaT |
246 | + // FIXME: n.dot |
247 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy ??? |
248 | + DeltaT = StelUtils::getDeltaTByReingoldDershowitz(jDay); |
249 | + break; |
250 | + case MorrisonStephenson2004: |
251 | + // Morrison & Stephenson (2004, 2005) algorithm for DeltaT |
252 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy |
253 | + DeltaT = StelUtils::getDeltaTByMorrisonStephenson2004(jDay); |
254 | + break; |
255 | + case Reijs: |
256 | + // Reijs (2006) algorithm for DeltaT |
257 | + ndot = -26.0; // n.dot = -26.0 "/cy/cy |
258 | + DeltaT = StelUtils::getDeltaTByReijs(jDay); |
259 | + break; |
260 | + case EspenakMeeus: |
261 | + // Espenak & Meeus (2006) algorithm for DeltaT |
262 | + ndot = -25.858; // n.dot = -25.858 "/cy/cy |
263 | + DeltaT = StelUtils::getDeltaTByEspenakMeeus(jDay); |
264 | + break; |
265 | + case Custom: |
266 | + // User defined coefficients for quadratic equation for DeltaT |
267 | + ndot = getCustomNDot(); // n.dot = custom value "/cy/cy |
268 | + int year, month, day; |
269 | + Vec3f coeff = getCustomEquationCoefficients(); |
270 | + StelUtils::getDateFromJulianDay(jDay, &year, &month, &day); |
271 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
272 | + double u = (yeardec-getCustomYear())/100; |
273 | + DeltaT = coeff[0] + coeff[1]*u + coeff[2]*std::pow(u,2); |
274 | + break; |
275 | + } |
276 | + |
277 | + if (!dontUseMoon) |
278 | + DeltaT += StelUtils::getMoonSecularAcceleration(jDay, ndot); |
279 | + |
280 | + return DeltaT; |
281 | +} |
282 | + |
283 | +//! Set the current algorithm for time correction to use |
284 | +void StelCore::setCurrentDeltaTAlgorithmKey(QString key) |
285 | +{ |
286 | + const QMetaEnum& en = metaObject()->enumerator(metaObject()->indexOfEnumerator("DeltaTAlgorithm")); |
287 | + DeltaTAlgorithm algo = (DeltaTAlgorithm)en.keyToValue(key.toAscii().data()); |
288 | + if (algo<0) |
289 | + { |
290 | + qWarning() << "Unknown DeltaT algorithm: " << key << "setting \"WithoutCorrection\" instead"; |
291 | + algo = WithoutCorrection; |
292 | + } |
293 | + setCurrentDeltaTAlgorithm(algo); |
294 | +} |
295 | + |
296 | +//! Get the current algorithm used by the DeltaT |
297 | +QString StelCore::getCurrentDeltaTAlgorithmKey(void) const |
298 | +{ |
299 | + return metaObject()->enumerator(metaObject()->indexOfEnumerator("DeltaTAlgorithm")).key(currentDeltaTAlgorithm); |
300 | +} |
301 | + |
302 | +//! Get description of the current algorithm for time correction |
303 | +QString StelCore::getCurrentDeltaTAlgorithmDescription(void) const |
304 | +{ // GZ remarked where more info would be desirable. Generally, a full citation and the math. term would be nice to have displayed if it's just one formula, and the range of valid dates. |
305 | + QString description; |
306 | + double jd = 0; |
307 | + QString marker; |
308 | + switch (getCurrentDeltaTAlgorithm()) { |
309 | + case WithoutCorrection: |
310 | + description = q_("Correction is disabled. Use only if you know what you are doing!"); |
311 | + break; |
312 | + case Schoch: |
313 | + description = q_("This formula was obtained by C. Schoch in 1931 year and was used by G. Henriksson in article <em>Einstein's Theory of Relativity Confirmed by Ancient Solar Eclipses</em> (%1). See for more info %2here%3.").arg("<a href='http://adsabs.harvard.edu/abs/2009ASPC..409..166H'>2010</a>").arg("<a href='http://journalofcosmology.com/AncientAstronomy123.html'>").arg("</a>").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
314 | + break; |
315 | + case Clemence: |
316 | + description = q_("This empirical equation was published by G. M. Clemence in article <em>On the system of astronomical constants</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1948AJ.....53..169C'>1948</a>").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
317 | + break; |
318 | + case IAU: |
319 | + description = q_("This formula is based on a study of the 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
320 | + // find year of publication of AFFC |
321 | + break; |
322 | + case AstronomicalEphemeris: |
323 | + description = q_("This is a slightly modified version of the IAU (1952) formula which was adopted in the <em>Astronomical Ephemeris</em>.").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
324 | + // TODO: expand the sentence: ... adopted ... from 19xx-19yy? |
325 | + break; |
326 | + case TuckermanGoldstine: |
327 | + 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 listed positions are for 19h 00m (mean) local time at Babylon/Baghdad (i.e. near sunset) or 16h 00m GMT. The same relation was also implicitly adopted in the syzygy tables of Goldstine (1973).").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
328 | + // TODO: These tables are sometimes found cited, but I have no details. Maybe add "based on ... " ? |
329 | + break; |
330 | + case MullerStephenson: |
331 | + description = q_("This equation was published by P. M. Muller and F. R. Stephenson in 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
332 | + break; |
333 | + case Stephenson1978: |
334 | + description = q_("This equation was published by F. R. Stephenson in article <em>Pre-Telescopic Astronomical Observations</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1978tfer.conf....5S'>1978</a>").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
335 | + break; |
336 | + case SchmadelZech1979: |
337 | + description = q_("This equation was published by L. D. Schmadel and G. Zech in article <em>Polynomial approximations for the correction delta T E.T.-U.T. in the period 1800-1975</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1979AcA....29..101S'>1979</a>").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
338 | + break; |
339 | + case MorrisonStephenson1982: |
340 | + 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
341 | + break; |
342 | + case StephensonMorrison1984: |
343 | + description = q_("This formula was published by Stephenson, F. R.; Morrison, L. V. in 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
344 | + break; |
345 | + case StephensonHoulden: |
346 | + description = q_("This algorithm is used in the PC planetarium program Guide 7.").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
347 | + break; |
348 | + case Espenak: |
349 | + 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
350 | + break; |
351 | + case Borkowski: |
352 | + 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
353 | + break; |
354 | + case SchmadelZech1988: |
355 | + description = q_("This equation was published by L. D. Schmadel and G. Zech in article <em>Empirical Transformations from U.T. to E.T. for the Period 1800-1988</em> (%1).").arg("<a href='http://adsabs.harvard.edu/abs/1988AN....309..219S'>1988</a>").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
356 | + break; |
357 | + case ChaprontTouze: |
358 | + 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
359 | + break; |
360 | + case StephensonMorrison1995: |
361 | + description = q_("This equation was published by F. R. Stephenson and L. V. Morrison in 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
362 | + break; |
363 | + case Stephenson1997: |
364 | + description = q_("F. R. Stephenson published this formula in their book <em>Historical Eclipses and Earth's Rotation</em> (%1).").arg("<a href='http://ebooks.cambridge.org/ebook.jsf?bid=CBO9780511525186'>1997</a>").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
365 | + break; |
366 | + case ChaprontFrancou: |
367 | + description = q_("This formula is recommended by J. Meeus in the second edition of his <em>Astronomical Algorithms</em> (1998) and used in Shinobu Takesako's EmapWin program for plotting the circumstances of solar eclipses from 3000 B.C. to A.D. 3000 and in Kerry Shetline's interactive planetarium Sky View Cafe.").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
368 | + break; |
369 | + case Meeus: |
370 | + description = q_("J. Meeus, in the second edition of his <em>Astronomical Algorithms</em> (1998), gives a 12th-order formula.").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
371 | + // TODO: specify which one this is? (I have the book at home only) |
372 | + break; |
373 | + case JPLHorizons: |
374 | + description = q_("The JPL Solar System Dynamics Group of the NASA Jet Propulsion Laboratory used this formula in their interactive website %1JPL Horizons%2.").arg("<a href='http://ssd.jpl.nasa.gov/?horizons'>").arg("</a>").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
375 | + break; |
376 | + case MeeusSimons: |
377 | + description = q_("This polinom 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
378 | + break; |
379 | + case MontenbruckPfleger: |
380 | + description = q_("The fourth edition of O. Montenbruck & T. Pfleger's <em>Astronomy on the Personal Computer</em> (2000) provides the 3rd-order polynomials.").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
381 | + break; |
382 | + case ReingoldDershowitz: |
383 | + description = q_("E. M. Reingold & N. Dershowitz adopt the approximate formula in the second edition of <em>Calendrical Calculations</em> (2001) and in their <em>Calendrical Tabulations</em> (2002).").append(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
384 | + break; |
385 | + case MorrisonStephenson2004: |
386 | + description = q_("This equation 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
387 | + break; |
388 | + case Reijs: |
389 | + 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
390 | + break; |
391 | + case EspenakMeeus: |
392 | + description = q_("This formula by F. Espenak and J. Meeus is used for the %1NASA Eclipse Web Site%2. 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(getCurrentDeltaTAlgorithmValigRange(jd, &marker)); |
393 | + break; |
394 | + case Custom: |
395 | + description = q_("This is quadratic formula for calculation of %1T with coefficients defined by user.").arg(QChar(0x0394)); |
396 | + break; |
397 | + default: |
398 | + description = q_("Error"); |
399 | + } |
400 | + return description; |
401 | +} |
402 | + |
403 | +QString StelCore::getCurrentDeltaTAlgorithmValigRange(double jDay, QString *marker) const |
404 | +{ |
405 | + QString validRange = ""; |
406 | + QString validRangeAppendix = ""; |
407 | + *marker = ""; |
408 | + int year, month, day; |
409 | + int start = 0; |
410 | + int finish = 0; |
411 | + StelUtils::getDateFromJulianDay(jDay, &year, &month, &day); |
412 | + switch (getCurrentDeltaTAlgorithm()) { |
413 | + case WithoutCorrection: |
414 | + // Nothing make |
415 | + break; |
416 | + case Schoch: |
417 | + // Valid range unknown |
418 | + break; |
419 | + case Clemence: |
420 | + start = 1681; |
421 | + finish = 1900; |
422 | + break; |
423 | + case IAU: |
424 | + start = 1681; |
425 | + finish = 1900; |
426 | + break; |
427 | + case AstronomicalEphemeris: |
428 | + start = 1681; |
429 | + finish = 1900; |
430 | + break; |
431 | + case TuckermanGoldstine: |
432 | + start = -600; |
433 | + finish = 1649; |
434 | + break; |
435 | + case MullerStephenson: |
436 | + start = -1375; |
437 | + finish = 1975; |
438 | + break; |
439 | + case Stephenson1978: |
440 | + // Valid range unknown |
441 | + break; |
442 | + case SchmadelZech1979: |
443 | + start = 1800; |
444 | + finish = 1975; |
445 | + break; |
446 | + case MorrisonStephenson1982: |
447 | + // FIXME: This is correct valid range? |
448 | + start = -4000; |
449 | + finish = 2800; |
450 | + break; |
451 | + case StephensonMorrison1984: |
452 | + start = -391; |
453 | + finish = 1600; |
454 | + break; |
455 | + case StephensonHoulden: |
456 | + start = -600; |
457 | + finish = 1600; |
458 | + break; |
459 | + case Espenak: |
460 | + start = 1950; |
461 | + finish = 2100; |
462 | + break; |
463 | + case Borkowski: |
464 | + start = -2136; |
465 | + finish = 1715; |
466 | + break; |
467 | + case SchmadelZech1988: |
468 | + start = 1800; |
469 | + finish = 1988; |
470 | + break; |
471 | + case ChaprontTouze: |
472 | + // FIXME: This is valid range? |
473 | + start = -4000; |
474 | + finish = 8000; |
475 | + break; |
476 | + case StephensonMorrison1995: |
477 | + start = -700; |
478 | + finish = 1600; |
479 | + break; |
480 | + case Stephenson1997: |
481 | + start = -500; |
482 | + finish = 1600; |
483 | + break; |
484 | + case ChaprontFrancou: |
485 | + // FIXME: This is valid range? |
486 | + start = -3000; |
487 | + finish = 3000; |
488 | + break; |
489 | + case Meeus: |
490 | + start = 1800; |
491 | + finish = 1997; |
492 | + validRangeAppendix = q_("with a maximum error of 2.3 seconds"); |
493 | + break; |
494 | + case JPLHorizons: |
495 | + start = -2999; |
496 | + finish = 1620; |
497 | + break; |
498 | + case MeeusSimons: |
499 | + start = 1620; |
500 | + finish = 2000; |
501 | + break; |
502 | + case MontenbruckPfleger: |
503 | + start = 1825; |
504 | + finish = 2000; |
505 | + validRangeAppendix = q_("with a typical 1-second accuracy"); |
506 | + break; |
507 | + case ReingoldDershowitz: |
508 | + start = 1620; |
509 | + finish = 2019; |
510 | + break; |
511 | + case MorrisonStephenson2004: |
512 | + start = -1000; |
513 | + finish = 2000; |
514 | + break; |
515 | + case Reijs: |
516 | + start = -500; |
517 | + finish = 1990; |
518 | + break; |
519 | + case EspenakMeeus: |
520 | + start = -500; |
521 | + finish = 2150; |
522 | + break; |
523 | + case Custom: |
524 | + // Valid range unknown |
525 | + break; |
526 | + } |
527 | + |
528 | + if (start!=finish) |
529 | + { |
530 | + if (validRangeAppendix!="") |
531 | + validRange = q_("Valid range of usage: between years %1 and %2, %3.").arg(start).arg(finish).arg(validRangeAppendix); |
532 | + else |
533 | + validRange = q_("Valid range of usage: between years %1 and %2.").arg(start).arg(finish); |
534 | + if (start > year or year > finish) |
535 | + *marker = "*"; |
536 | + } |
537 | + else |
538 | + *marker = "?"; |
539 | + |
540 | + return QString(" %1").arg(validRange); |
541 | +} |
542 | |
543 | === modified file 'src/core/StelCore.hpp' |
544 | --- src/core/StelCore.hpp 2013-01-25 03:34:37 +0000 |
545 | +++ src/core/StelCore.hpp 2013-02-17 21:34:20 +0000 |
546 | @@ -47,34 +47,35 @@ |
547 | { |
548 | Q_OBJECT |
549 | Q_ENUMS(ProjectionType) |
550 | + Q_ENUMS(DeltaTAlgorithm) |
551 | |
552 | public: |
553 | //! @enum FrameType |
554 | //! Supported reference frame types |
555 | enum FrameType |
556 | { |
557 | - FrameUninitialized, //!< Reference frame is not set (FMajerech: Added to avoid condition on uninitialized value in StelSkyLayerMgr::draw()) |
558 | - FrameAltAz, //!< Altazimuthal reference frame centered on observer. |
559 | - FrameHeliocentricEcliptic, //!< Ecliptic reference frame centered on the Sun |
560 | - FrameObservercentricEcliptic, //!< Ecliptic reference frame centered on the Observer |
561 | - FrameEquinoxEqu, //!< Equatorial reference frame at the current equinox centered on the observer. |
562 | - //! The north pole follows the precession of the planet on which the observer is located. |
563 | - FrameJ2000, //!< Equatorial reference frame at the J2000 equinox centered on the observer. |
564 | - //! This is also the ICRS reference frame. |
565 | - FrameGalactic //! Galactic reference frame centered on observer. |
566 | + FrameUninitialized, //!< Reference frame is not set (FMajerech: Added to avoid condition on uninitialized value in StelSkyLayerMgr::draw()) |
567 | + FrameAltAz, //!< Altazimuthal reference frame centered on observer. |
568 | + FrameHeliocentricEcliptic, //!< Ecliptic reference frame centered on the Sun |
569 | + FrameObservercentricEcliptic, //!< Ecliptic reference frame centered on the Observer |
570 | + FrameEquinoxEqu, //!< Equatorial reference frame at the current equinox centered on the observer. |
571 | + //! The north pole follows the precession of the planet on which the observer is located. |
572 | + FrameJ2000, //!< Equatorial reference frame at the J2000 equinox centered on the observer. |
573 | + //! This is also the ICRS reference frame. |
574 | + FrameGalactic //! Galactic reference frame centered on observer. |
575 | }; |
576 | |
577 | //! Available projection types. A value of 1000 indicate the default projection |
578 | enum ProjectionType |
579 | { |
580 | - ProjectionPerspective, //!< Perspective projection |
581 | - ProjectionEqualArea, //!< Equal Area projection |
582 | - ProjectionStereographic, //!< Stereograhic projection |
583 | - ProjectionFisheye, //!< Fisheye projection |
584 | - ProjectionHammer, //!< Hammer-Aitoff projection |
585 | - ProjectionCylinder, //!< Cylinder projection |
586 | - ProjectionMercator, //!< Mercator projection |
587 | - ProjectionOrthographic //!< Orthographic projection |
588 | + ProjectionPerspective, //!< Perspective projection |
589 | + ProjectionEqualArea, //!< Equal Area projection |
590 | + ProjectionStereographic, //!< Stereograhic projection |
591 | + ProjectionFisheye, //!< Fisheye projection |
592 | + ProjectionHammer, //!< Hammer-Aitoff projection |
593 | + ProjectionCylinder, //!< Cylinder projection |
594 | + ProjectionMercator, //!< Mercator projection |
595 | + ProjectionOrthographic //!< Orthographic projection |
596 | }; |
597 | |
598 | //! Available refraction mode. |
599 | @@ -85,6 +86,40 @@ |
600 | RefractionOff //!< Never add refraction (i.e. geometric coordinates) |
601 | }; |
602 | |
603 | + //! @enum DeltaTAlgorithm |
604 | + //! Available DeltaT algorithms |
605 | + enum DeltaTAlgorithm |
606 | + { |
607 | + WithoutCorrection, //!< Without correction, DeltaT is disabled |
608 | + Schoch, //!< Schoch (1931) algorithm for DeltaT |
609 | + Clemence, //!< Clemence (1948) algorithm for DeltaT |
610 | + IAU, //!< IAU (1952) algorithm for DeltaT (based on observations by Spencer Jones (1939)) |
611 | + AstronomicalEphemeris, //!< Astronomical Ephemeris (1960) algorithm for DeltaT |
612 | + TuckermanGoldstine, //!< Tuckerman (1962, 1964) & Goldstine (1973) algorithm for DeltaT |
613 | + MullerStephenson, //!< Muller & Stephenson (1975) algorithm for DeltaT |
614 | + Stephenson1978, //!< Stephenson (1978) algorithm for DeltaT |
615 | + SchmadelZech1979, //!< Schmadel & Zech (1979) algorithm for DeltaT |
616 | + MorrisonStephenson1982, //!< Morrison & Stephenson (1982) algorithm for DeltaT (used by RedShift) |
617 | + StephensonMorrison1984, //!< Stephenson & Morrison (1984) algorithm for DeltaT |
618 | + StephensonHoulden, //!< Stephenson & Houlden (1986) algorithm for DeltaT |
619 | + Espenak, //!< Espenak (1987, 1989) algorithm for DeltaT |
620 | + Borkowski, //!< Borkowski (1988) algorithm for DeltaT |
621 | + SchmadelZech1988, //!< Schmadel & Zech (1988) algorithm for DeltaT |
622 | + ChaprontTouze, //!< Chapront-Touzé & Chapront (1991) algorithm for DeltaT |
623 | + StephensonMorrison1995, //!< Stephenson & Morrison (1995) algorithm for DeltaT |
624 | + Stephenson1997, //!< Stephenson (1997) algorithm for DeltaT |
625 | + ChaprontFrancou, //!< Chapront, Chapront-Touzé & Francou (1997) algorithm for DeltaT |
626 | + Meeus, //!< Meeus (1998) algorithm for DeltaT |
627 | + JPLHorizons, //!< JPL Horizons algorithm for DeltaT |
628 | + MeeusSimons, //!< Meeus & Simons (2000) algorithm for DeltaT |
629 | + MontenbruckPfleger, //!< Montenbruck & Pfleger (2000) algorithm for DeltaT |
630 | + ReingoldDershowitz, //!< Reingold & Dershowitz (2001, 2002) algorithm for DeltaT |
631 | + MorrisonStephenson2004, //!< Morrison & Stephenson (2004, 2005) algorithm for DeltaT |
632 | + Reijs, //!< Reijs (2006) algorithm for DeltaT |
633 | + EspenakMeeus, //!< Espenak & Meeus (2006) algorithm for DeltaT |
634 | + Custom //!< User defined coefficients for quadratic equation for DeltaT |
635 | + }; |
636 | + |
637 | StelCore(); |
638 | virtual ~StelCore(); |
639 | |
640 | @@ -230,6 +265,18 @@ |
641 | QString getStartupTimeMode(); |
642 | void setStartupTimeMode(const QString& s); |
643 | |
644 | + //! Get Delta-T estimation for a given date. |
645 | + //! @param jDay the date and time expressed as a julian day |
646 | + //! @return Delta-T in seconds |
647 | + //! @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 |
648 | + double getDeltaT(double jDay); |
649 | + |
650 | + //! Get info about valid range for current algorithm for calculation of Delta-T |
651 | + //! @param jDay the JD |
652 | + //! @param marker the marker for valid range |
653 | + //! @return valid range |
654 | + QString getCurrentDeltaTAlgorithmValigRange(double jDay, QString* marker) const; |
655 | + |
656 | public slots: |
657 | //! Set the current ProjectionType to use |
658 | void setCurrentProjectionType(ProjectionType type); |
659 | @@ -243,6 +290,17 @@ |
660 | //! Get the list of all the available projections |
661 | QStringList getAllProjectionTypeKeys() const; |
662 | |
663 | + //! Set the current algorithm for time correction (DeltaT) |
664 | + void setCurrentDeltaTAlgorithm(DeltaTAlgorithm algorithm) { currentDeltaTAlgorithm=algorithm; } |
665 | + //! Get the current algorithm for time correction (DeltaT) |
666 | + DeltaTAlgorithm getCurrentDeltaTAlgorithm() const { return currentDeltaTAlgorithm; } |
667 | + //! Get description of the current algorithm for time correction |
668 | + QString getCurrentDeltaTAlgorithmDescription(void) const; |
669 | + //! Get the current algorithm used by the DeltaT |
670 | + QString getCurrentDeltaTAlgorithmKey(void) const; |
671 | + //! Set the current algorithm to use from its key |
672 | + void setCurrentDeltaTAlgorithmKey(QString type); |
673 | + |
674 | //! Set the mask type. |
675 | void setMaskType(StelProjector::StelProjectorMaskType m); |
676 | |
677 | @@ -425,6 +483,23 @@ |
678 | //! the selected object is of the correct type - i.e. a planet. |
679 | void moveObserverToSelected(); |
680 | |
681 | + //! Set year for custom equation for calculation of Delta-T |
682 | + //! @param y the year, e.g. 1820 |
683 | + void setCustomYear(float y) { customYear=y; } |
684 | + //! Set n-dot for custom equation for calculation of Delta-T |
685 | + //! @param y the n-dot value, e.g. -26.0 |
686 | + void setCustomNDot(float v) { customNDot=v; } |
687 | + //! Set coefficients for custom equation for calculation of Delta-T |
688 | + //! @param y the coefficients, e.g. -20,0,32 |
689 | + void setCustomEquationCoefficients(Vec3f c) { customEquationCoeff=c; } |
690 | + |
691 | + //! Get year for custom equation for calculation of Delta-T |
692 | + float getCustomYear() { return customYear; } |
693 | + //! Get n-dot for custom equation for calculation of Delta-T |
694 | + float getCustomNDot() { return customNDot; } |
695 | + //! Get coefficients for custom equation for calculation of Delta-T |
696 | + Vec3f getCustomEquationCoefficients() { return customEquationCoeff; } |
697 | + |
698 | signals: |
699 | //! This signal is emitted when the observer location has changed. |
700 | void locationChanged(StelLocation); |
701 | @@ -442,6 +517,9 @@ |
702 | // The currently used projection type |
703 | ProjectionType currentProjectionType; |
704 | |
705 | + // The currentrly used time correction (DeltaT) |
706 | + DeltaTAlgorithm currentDeltaTAlgorithm; |
707 | + |
708 | // Parameters to use when creating new instances of StelProjector |
709 | StelProjector::StelProjectorParams currentProjectorParams; |
710 | |
711 | @@ -472,6 +550,12 @@ |
712 | double presetSkyTime; |
713 | QTime initTodayTime; |
714 | QString startupTimeMode; |
715 | + |
716 | + // Variables for custom equation of Delta-T |
717 | + Vec3f customEquationCoeff; |
718 | + float customNDot; |
719 | + float customYear; |
720 | + |
721 | }; |
722 | |
723 | #endif // _STELCORE_HPP_ |
724 | |
725 | === modified file 'src/core/StelObserver.cpp' |
726 | --- src/core/StelObserver.cpp 2013-01-27 19:19:38 +0000 |
727 | +++ src/core/StelObserver.cpp 2013-02-17 21:34:20 +0000 |
728 | @@ -208,7 +208,7 @@ |
729 | // Apply DeltaT correction only for Earth |
730 | double deltaT = 0.; |
731 | if (getHomePlanet()->getEnglishName()=="Earth") |
732 | - deltaT = StelUtils::getDeltaT(jd)/240.; |
733 | + deltaT = StelApp::getInstance().getCore()->getDeltaT(jd)/240.; |
734 | return Mat4d::zrotation((getHomePlanet()->getSiderealTime(jd)+currentLocation.longitude-deltaT)*M_PI/180.) |
735 | * Mat4d::yrotation((90.-lat)*M_PI/180.); |
736 | } |
737 | |
738 | === modified file 'src/core/StelUtils.cpp' |
739 | --- src/core/StelUtils.cpp 2013-02-08 16:40:32 +0000 |
740 | +++ src/core/StelUtils.cpp 2013-02-17 21:34:20 +0000 |
741 | @@ -1065,8 +1065,8 @@ |
742 | QString hoursToHmsStr(double hours) |
743 | { |
744 | int h = (int)hours; |
745 | - int m = (int)((hours-h)*60); |
746 | - float s = (((hours-h)*60)-m)*60; |
747 | + int m = (int)((std::abs(hours)-std::abs(h))*60); |
748 | + float s = (((std::abs(hours)-std::abs(h))*60)-m)*60; |
749 | |
750 | return QString("%1h%2m%3s").arg(h).arg(m).arg(QString::number(s, 'f', 1)); |
751 | } |
752 | @@ -1195,26 +1195,547 @@ |
753 | return r; |
754 | } |
755 | |
756 | -double getDeltaT(double jDay) |
757 | +// Implementation algorithm by Espenak & Meeus (2006) for DeltaT computation |
758 | +double getDeltaTByEspenakMeeus(double jDay) |
759 | { |
760 | - int year, month, day; |
761 | - double moon = 0.; |
762 | + int year, month, day; |
763 | getDateFromJulianDay(jDay, &year, &month, &day); |
764 | - if (year<1955 or year>2005) |
765 | - moon = getMoonSecularAcceleration(jDay); |
766 | + |
767 | // approximate "decimal year" = year + (month - 0.5)/12 |
768 | - return decYear2DeltaT(year + (month - 0.5)/12)+moon; |
769 | -} |
770 | - |
771 | -double getMoonSecularAcceleration(double jDay) |
772 | + //return decYear2DeltaT(year + (month - 0.5)/12); |
773 | + return decYear2DeltaT(year+((month-1)*30.5+day/31*30.5)/366); |
774 | +} |
775 | + |
776 | +// Implementation algorithm by Schoch (1931) for DeltaT computation |
777 | +double getDeltaTBySchoch(double jDay) |
778 | +{ |
779 | + // On the system of astronomical constants. |
780 | + // Clemence, G. M. |
781 | + // Astronomical Journal, Vol. 53, p. 169 |
782 | + // 1948AJ.....53..169C [http://adsabs.harvard.edu/abs/1948AJ.....53..169C] |
783 | + int year, month, day; |
784 | + getDateFromJulianDay(jDay, &year, &month, &day); |
785 | + |
786 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
787 | + double u = (yeardec-1800)/100; |
788 | + |
789 | + return -36.28 + 36.28*std::pow(u,2); |
790 | +} |
791 | + |
792 | +// Implementation algorithm by Clemence (1948) for DeltaT computation |
793 | +double getDeltaTByClemence(double jDay) |
794 | +{ |
795 | + // On the system of astronomical constants. |
796 | + // Clemence, G. M. |
797 | + // Astronomical Journal, Vol. 53, p. 169 |
798 | + // 1948AJ.....53..169C [http://adsabs.harvard.edu/abs/1948AJ.....53..169C] |
799 | + int year, month, day; |
800 | + getDateFromJulianDay(jDay, &year, &month, &day); |
801 | + |
802 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
803 | + double u = (yeardec-1900)/100; |
804 | + |
805 | + return +8.72 + 26.75*u + 11.22*std::pow(u,2); |
806 | +} |
807 | + |
808 | +// Implementation algorithm by IAU (1952) for DeltaT computation |
809 | +double getDeltaTByIAU(double jDay) |
810 | +{ |
811 | + int year, month, day; |
812 | + getDateFromJulianDay(jDay, &year, &month, &day); |
813 | + |
814 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
815 | + double u = (yeardec-1900)/100; |
816 | + // TODO: Calculate Moon's longitude fluctuation |
817 | + // Spencer Jones, H., "The Rotation of the Earth, and the Secular Accelerations of the Sun, Moon and Planets", |
818 | + // Monthly Notices of the Royal Astronomical Society, 99 (1939), 541-558 |
819 | + // http://adsabs.harvard.edu/abs/1939MNRAS..99..541S |
820 | + return 24.349+72.3165*u+29.949*std::pow(u,2)/* + 1.821*b*/; |
821 | +} |
822 | + |
823 | +// Implementation algorithm by Astronomical Ephemeris (1960) for DeltaT computation |
824 | +double getDeltaTByAstronomicalEphemeris(double jDay) |
825 | +{ |
826 | + int year, month, day; |
827 | + getDateFromJulianDay(jDay, &year, &month, &day); |
828 | + |
829 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
830 | + double u = (yeardec-1900)/100; |
831 | + // TODO: Calculate Moon's longitude fluctuation |
832 | + // Spencer Jones, H., "The Rotation of the Earth, and the Secular Accelerations of the Sun, Moon and Planets", |
833 | + // Monthly Notices of the Royal Astronomical Society, 99 (1939), 541-558 |
834 | + // http://adsabs.harvard.edu/abs/1939MNRAS..99..541S |
835 | + return 24.349+72.318*u+29.950*std::pow(u,2)/* + 1.82144*b*/; |
836 | +} |
837 | + |
838 | +// Implementation algorithm by Tuckerman (1962, 1964) & Goldstine (1973) for DeltaT computation |
839 | +double getDeltaTByTuckermanGoldstine(double jDay) |
840 | +{ |
841 | + int year, month, day; |
842 | + getDateFromJulianDay(jDay, &year, &month, &day); |
843 | + |
844 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
845 | + double u = (yeardec-1900)/100; |
846 | + |
847 | + return 4.87+35.06*u+36.79*std::pow(u,2); |
848 | +} |
849 | + |
850 | +// Implementation algorithm by Muller & Stephenson (1975) for DeltaT computation |
851 | +double getDeltaTByMullerStephenson(double jDay) |
852 | +{ |
853 | + int year, month, day; |
854 | + getDateFromJulianDay(jDay, &year, &month, &day); |
855 | + |
856 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
857 | + double u = (yeardec-1900)/100; |
858 | + |
859 | + return 66.0+120.38*u+45.78*std::pow(u,2); |
860 | +} |
861 | + |
862 | +// Implementation algorithm by Stephenson (1978) for DeltaT computation |
863 | +double getDeltaTByStephenson1978(double jDay) |
864 | +{ |
865 | + int year, month, day; |
866 | + getDateFromJulianDay(jDay, &year, &month, &day); |
867 | + |
868 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
869 | + double u = (yeardec-1900)/100; |
870 | + |
871 | + return 20.0+114.0*u+38.30*std::pow(u,2); |
872 | +} |
873 | + |
874 | +// Implementation algorithm by Stephenson (1997) for DeltaT computation |
875 | +double getDeltaTByStephenson1997(double jDay) |
876 | +{ |
877 | + int year, month, day; |
878 | + getDateFromJulianDay(jDay, &year, &month, &day); |
879 | + |
880 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
881 | + double u = (yeardec-1735)/100; |
882 | + |
883 | + return -20.0 + 35.0*std::pow(u,2); |
884 | +} |
885 | + |
886 | +// Implementation algorithm by Schmadel & Zech (1979) for DeltaT computation |
887 | +double getDeltaTBySchmadelZech1979(double jDay) |
888 | +{ |
889 | + // Polynomial approximations for the correction delta T E.T.-U.T. in the period 1800-1975 |
890 | + // Schmadel, L. D.; Zech, G. |
891 | + // Acta Astronomica, vol. 29, no. 1, 1979, p. 101-104. |
892 | + // 1979AcA....29..101S [http://adsabs.harvard.edu/abs/1979AcA....29..101S] |
893 | + int year, month, day; |
894 | + getDateFromJulianDay(jDay, &year, &month, &day); |
895 | + |
896 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
897 | + double u = (yeardec-1900)/100; |
898 | + |
899 | + double deltaT = -0.000029 + 0.001233*u + 0.003081*std::pow(u,2) - 0.013867*std::pow(u,3) - 0.020446*std::pow(u,4) + 0.076929*std::pow(u,5) |
900 | + + 0.075456*std::pow(u,6) - 0.200097*std::pow(u,7) - 0.159732*std::pow(u,8) + 0.247433*std::pow(u,9) + 0.185489*std::pow(u,10) |
901 | + - 0.117389*std::pow(u,11) - 0.089491*std::pow(u,12); |
902 | + |
903 | + return deltaT; |
904 | +} |
905 | + |
906 | +// Implementation algorithm by Morrison & Stephenson (1982) for DeltaT computation |
907 | +double getDeltaTByMorrisonStephenson1982(double jDay) |
908 | +{ |
909 | + int year, month, day; |
910 | + getDateFromJulianDay(jDay, &year, &month, &day); |
911 | + |
912 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
913 | + double u = (yeardec-1810)/100; |
914 | + |
915 | + return -15.0+32.50*std::pow(u,2); |
916 | +} |
917 | + |
918 | +// Implementation algorithm by Stephenson & Morrison (1984) for DeltaT computation |
919 | +double getDeltaTByStephensonMorrison1984(double jDay) |
920 | +{ |
921 | + int year, month, day; |
922 | + double deltaT = 0.; |
923 | + getDateFromJulianDay(jDay, &year, &month, &day); |
924 | + |
925 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
926 | + double u = (yeardec-1800)/100; |
927 | + |
928 | + if (-391 < year and year <= 948) |
929 | + deltaT = 1360.0 + 320*u + 44.3*std::pow(u,2); |
930 | + if (948 < year and year <= 1600) |
931 | + deltaT = 25.5*std::pow(u,2); |
932 | + |
933 | + return deltaT; |
934 | +} |
935 | + |
936 | +// Implementation algorithm by Stephenson & Morrison (1995) for DeltaT computation |
937 | +double getDeltaTByStephensonMorrison1995(double jDay) |
938 | +{ |
939 | + int year, month, day; |
940 | + getDateFromJulianDay(jDay, &year, &month, &day); |
941 | + |
942 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
943 | + double u = (yeardec-1820)/100; |
944 | + |
945 | + |
946 | + return -20.0 + 31.0*std::pow(u,2); |
947 | +} |
948 | + |
949 | +// Implementation algorithm by Stephenson & Houlden (1986) for DeltaT computation |
950 | +double getDeltaTByStephensonHoulden(double jDay) |
951 | +{ |
952 | + int year, month, day; |
953 | + double u; |
954 | + double deltaT = 0.; |
955 | + getDateFromJulianDay(jDay, &year, &month, &day); |
956 | + |
957 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
958 | + |
959 | + if (year <= 948) |
960 | + { |
961 | + u = (yeardec-948)/100; |
962 | + deltaT = 1830.0 - 405.0*u + 46.5*std::pow(u,2); |
963 | + } |
964 | + if (948 < year and year <= 1600) |
965 | + { |
966 | + u = (yeardec-1850)/100; |
967 | + deltaT = 25.5*std::pow(u,2); |
968 | + } |
969 | + |
970 | + return deltaT; |
971 | +} |
972 | + |
973 | +// Implementation algorithm by Espenak (1987, 1989) for DeltaT computation |
974 | +// This relation should not be used before around 1950 or after around 2100 (Espenak, pers. comm.). |
975 | +double getDeltaTByEspenak(double jDay) |
976 | +{ |
977 | + int year, month, day; |
978 | + getDateFromJulianDay(jDay, &year, &month, &day); |
979 | + |
980 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
981 | + double u = (yeardec-2000)/100; |
982 | + |
983 | + return 67.0+61.0*u + 64.3*std::pow(u,2); |
984 | +} |
985 | + |
986 | +// Implementation algorithm by Borkowski (1988) for DeltaT computation |
987 | +double getDeltaTByBorkowski(double jDay) |
988 | +{ |
989 | + // ELP 2000-85 and the dynamic time-universal time relation |
990 | + // Borkowski, K. M. |
991 | + // Astronomy and Astrophysics (ISSN 0004-6361), vol. 205, no. 1-2, Oct. 1988, p. L8-L10. |
992 | + // 1988A&A...205L...8B [http://adsabs.harvard.edu/abs/1988A&A...205L...8B] |
993 | + int year, month, day; |
994 | + getDateFromJulianDay(jDay, &year, &month, &day); |
995 | + |
996 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
997 | + double u = (yeardec-1625)/100; |
998 | + |
999 | + return 40.0 + 35.0*std::pow(u,2); |
1000 | +} |
1001 | + |
1002 | +// Implementation algorithm by Schmadel & Zech (1988) for DeltaT computation |
1003 | +double getDeltaTBySchmadelZech1988(double jDay) |
1004 | +{ |
1005 | + // Empirical Transformations from U.T. to E.T. for the Period 1800-1988 |
1006 | + // Schmadel, L. D.; Zech, G. |
1007 | + // Astronomische Nachrichten 309, 219-221 |
1008 | + // 1988AN....309..219S [http://adsabs.harvard.edu/abs/1988AN....309..219S] |
1009 | + int year, month, day; |
1010 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1011 | + |
1012 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1013 | + double u = (yeardec-1900)/100; |
1014 | + |
1015 | + double deltaT = -0.000014 + 0.001148*u + 0.003357*std::pow(u,2) - 0.012462*std::pow(u,3) - 0.022542*std::pow(u,4) + 0.062971*std::pow(u,5) |
1016 | + + 0.079441*std::pow(u,6) - 0.146960*std::pow(u,7) - 0.149279*std::pow(u,8) + 0.161416*std::pow(u,9) + 0.145932*std::pow(u,10) |
1017 | + - 0.067471*std::pow(u,11) - 0.058091*std::pow(u,12); |
1018 | + |
1019 | + return deltaT; |
1020 | +} |
1021 | + |
1022 | +// Implementation algorithm by Chapront-Touzé & Chapront (1991) for DeltaT computation |
1023 | +double getDeltaTByChaprontTouze(double jDay) |
1024 | +{ |
1025 | + int year, month, day; |
1026 | + double deltaT = 0.; |
1027 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1028 | + |
1029 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1030 | + double u = (yeardec-2000)/100; |
1031 | + |
1032 | + if (-391 < year and year <= 948) |
1033 | + deltaT = 2177.0 - 495.0*u + 42.4*std::pow(u,2); |
1034 | + if (948 < year and year <= 1600) |
1035 | + deltaT = 102.0 + 100.0*u + 23.6*std::pow(u,2); |
1036 | + |
1037 | + return deltaT; |
1038 | +} |
1039 | + |
1040 | +// Implementation algorithm by Chapront, Chapront-Touzé & Francou (1997) for DeltaT computation |
1041 | +double getDeltaTByChaprontFrancou(double jDay) |
1042 | +{ |
1043 | + int year, month, day; |
1044 | + double deltaT = 0.; |
1045 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1046 | + |
1047 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1048 | + double u = (yeardec-2000)/100; |
1049 | + |
1050 | + if (year <= 948) |
1051 | + deltaT = 2177.0 - 497.0*u + 44.1*std::pow(u,2); |
1052 | + if (948 < year and year <= 1600) |
1053 | + deltaT = 102.0 + 102.0*u + 25.3*std::pow(u,2); |
1054 | + if (2000 < year and year <= 2100) |
1055 | + deltaT = 102.0 + 102.0*u + 25.3*std::pow(u,2) + 0.37*(year - 2100); |
1056 | + |
1057 | + return deltaT; |
1058 | +} |
1059 | + |
1060 | +// Implementation algorithm by JPL Horizons for DeltaT computation |
1061 | +double getDeltaTByJPLHorizons(double jDay) |
1062 | +{ |
1063 | + int year, month, day; |
1064 | + double u; |
1065 | + double deltaT = 0.; |
1066 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1067 | + |
1068 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1069 | + |
1070 | + if (-2999 < year and year < 948) |
1071 | + { |
1072 | + u = (yeardec-1820)/100; |
1073 | + deltaT = 31.0*std::pow(u,2); |
1074 | + } |
1075 | + if (948 < year and year <= 1620) |
1076 | + { |
1077 | + u = (yeardec-2000)/100; |
1078 | + deltaT = 50.6 + 67.5*u + 22.5*std::pow(u,2); |
1079 | + } |
1080 | + |
1081 | + return deltaT; |
1082 | +} |
1083 | + |
1084 | +// Implementation algorithm by Morrison & Stephenson (2004, 2005) for DeltaT computation |
1085 | +double getDeltaTByMorrisonStephenson2004(double jDay) |
1086 | +{ |
1087 | + // Historical values of the Earth's clock error ΔT and the calculation of eclipses |
1088 | + // Morrison, L. V.; Stephenson, F. R. |
1089 | + // Journal for the History of Astronomy (ISSN 0021-8286), Vol. 35, Part 3, No. 120, p. 327 - 336 (2004) |
1090 | + // 2004JHA....35..327M [http://adsabs.harvard.edu/abs/2004JHA....35..327M] |
1091 | + // |
1092 | + // Addendum: Historical values of the Earth's clock error |
1093 | + // Morrison, L. V.; Stephenson, F. R. |
1094 | + // Journal for the History of Astronomy (ISSN 0021-8286), Vol. 36, Part 3, No. 124, p. 339 (2005) |
1095 | + // 2005JHA....36..339M [http://adsabs.harvard.edu/abs/2005JHA....36..339M] |
1096 | + int year, month, day; |
1097 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1098 | + |
1099 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1100 | + double u = (yeardec-1820)/100; |
1101 | + |
1102 | + return -20.0 + 32.0 * std::pow(u, 2); |
1103 | +} |
1104 | + |
1105 | +// Implementation algorithm by Reijs (2006) for DeltaT computation |
1106 | +double getDeltaTByReijs(double jDay) |
1107 | +{ |
1108 | + int year, month, day; |
1109 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1110 | + double OffSetYear = (2385800 - jDay)/365.25; |
1111 | + |
1112 | + return ((1.8 * std::pow(OffSetYear,2)/200 + 1443*3.76/(2*M_PI)*(std::cos(2*M_PI*OffSetYear/1443)-1))*365.25)/1000; |
1113 | +} |
1114 | + |
1115 | +// Implementation algorithm by Meeus (1998) for DeltaT computation |
1116 | +double getDeltaTByMeeus(double jDay) |
1117 | +{ |
1118 | + int year, month, day; |
1119 | + double deltaT = 0.; |
1120 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1121 | + |
1122 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1123 | + double u = (yeardec-1900)/100; |
1124 | + |
1125 | + if (1800 <= year and year < 1900) |
1126 | + deltaT = -2.50 + 228.95*u + 5218.61*std::pow(u,2) + 56282.84*std::pow(u,3) + 324011.78*std::pow(u,4) + 1061660.75*std::pow(u,5) |
1127 | + + 2087298.89*std::pow(u,6) + 2513807.78*std::pow(u,7) + 1818961.41*std::pow(u,8) + 727058.63*std::pow(u,9) + 58353.42*std::pow(u,10); |
1128 | + |
1129 | + if (1900 <= year and year < 1997) |
1130 | + deltaT = -2.44 + 87.24*u + 815.20*std::pow(u,2) - 2637.80*std::pow(u,3) - 18756.33*std::pow(u,4) + 124906.15*std::pow(u,5) |
1131 | + -303191.19*std::pow(u,6) + 372919.88*std::pow(u,7) - 232424.66*std::pow(u,8) + 58353.42*std::pow(u,9); |
1132 | + |
1133 | + return deltaT; |
1134 | +} |
1135 | + |
1136 | +// Implementation algorithm by Montenbruck & Pfleger (2000) for DeltaT computation |
1137 | +double getDeltaTByMontenbruckPfleger(double jDay) |
1138 | +{ |
1139 | + int year, month, day; |
1140 | + double u; |
1141 | + double deltaT = 0.; |
1142 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1143 | + |
1144 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1145 | + |
1146 | + if (1825 <= year and year < 1850) |
1147 | + { |
1148 | + u = (yeardec-1825)/100; |
1149 | + deltaT = +10.4 - 80.8*u + 413.9*std::pow(u,2) - 572.3*std::pow(u,3); |
1150 | + } |
1151 | + if (1850 <= year and year < 1875) |
1152 | + { |
1153 | + u = (yeardec-1850)/100; |
1154 | + deltaT = +6.6 + 46.3*u - 358.4*std::pow(u,2) + 18.8*std::pow(u,3); |
1155 | + } |
1156 | + if (1875 <= year and year < 1900) |
1157 | + { |
1158 | + u = (yeardec-1875)/100; |
1159 | + deltaT = -3.9 - 10.8*u - 166.2*std::pow(u,2) + 867.4*std::pow(u,3); |
1160 | + } |
1161 | + if (1900 <= year and year < 1925) |
1162 | + { |
1163 | + u = (yeardec-1900)/100; |
1164 | + deltaT = -2.6 + 114.1*u + 327.5*std::pow(u,2) - 1467.4*std::pow(u,3); |
1165 | + } |
1166 | + if (1925 <= year and year < 1950) |
1167 | + { |
1168 | + u = (yeardec-1925)/100; |
1169 | + deltaT = +24.2 - 6.3*u - 8.2*std::pow(u,2) + 483.4*std::pow(u,3); |
1170 | + } |
1171 | + if (1950 <= year and year < 1975) |
1172 | + { |
1173 | + u = (yeardec-1950)/100; |
1174 | + deltaT = +29.3 + 32.5*u - 3.8*std::pow(u,2) + 550.7*std::pow(u,3); |
1175 | + } |
1176 | + if (1975 <= year and year <= 2000) |
1177 | + { |
1178 | + u = (yeardec-1975)/100; |
1179 | + deltaT = +45.3 + 130.5*u - 570.5*std::pow(u,2) + 1516.7*std::pow(u,3); |
1180 | + } |
1181 | + |
1182 | + return deltaT; |
1183 | +} |
1184 | + |
1185 | +// Implementation algorithm by Meeus & Simons (2000) for DeltaT computation |
1186 | +double getDeltaTByMeeusSimons(double jDay) |
1187 | +{ |
1188 | + // Polynomial approximations to Delta T, 1620-2000 AD |
1189 | + // Meeus, J.; Simons, L. |
1190 | + // Journal of the British Astronomical Association, vol.110, no.6, 323 |
1191 | + // 2000JBAA..110..323M [http://adsabs.harvard.edu/abs/2000JBAA..110..323M] |
1192 | + int year, month, day; |
1193 | + double u; |
1194 | + double deltaT = 0.; |
1195 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1196 | + |
1197 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1198 | + double ub = (yeardec-2000)/100; |
1199 | + |
1200 | + if (1620 <= year and year < 1690) |
1201 | + { |
1202 | + u = 3.45 + ub; |
1203 | + deltaT = +40.3 - 107.0*u + 50.0*std::pow(u,2) - 454.0*std::pow(u,3) + 1244.0*std::pow(u,4); |
1204 | + } |
1205 | + if (1690 <= year and year < 1770) |
1206 | + { |
1207 | + u = 2.70 + ub; |
1208 | + deltaT = +10.2 + 11.3*u - std::pow(u,2) - 16.0*std::pow(u,3) + 70.0*std::pow(u,4); |
1209 | + } |
1210 | + if (1770 <= year and year < 1820) |
1211 | + { |
1212 | + u = 2.05 + ub; |
1213 | + deltaT = +14.7 - 18.8*u - 22.0*std::pow(u,2) + 173.0*std::pow(u,3) + 6.0*std::pow(u,4); |
1214 | + } |
1215 | + if (1820 <= year and year < 1870) |
1216 | + { |
1217 | + u = 1.55 + ub; |
1218 | + deltaT = +5.7 + 12.7*u + 111.0*std::pow(u,2) - 534.0*std::pow(u,3) + 1654.0*std::pow(u,4); |
1219 | + } |
1220 | + if (1870 <= year and year < 1900) |
1221 | + { |
1222 | + u = 1.15 + ub; |
1223 | + deltaT = -5.8 - 14.6*u + 27.0*std::pow(u,2) + 101.0*std::pow(u,3) + 8234.0*std::pow(u,4); |
1224 | + } |
1225 | + if (1900 <= year and year < 1940) |
1226 | + { |
1227 | + u = 0.80 + ub; |
1228 | + deltaT = +21.4 + 67.0*u + 443.0*std::pow(u,2) + 19.0*std::pow(u,3) + 4441.0*std::pow(u,4); |
1229 | + } |
1230 | + if (1940 <= year and year < 1990) |
1231 | + { |
1232 | + u = 0.35 + ub; |
1233 | + deltaT = +36.2 + 74.0*u + 189.0*std::pow(u,2) - 140.0*std::pow(u,3) - 1883.0*std::pow(u,4); |
1234 | + } |
1235 | + if (1900 <= year and year <= 2000) |
1236 | + { |
1237 | + u = 0.05 + ub; |
1238 | + deltaT = +60.8 + 82.0*u + 188.0*std::pow(u,2) - 5034.0*std::pow(u,3); |
1239 | + } |
1240 | + |
1241 | + return deltaT; |
1242 | +} |
1243 | + |
1244 | +// Implementation algorithm by Reingold & Dershowitz (2001, 2002) for DeltaT computation |
1245 | +double getDeltaTByReingoldDershowitz(double jDay) |
1246 | +{ |
1247 | + int year, month, day; |
1248 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1249 | + |
1250 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1251 | + double u = (yeardec-1810)/100;; |
1252 | + double deltaT = -15.0 + 32.5*std::pow(u,2); |
1253 | + |
1254 | + if (1620 <= year and year < 1800) |
1255 | + { |
1256 | + u = (yeardec-1600)/100; |
1257 | + deltaT = +196.58333 - 406.75*u + 219.167*std::pow(u,2); |
1258 | + } |
1259 | + if (1800 <= year and year < 1900) |
1260 | + { |
1261 | + u = (yeardec-1900)/100; |
1262 | + deltaT = (-0.000009 + 0.003844*u + 0.083563*std::pow(u,2) + 0.865736*std::pow(u,3) + 4.867575*std::pow(u,4) + 15.845535*std::pow(u,5) |
1263 | + + 31.332267*std::pow(u,6) + 38.291999*std::pow(u,7) + 28.316289*std::pow(u,8) + 11.636204*std::pow(u,9) + 2.043794*std::pow(u,10))*86400; |
1264 | + } |
1265 | + if (1900 <= year and year < 1987) |
1266 | + { |
1267 | + u = (yeardec-1900)/100; |
1268 | + deltaT = (-0.00002 + 0.000297*u + 0.025184*std::pow(u,2) - 0.181133*std::pow(u,3) + 0.553040*std::pow(u,4) - 0.861938*std::pow(u,5) + 0.677066*std::pow(u,6) - 0.212591*std::pow(u,7))*86400; |
1269 | + } |
1270 | + if (1987 <= year and year < 2019) |
1271 | + { |
1272 | + u = (yeardec-1933)/100; |
1273 | + deltaT = 100.0*u; |
1274 | + } |
1275 | + |
1276 | + return deltaT; |
1277 | +} |
1278 | + |
1279 | +double getMoonSecularAcceleration(double jDay, double nd) |
1280 | { |
1281 | // Method described is here: http://eclipse.gsfc.nasa.gov/SEcat5/secular.html |
1282 | // For adapting from -26 to -25.858, use -0.91072 * (-25.858 + 26.0) = -0.12932224 |
1283 | - // For adapting from -26 to -23.895, use -0.91072 * (-23.895 + 26.0) = -1.9170656 |
1284 | - int year, month, day; |
1285 | - getDateFromJulianDay(jDay, &year, &month, &day); |
1286 | - double t = (year-1955)/100; |
1287 | - return -0.12932224 * t * t; |
1288 | + // For adapting from -26 to -23.895, use -0.91072 * (-23.895 + 26.0) = -1.9170656 |
1289 | + int year, month, day; |
1290 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1291 | + |
1292 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1293 | + double t = (yeardec-1955.5)/100; |
1294 | + // n.dot for secular acceleration of the Moon in ELP2000-82B |
1295 | + // have value -23.8946 "/cy/cy |
1296 | + return -0.91072 * (-23.8946 + std::abs(nd))*std::pow(t, 2); |
1297 | +} |
1298 | + |
1299 | +double getDeltaTStandardError(double jDay) |
1300 | +{ |
1301 | + int year, month, day; |
1302 | + getDateFromJulianDay(jDay, &year, &month, &day); |
1303 | + |
1304 | + double yeardec=year+((month-1)*30.5+day/31*30.5)/366; |
1305 | + double sigma = -1.; |
1306 | + |
1307 | + if (-1000 <= year and year <= 1600) |
1308 | + sigma = 0.8 * std::pow((yeardec-1820.0)/100,2); // sigma(DeltaT) = 0.8*u^2 |
1309 | + |
1310 | + return sigma; |
1311 | } |
1312 | |
1313 | } // end of the StelUtils namespace |
1314 | |
1315 | === modified file 'src/core/StelUtils.hpp' |
1316 | --- src/core/StelUtils.hpp 2013-02-08 16:40:32 +0000 |
1317 | +++ src/core/StelUtils.hpp 2013-02-17 21:34:20 +0000 |
1318 | @@ -293,13 +293,172 @@ |
1319 | //! Get Delta-T estimation for a given date. |
1320 | //! Note that this method is valid for the year range: |
1321 | //! -1999 to +3000, outside of which "0" will be returned. |
1322 | - //! @param jDay the date and time expressed as a julian day |
1323 | - //! @return Delta-T in seconds |
1324 | - double getDeltaT(double jDay); |
1325 | + //! Implementation algorithm by Espenak & Meeus (2006) for DeltaT computation |
1326 | + //! @param jDay the date and time expressed as a julian day |
1327 | + //! @return Delta-T in seconds |
1328 | + double getDeltaTByEspenakMeeus(double jDay); |
1329 | + |
1330 | + //! Get Delta-T estimation for a given date. |
1331 | + //! Implementation algorithm by Schoch (1931) for DeltaT computation |
1332 | + //! @param jDay the date and time expressed as a julian day |
1333 | + //! @return Delta-T in seconds |
1334 | + double getDeltaTBySchoch(double jDay); |
1335 | + |
1336 | + //! Get Delta-T estimation for a given date. |
1337 | + //! Implementation algorithm by Clemence (1948) for DeltaT computation |
1338 | + //! @param jDay the date and time expressed as a julian day |
1339 | + //! @return Delta-T in seconds |
1340 | + double getDeltaTByClemence(double jDay); |
1341 | + |
1342 | + //! Get Delta-T estimation for a given date. |
1343 | + //! Implementation algorithm by IAU (1952) for DeltaT computation |
1344 | + //! @param jDay the date and time expressed as a julian day |
1345 | + //! @return Delta-T in seconds |
1346 | + double getDeltaTByIAU(double jDay); |
1347 | + |
1348 | + //! Get Delta-T estimation for a given date. |
1349 | + //! Implementation algorithm by Astronomical Ephemeris (1960) for DeltaT computation |
1350 | + //! @param jDay the date and time expressed as a julian day |
1351 | + //! @return Delta-T in seconds |
1352 | + double getDeltaTByAstronomicalEphemeris(double jDay); |
1353 | + |
1354 | + //! Get Delta-T estimation for a given date. |
1355 | + //! Implementation algorithm by Tuckerman (1962, 1964) & Goldstine (1973) for DeltaT computation |
1356 | + //! @param jDay the date and time expressed as a julian day |
1357 | + //! @return Delta-T in seconds |
1358 | + double getDeltaTByTuckermanGoldstine(double jDay); |
1359 | + |
1360 | + //! Get Delta-T estimation for a given date. |
1361 | + //! Implementation algorithm by Muller & Stephenson (1975) for DeltaT computation |
1362 | + //! @param jDay the date and time expressed as a julian day |
1363 | + //! @return Delta-T in seconds |
1364 | + double getDeltaTByMullerStephenson(double jDay); |
1365 | + |
1366 | + //! Get Delta-T estimation for a given date. |
1367 | + //! Implementation algorithm by Stephenson (1978) for DeltaT computation |
1368 | + //! @param jDay the date and time expressed as a julian day |
1369 | + //! @return Delta-T in seconds |
1370 | + double getDeltaTByStephenson1978(double jDay); |
1371 | + |
1372 | + //! Get Delta-T estimation for a given date. |
1373 | + //! Implementation algorithm by Stephenson (1997) for DeltaT computation |
1374 | + //! @param jDay the date and time expressed as a julian day |
1375 | + //! @return Delta-T in seconds |
1376 | + double getDeltaTByStephenson1997(double jDay); |
1377 | + |
1378 | + //! Get Delta-T estimation for a given date. |
1379 | + //! Implementation algorithm by Schmadel & Zech (1979) for DeltaT computation |
1380 | + //! @param jDay the date and time expressed as a julian day |
1381 | + //! @return Delta-T in seconds |
1382 | + double getDeltaTBySchmadelZech1979(double jDay); |
1383 | + |
1384 | + //! Get Delta-T estimation for a given date. |
1385 | + //! Implementation algorithm by Morrison & Stephenson (1982) for DeltaT computation |
1386 | + //! @param jDay the date and time expressed as a julian day |
1387 | + //! @return Delta-T in seconds |
1388 | + double getDeltaTByMorrisonStephenson1982(double jDay); |
1389 | + |
1390 | + //! Get Delta-T estimation for a given date. |
1391 | + //! Implementation algorithm by Stephenson & Morrison (1984) for DeltaT computation |
1392 | + //! @param jDay the date and time expressed as a julian day |
1393 | + //! @return Delta-T in seconds |
1394 | + double getDeltaTByStephensonMorrison1984(double jDay); |
1395 | + |
1396 | + //! Get Delta-T estimation for a given date. |
1397 | + //! Implementation algorithm by Stephenson & Morrison (1995) for DeltaT computation |
1398 | + //! @param jDay the date and time expressed as a julian day |
1399 | + //! @return Delta-T in seconds |
1400 | + double getDeltaTByStephensonMorrison1995(double jDay); |
1401 | + |
1402 | + //! Get Delta-T estimation for a given date. |
1403 | + //! Implementation algorithm by Stephenson & Houlden (1986) for DeltaT computation |
1404 | + //! @param jDay the date and time expressed as a julian day |
1405 | + //! @return Delta-T in seconds |
1406 | + double getDeltaTByStephensonHoulden(double jDay); |
1407 | + |
1408 | + //! Get Delta-T estimation for a given date. |
1409 | + //! Implementation algorithm by Espenak (1987, 1989) for DeltaT computation |
1410 | + //! @param jDay the date and time expressed as a julian day |
1411 | + //! @return Delta-T in seconds |
1412 | + double getDeltaTByEspenak(double jDay); |
1413 | + |
1414 | + //! Get Delta-T estimation for a given date. |
1415 | + //! Implementation algorithm by Borkowski (1988) for DeltaT computation |
1416 | + //! @param jDay the date and time expressed as a julian day |
1417 | + //! @return Delta-T in seconds |
1418 | + double getDeltaTByBorkowski(double jDay); |
1419 | + |
1420 | + //! Get Delta-T estimation for a given date. |
1421 | + //! Implementation algorithm by Schmadel & Zech (1988) for DeltaT computation |
1422 | + //! @param jDay the date and time expressed as a julian day |
1423 | + //! @return Delta-T in seconds |
1424 | + double getDeltaTBySchmadelZech1988(double jDay); |
1425 | + |
1426 | + //! Get Delta-T estimation for a given date. |
1427 | + //! Implementation algorithm by Chapront-Touzé & Chapront (1991) for DeltaT computation |
1428 | + //! @param jDay the date and time expressed as a julian day |
1429 | + //! @return Delta-T in seconds |
1430 | + double getDeltaTByChaprontTouze(double jDay); |
1431 | + |
1432 | + //! Get Delta-T estimation for a given date. |
1433 | + //! Implementation algorithm by Chapront, Chapront-Touzé & Francou (1997) for DeltaT computation |
1434 | + //! @param jDay the date and time expressed as a julian day |
1435 | + //! @return Delta-T in seconds |
1436 | + double getDeltaTByChaprontFrancou(double jDay); |
1437 | + |
1438 | + //! Get Delta-T estimation for a given date. |
1439 | + //! Implementation algorithm by JPL Horizons for DeltaT computation |
1440 | + //! @param jDay the date and time expressed as a julian day |
1441 | + //! @return Delta-T in seconds |
1442 | + double getDeltaTByJPLHorizons(double jDay); |
1443 | + |
1444 | + //! Get Delta-T estimation for a given date. |
1445 | + //! Implementation algorithm by Morrison & Stephenson (2004, 2005) for DeltaT computation |
1446 | + //! @param jDay the date and time expressed as a julian day |
1447 | + //! @return Delta-T in seconds |
1448 | + double getDeltaTByMorrisonStephenson2004(double jDay); |
1449 | + |
1450 | + //! Get Delta-T estimation for a given date. |
1451 | + //! Implementation algorithm by Reijs (2006) for DeltaT computation |
1452 | + //! @param jDay the date and time expressed as a julian day |
1453 | + //! @return Delta-T in seconds |
1454 | + double getDeltaTByReijs(double jDay); |
1455 | + |
1456 | + //! Get Delta-T estimation for a given date. |
1457 | + //! Implementation algorithm by Meeus (1998) for DeltaT computation |
1458 | + //! @param jDay the date and time expressed as a julian day |
1459 | + //! @return Delta-T in seconds |
1460 | + double getDeltaTByMeeus(double jDay); |
1461 | + |
1462 | + //! Get Delta-T estimation for a given date. |
1463 | + //! Implementation algorithm by Meeus & Simons (2000) for DeltaT computation |
1464 | + //! @param jDay the date and time expressed as a julian day |
1465 | + //! @return Delta-T in seconds |
1466 | + double getDeltaTByMeeusSimons(double jDay); |
1467 | + |
1468 | + //! Get Delta-T estimation for a given date. |
1469 | + //! Implementation algorithm by Montenbruck & Pfleger (2000) for DeltaT computation |
1470 | + //! @param jDay the date and time expressed as a julian day |
1471 | + //! @return Delta-T in seconds |
1472 | + double getDeltaTByMontenbruckPfleger(double jDay); |
1473 | + |
1474 | + //! Get Delta-T estimation for a given date. |
1475 | + //! Implementation algorithm by Reingold & Dershowitz (2001, 2002) for DeltaT computation |
1476 | + //! @param jDay the date and time expressed as a julian day |
1477 | + //! @return Delta-T in seconds |
1478 | + double getDeltaTByReingoldDershowitz(double jDay); |
1479 | + |
1480 | //! Get Secular Acceleration estimation for a given year. |
1481 | //! @param jDay the JD |
1482 | + //! @param ndot value n-dot which use in the algorithm |
1483 | //! @return SecularAcceleration in seconds |
1484 | - double getMoonSecularAcceleration(double jDay); |
1485 | + //! @note n-dot for secular acceleration of the Moon in ELP2000-82B have value -23.8946 "/cy/cy |
1486 | + double getMoonSecularAcceleration(double jDay, double ndot); |
1487 | + |
1488 | + //! Get the standard error (sigma) for the value of DeltaT |
1489 | + //! @param jDay the JD |
1490 | + //! @return sigma in seconds |
1491 | + double getDeltaTStandardError(double jDay); |
1492 | } |
1493 | |
1494 | #endif // _STELUTILS_HPP_ |
1495 | |
1496 | === modified file 'src/gui/ConfigurationDialog.cpp' |
1497 | --- src/gui/ConfigurationDialog.cpp 2012-10-03 20:25:38 +0000 |
1498 | +++ src/gui/ConfigurationDialog.cpp 2013-02-17 21:34:20 +0000 |
1499 | @@ -21,6 +21,7 @@ |
1500 | |
1501 | #include "Dialog.hpp" |
1502 | #include "ConfigurationDialog.hpp" |
1503 | +#include "CustomDeltaTEquationDialog.hpp" |
1504 | #include "StelMainGraphicsView.hpp" |
1505 | #include "StelMainWindow.hpp" |
1506 | #include "ui_configurationDialog.h" |
1507 | @@ -60,10 +61,12 @@ |
1508 | #include <QDebug> |
1509 | #include <QFile> |
1510 | #include <QFileDialog> |
1511 | +#include <QComboBox> |
1512 | |
1513 | ConfigurationDialog::ConfigurationDialog(StelGui* agui) : StelDialog(agui), starCatalogDownloadReply(NULL), currentDownloadFile(NULL), progressBar(NULL), gui(agui) |
1514 | { |
1515 | ui = new Ui_configurationDialogForm; |
1516 | + customDeltaTEquationDialog = NULL; |
1517 | hasDownloadedStarCatalog = false; |
1518 | isDownloadingStarCatalog = false; |
1519 | savedProjectionType = StelApp::getInstance().getCore()->getCurrentProjectionType(); |
1520 | @@ -72,7 +75,9 @@ |
1521 | ConfigurationDialog::~ConfigurationDialog() |
1522 | { |
1523 | delete ui; |
1524 | - ui = 0; |
1525 | + ui = NULL; |
1526 | + delete customDeltaTEquationDialog; |
1527 | + customDeltaTEquationDialog = NULL; |
1528 | } |
1529 | |
1530 | void ConfigurationDialog::retranslate() |
1531 | @@ -99,6 +104,8 @@ |
1532 | |
1533 | //Plug-in information |
1534 | populatePluginsList(); |
1535 | + |
1536 | + populateDeltaTAlgorithmsList(); |
1537 | } |
1538 | } |
1539 | |
1540 | @@ -221,6 +228,18 @@ |
1541 | this, |
1542 | SLOT(showShortcutsWindow())); |
1543 | |
1544 | + // Delta-T |
1545 | + populateDeltaTAlgorithmsList(); |
1546 | + int idx = ui->deltaTAlgorithmComboBox->findData(core->getCurrentDeltaTAlgorithmKey(), Qt::UserRole, Qt::MatchCaseSensitive); |
1547 | + if (idx==-1) |
1548 | + { |
1549 | + // Use Espenak & Meeus (2006) as default |
1550 | + idx = ui->deltaTAlgorithmComboBox->findData(QVariant("EspenakMeeus"), Qt::UserRole, Qt::MatchCaseSensitive); |
1551 | + } |
1552 | + ui->deltaTAlgorithmComboBox->setCurrentIndex(idx); |
1553 | + connect(ui->deltaTAlgorithmComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setDeltaTAlgorithm(int))); |
1554 | + connect(ui->pushButtonCustomDeltaTEquationDialog, SIGNAL(clicked()), this, SLOT(showCustomDeltaTEquationDialog())); |
1555 | + |
1556 | // Tools tab |
1557 | ConstellationMgr* cmgr = GETSTELMODULE(ConstellationMgr); |
1558 | Q_ASSERT(cmgr); |
1559 | @@ -591,6 +610,7 @@ |
1560 | conf->setValue("navigation/startup_time_mode", core->getStartupTimeMode()); |
1561 | conf->setValue("navigation/today_time", core->getInitTodayTime()); |
1562 | conf->setValue("navigation/preset_sky_time", core->getPresetSkyTime()); |
1563 | + conf->setValue("navigation/time_correction_algorithm", core->getCurrentDeltaTAlgorithmKey()); |
1564 | conf->setValue("navigation/init_fov", mvmgr->getInitFov()); |
1565 | if (mvmgr->getMountMode() == StelMovementMgr::MountAltAzimuthal) |
1566 | conf->setValue("navigation/viewing_mode", "horizon"); |
1567 | @@ -1087,3 +1107,82 @@ |
1568 | ui->stackListWidget->setMinimumWidth(0); |
1569 | */ |
1570 | } |
1571 | + |
1572 | +void ConfigurationDialog::populateDeltaTAlgorithmsList() |
1573 | +{ |
1574 | + Q_ASSERT(ui->deltaTAlgorithmComboBox); |
1575 | + |
1576 | + // TRANSLATORS: Full phrase is "Algorithm of DeltaT" |
1577 | + ui->deltaTLabel->setText(QString("%1 %2T:").arg("Algorithm of").arg(QChar(0x0394))); |
1578 | + |
1579 | + QComboBox* algorithms = ui->deltaTAlgorithmComboBox; |
1580 | + |
1581 | + //Save the current selection to be restored later |
1582 | + algorithms->blockSignals(true); |
1583 | + int index = algorithms->currentIndex(); |
1584 | + QVariant selectedAlgorithmId = algorithms->itemData(index); |
1585 | + algorithms->clear(); |
1586 | + //For each algorithm, display the localized name and store the key as user |
1587 | + //data. Unfortunately, there's no other way to do this than with a cycle. |
1588 | + algorithms->addItem(q_("Without correction"), "WithoutCorrection"); |
1589 | + algorithms->addItem(q_("Schoch (1931)"), "Schoch"); |
1590 | + algorithms->addItem(q_("Clemence (1948)"), "Clemence"); |
1591 | + algorithms->addItem(q_("IAU (1952)"), "IAU"); |
1592 | + algorithms->addItem(q_("Astronomical Ephemeris (1960)"), "AstronomicalEphemeris"); |
1593 | + algorithms->addItem(q_("Tuckerman (1962, 1964) & Goldstine (1973)"), "TuckermanGoldstine"); |
1594 | + algorithms->addItem(q_("Muller & Stephenson (1975)"), "MullerStephenson"); |
1595 | + algorithms->addItem(q_("Stephenson (1978)"), "Stephenson1978"); |
1596 | + algorithms->addItem(q_("Schmadel & Zech (1979)"), "SchmadelZech1979"); |
1597 | + algorithms->addItem(q_("Morrison & Stephenson (1982)"), "MorrisonStephenson1982"); |
1598 | + algorithms->addItem(q_("Stephenson & Morrison (1984)"), "StephensonMorrison1984"); |
1599 | + algorithms->addItem(q_("Stephenson & Houlden (1986)"), "StephensonHoulden"); |
1600 | + algorithms->addItem(q_("Espenak (1987, 1989)"), "Espenak"); |
1601 | + algorithms->addItem(q_("Borkowski (1988)"), "Borkowski"); |
1602 | + algorithms->addItem(q_("Schmadel & Zech (1988)"), "SchmadelZech1988"); |
1603 | + algorithms->addItem(q_("Chapront-Touze & Chapront (1991)"), "ChaprontTouze"); |
1604 | + algorithms->addItem(q_("Stephenson & Morrison (1995)"), "StephensonMorrison1995"); |
1605 | + algorithms->addItem(q_("Stephenson (1997)"), "Stephenson1997"); |
1606 | + algorithms->addItem(q_("Chapront, Chapront-Touze & Francou (1997)"), "ChaprontFrancou"); |
1607 | + algorithms->addItem(q_("Meeus (1998)"), "Meeus"); |
1608 | + algorithms->addItem(q_("JPL Horizons"), "JPLHorizons"); |
1609 | + algorithms->addItem(q_("Meeus & Simons (2000)"), "MeeusSimons"); |
1610 | + algorithms->addItem(q_("Montenbruck & Pfleger (2000)"), "MontenbruckPfleger"); |
1611 | + algorithms->addItem(q_("Reingold & Dershowitz (2001, 2002)"), "ReingoldDershowitz"); |
1612 | + algorithms->addItem(q_("Morrison & Stephenson (2004, 2005)"), "MorrisonStephenson2004"); |
1613 | + algorithms->addItem(q_("Espenak & Meeus (2006)"), "EspenakMeeus"); |
1614 | + algorithms->addItem(q_("Reijs (2006)"), "Reijs"); |
1615 | + algorithms->addItem(q_("Custom equation of %1T").arg(QChar(0x0394)), "Custom"); |
1616 | + |
1617 | + //Restore the selection |
1618 | + index = algorithms->findData(selectedAlgorithmId, Qt::UserRole, Qt::MatchCaseSensitive); |
1619 | + algorithms->setCurrentIndex(index); |
1620 | + //algorithms->model()->sort(0); |
1621 | + algorithms->blockSignals(false); |
1622 | + setDeltaTAlgorithmDescription(); |
1623 | +} |
1624 | + |
1625 | +void ConfigurationDialog::setDeltaTAlgorithm(int algorithmID) |
1626 | +{ |
1627 | + StelCore* core = StelApp::getInstance().getCore(); |
1628 | + QString currentAlgorithm = ui->deltaTAlgorithmComboBox->itemData(algorithmID).toString(); |
1629 | + core->setCurrentDeltaTAlgorithmKey(currentAlgorithm); |
1630 | + setDeltaTAlgorithmDescription(); |
1631 | + if (currentAlgorithm.contains("Custom")) |
1632 | + ui->pushButtonCustomDeltaTEquationDialog->setEnabled(true); |
1633 | + else |
1634 | + ui->pushButtonCustomDeltaTEquationDialog->setEnabled(false); |
1635 | +} |
1636 | + |
1637 | +void ConfigurationDialog::setDeltaTAlgorithmDescription() |
1638 | +{ |
1639 | + ui->deltaTAlgorithmDescription->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet)); |
1640 | + ui->deltaTAlgorithmDescription->setHtml(StelApp::getInstance().getCore()->getCurrentDeltaTAlgorithmDescription()); |
1641 | +} |
1642 | + |
1643 | +void ConfigurationDialog::showCustomDeltaTEquationDialog() |
1644 | +{ |
1645 | + if (customDeltaTEquationDialog == NULL) |
1646 | + customDeltaTEquationDialog = new CustomDeltaTEquationDialog(); |
1647 | + |
1648 | + customDeltaTEquationDialog->setVisible(true); |
1649 | +} |
1650 | |
1651 | === modified file 'src/gui/ConfigurationDialog.hpp' |
1652 | --- src/gui/ConfigurationDialog.hpp 2012-10-03 20:25:38 +0000 |
1653 | +++ src/gui/ConfigurationDialog.hpp 2013-02-17 21:34:20 +0000 |
1654 | @@ -32,6 +32,7 @@ |
1655 | class QNetworkAccessManager; |
1656 | class QListWidgetItem; |
1657 | class StelGui; |
1658 | +class CustomDeltaTEquationDialog; |
1659 | |
1660 | class ConfigurationDialog : public StelDialog |
1661 | { |
1662 | @@ -120,6 +121,11 @@ |
1663 | void pluginConfigureCurrentSelection(); |
1664 | void loadAtStartupChanged(int); |
1665 | |
1666 | + void populateDeltaTAlgorithmsList(); |
1667 | + void setDeltaTAlgorithm(int algorithmID); |
1668 | + void setDeltaTAlgorithmDescription(); |
1669 | + void showCustomDeltaTEquationDialog(); |
1670 | + |
1671 | #ifndef DISABLE_SCRIPTING |
1672 | //! The selection of script in the script list has changed |
1673 | //! Updates the script information panel |
1674 | @@ -140,6 +146,8 @@ |
1675 | private: |
1676 | StelGui* gui; |
1677 | |
1678 | + CustomDeltaTEquationDialog* customDeltaTEquationDialog; |
1679 | + |
1680 | int savedProjectionType; |
1681 | |
1682 | //! Set the displayed fields checkboxes from the current displayed fields. |
1683 | |
1684 | === added file 'src/gui/CustomDeltaTEquationDialog.cpp' |
1685 | --- src/gui/CustomDeltaTEquationDialog.cpp 1970-01-01 00:00:00 +0000 |
1686 | +++ src/gui/CustomDeltaTEquationDialog.cpp 2013-02-17 21:34:20 +0000 |
1687 | @@ -0,0 +1,122 @@ |
1688 | +/* |
1689 | + * This program is distributed in the hope that it will be useful, |
1690 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1691 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1692 | + * GNU General Public License for more details. |
1693 | + * You should have received a copy of the GNU General Public License |
1694 | + * along with this program; if not, write to the Free Software |
1695 | + * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. |
1696 | +*/ |
1697 | + |
1698 | +#include "CustomDeltaTEquationDialog.hpp" |
1699 | +#include "ui_CustomDeltaTEquationDialog.h" |
1700 | + |
1701 | +#include "Dialog.hpp" |
1702 | +#include "StelApp.hpp" |
1703 | +#include "StelTranslator.hpp" |
1704 | +#include "StelObjectMgr.hpp" |
1705 | + |
1706 | +#include <QDebug> |
1707 | + |
1708 | +CustomDeltaTEquationDialog::CustomDeltaTEquationDialog() |
1709 | +{ |
1710 | + ui = new Ui_CustomDeltaTEquationDialogForm; |
1711 | + conf = StelApp::getInstance().getSettings(); |
1712 | + core = StelApp::getInstance().getCore(); |
1713 | + |
1714 | + ndot = core->getCustomNDot(); |
1715 | + year = core->getCustomYear(); |
1716 | + coeff = core->getCustomEquationCoefficients(); |
1717 | +} |
1718 | + |
1719 | +CustomDeltaTEquationDialog::~CustomDeltaTEquationDialog() |
1720 | +{ |
1721 | + delete ui; |
1722 | + ui=NULL; |
1723 | +} |
1724 | + |
1725 | +void CustomDeltaTEquationDialog::retranslate() |
1726 | +{ |
1727 | + if (dialog) |
1728 | + ui->retranslateUi(dialog); |
1729 | +} |
1730 | + |
1731 | + |
1732 | +void CustomDeltaTEquationDialog::createDialogContent() |
1733 | +{ |
1734 | + ui->setupUi(dialog); |
1735 | + |
1736 | + ui->stelWindowTitle->setText(q_("Custom equation for %1T").arg(QChar(0x0394))); |
1737 | + ui->labelDescription->setText(q_("A typical equation for calculation of %1T looks like:").arg(QChar(0x0394))); |
1738 | + ui->labelEquation->setText(QString("<strong>%1T = a + b%2u + c%3u%4,</strong>").arg(QChar(0x0394)).arg(QChar(0x00B7)).arg(QChar(0x00B7)).arg(QChar(0x00B2))); |
1739 | + ui->labelSubEquation->setText(QString("%1 <em>u = (%2 - y)/100</em>").arg(q_("where")).arg(q_("year"))); |
1740 | + ui->labelNDot->setText(QString("%1:").arg(QChar(0x1E45))); |
1741 | + |
1742 | + ui->lineEditCoefficientA->setText(QString("%1").arg(coeff[0])); |
1743 | + ui->lineEditCoefficientB->setText(QString("%1").arg(coeff[1])); |
1744 | + ui->lineEditCoefficientC->setText(QString("%1").arg(coeff[2])); |
1745 | + ui->lineEditYear->setText(QString("%1").arg(year)); |
1746 | + ui->lineEditNDot->setText(QString("%1").arg(ndot)); |
1747 | + |
1748 | + //Signals and slots |
1749 | + connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
1750 | + connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
1751 | + |
1752 | + connect(ui->lineEditNDot, SIGNAL(textEdited(const QString&)), this, SLOT(setNDot(const QString&))); |
1753 | + connect(ui->lineEditYear, SIGNAL(textEdited(const QString&)), this, SLOT(setYear(const QString&))); |
1754 | + connect(ui->lineEditCoefficientA, SIGNAL(textEdited(const QString&)), this, SLOT(setCoeffA(const QString&))); |
1755 | + connect(ui->lineEditCoefficientB, SIGNAL(textEdited(const QString&)), this, SLOT(setCoeffB(const QString&))); |
1756 | + connect(ui->lineEditCoefficientC, SIGNAL(textEdited(const QString&)), this, SLOT(setCoeffC(const QString&))); |
1757 | + |
1758 | +} |
1759 | + |
1760 | +void CustomDeltaTEquationDialog::setVisible(bool v) |
1761 | +{ |
1762 | + StelDialog::setVisible(v); |
1763 | +} |
1764 | + |
1765 | +void CustomDeltaTEquationDialog::saveSettings(void) const |
1766 | +{ |
1767 | + conf->beginGroup("custom_time_correction"); |
1768 | + |
1769 | + conf->setValue("year", year); |
1770 | + conf->setValue("ndot", ndot); |
1771 | + conf->setValue("coefficients", QString("%1,%2,%3").arg(coeff[0]).arg(coeff[1]).arg(coeff[2])); |
1772 | + |
1773 | + conf->endGroup(); |
1774 | +} |
1775 | + |
1776 | +void CustomDeltaTEquationDialog::setNDot(const QString& v) |
1777 | +{ |
1778 | + ndot = v.toFloat(); |
1779 | + core->setCustomNDot(ndot); |
1780 | + saveSettings(); |
1781 | +} |
1782 | + |
1783 | +void CustomDeltaTEquationDialog::setYear(const QString& v) |
1784 | +{ |
1785 | + year = v.toFloat(); |
1786 | + core->setCustomYear(year); |
1787 | + saveSettings(); |
1788 | +} |
1789 | + |
1790 | +void CustomDeltaTEquationDialog::setCoeffA(const QString& v) |
1791 | +{ |
1792 | + coeff[0] = v.toFloat(); |
1793 | + core->setCustomEquationCoefficients(coeff); |
1794 | + saveSettings(); |
1795 | +} |
1796 | + |
1797 | +void CustomDeltaTEquationDialog::setCoeffB(const QString& v) |
1798 | +{ |
1799 | + coeff[1] = v.toFloat(); |
1800 | + core->setCustomEquationCoefficients(coeff); |
1801 | + saveSettings(); |
1802 | +} |
1803 | + |
1804 | +void CustomDeltaTEquationDialog::setCoeffC(const QString& v) |
1805 | +{ |
1806 | + coeff[2] = v.toFloat(); |
1807 | + core->setCustomEquationCoefficients(coeff); |
1808 | + saveSettings(); |
1809 | +} |
1810 | |
1811 | === added file 'src/gui/CustomDeltaTEquationDialog.hpp' |
1812 | --- src/gui/CustomDeltaTEquationDialog.hpp 1970-01-01 00:00:00 +0000 |
1813 | +++ src/gui/CustomDeltaTEquationDialog.hpp 2013-02-17 21:34:20 +0000 |
1814 | @@ -0,0 +1,69 @@ |
1815 | +/* |
1816 | + * Stellarium |
1817 | + * |
1818 | + * Copyright (C) 2013 Alexander Wolf |
1819 | + * |
1820 | + * This program is free software; you can redistribute it and/or |
1821 | + * modify it under the terms of the GNU General Public License |
1822 | + * as published by the Free Software Foundation; either version 2 |
1823 | + * of the License, or (at your option) any later version. |
1824 | + * |
1825 | + * This program is distributed in the hope that it will be useful, |
1826 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1827 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1828 | + * GNU General Public License for more details. |
1829 | + * You should have received a copy of the GNU General Public License |
1830 | + * along with this program; if not, write to the Free Software |
1831 | + * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. |
1832 | +*/ |
1833 | + |
1834 | +// AW: Methods copied largely from AddRemoveLandscapesDialog |
1835 | + |
1836 | +#ifndef _CUSTOMDELTATEQUATIONDIALOG_HPP_ |
1837 | +#define _CUSTOMDELTATEQUATIONDIALOG_HPP_ |
1838 | + |
1839 | +#include <QObject> |
1840 | +#include <QSettings> |
1841 | +#include "StelDialog.hpp" |
1842 | +#include "StelCore.hpp" |
1843 | + |
1844 | +class Ui_CustomDeltaTEquationDialogForm; |
1845 | + |
1846 | +//! @class CustomDeltaTEquationDialog |
1847 | +class CustomDeltaTEquationDialog : public StelDialog |
1848 | +{ |
1849 | + Q_OBJECT |
1850 | + |
1851 | +public: |
1852 | + CustomDeltaTEquationDialog(); |
1853 | + virtual ~CustomDeltaTEquationDialog(); |
1854 | + |
1855 | +public slots: |
1856 | + void retranslate(); |
1857 | + void setVisible(bool); |
1858 | + |
1859 | +protected: |
1860 | + //! Initialize the dialog widgets and connect the signals/slots. |
1861 | + virtual void createDialogContent(); |
1862 | + Ui_CustomDeltaTEquationDialogForm *ui; |
1863 | + |
1864 | +private slots: |
1865 | + void saveSettings(void) const; |
1866 | + |
1867 | + void setNDot(const QString& v); |
1868 | + void setYear(const QString& v); |
1869 | + void setCoeffA(const QString& v); |
1870 | + void setCoeffB(const QString& v); |
1871 | + void setCoeffC(const QString& v); |
1872 | + |
1873 | +private: |
1874 | + QSettings* conf; |
1875 | + StelCore* core; |
1876 | + |
1877 | + float year; |
1878 | + float ndot; |
1879 | + Vec3f coeff; |
1880 | + |
1881 | +}; |
1882 | + |
1883 | +#endif // _CUSTOMDELTATEQUATIONDIALOG_HPP_ |
1884 | |
1885 | === added file 'src/gui/CustomDeltaTEquationDialog.ui' |
1886 | --- src/gui/CustomDeltaTEquationDialog.ui 1970-01-01 00:00:00 +0000 |
1887 | +++ src/gui/CustomDeltaTEquationDialog.ui 2013-02-17 21:34:20 +0000 |
1888 | @@ -0,0 +1,262 @@ |
1889 | +<?xml version="1.0" encoding="UTF-8"?> |
1890 | +<ui version="4.0"> |
1891 | + <class>CustomDeltaTEquationDialogForm</class> |
1892 | + <widget class="QWidget" name="CustomDeltaTEquationDialogForm"> |
1893 | + <property name="geometry"> |
1894 | + <rect> |
1895 | + <x>0</x> |
1896 | + <y>0</y> |
1897 | + <width>168</width> |
1898 | + <height>261</height> |
1899 | + </rect> |
1900 | + </property> |
1901 | + <layout class="QVBoxLayout" name="verticalLayout"> |
1902 | + <property name="spacing"> |
1903 | + <number>0</number> |
1904 | + </property> |
1905 | + <property name="margin"> |
1906 | + <number>0</number> |
1907 | + </property> |
1908 | + <item> |
1909 | + <widget class="BarFrame" name="TitleBar"> |
1910 | + <property name="minimumSize"> |
1911 | + <size> |
1912 | + <width>16</width> |
1913 | + <height>25</height> |
1914 | + </size> |
1915 | + </property> |
1916 | + <property name="maximumSize"> |
1917 | + <size> |
1918 | + <width>16777215</width> |
1919 | + <height>25</height> |
1920 | + </size> |
1921 | + </property> |
1922 | + <property name="frameShape"> |
1923 | + <enum>QFrame::StyledPanel</enum> |
1924 | + </property> |
1925 | + <layout class="QHBoxLayout"> |
1926 | + <property name="leftMargin"> |
1927 | + <number>0</number> |
1928 | + </property> |
1929 | + <property name="topMargin"> |
1930 | + <number>0</number> |
1931 | + </property> |
1932 | + <property name="rightMargin"> |
1933 | + <number>4</number> |
1934 | + </property> |
1935 | + <property name="bottomMargin"> |
1936 | + <number>0</number> |
1937 | + </property> |
1938 | + <item> |
1939 | + <spacer> |
1940 | + <property name="orientation"> |
1941 | + <enum>Qt::Horizontal</enum> |
1942 | + </property> |
1943 | + <property name="sizeHint" stdset="0"> |
1944 | + <size> |
1945 | + <width>40</width> |
1946 | + <height>20</height> |
1947 | + </size> |
1948 | + </property> |
1949 | + </spacer> |
1950 | + </item> |
1951 | + <item> |
1952 | + <widget class="QLabel" name="stelWindowTitle"> |
1953 | + <property name="palette"> |
1954 | + <palette> |
1955 | + <active/> |
1956 | + <inactive/> |
1957 | + <disabled/> |
1958 | + </palette> |
1959 | + </property> |
1960 | + <property name="font"> |
1961 | + <font/> |
1962 | + </property> |
1963 | + <property name="text"> |
1964 | + <string/> |
1965 | + </property> |
1966 | + </widget> |
1967 | + </item> |
1968 | + <item> |
1969 | + <spacer> |
1970 | + <property name="orientation"> |
1971 | + <enum>Qt::Horizontal</enum> |
1972 | + </property> |
1973 | + <property name="sizeHint" stdset="0"> |
1974 | + <size> |
1975 | + <width>40</width> |
1976 | + <height>20</height> |
1977 | + </size> |
1978 | + </property> |
1979 | + </spacer> |
1980 | + </item> |
1981 | + <item> |
1982 | + <widget class="QPushButton" name="closeStelWindow"> |
1983 | + <property name="minimumSize"> |
1984 | + <size> |
1985 | + <width>16</width> |
1986 | + <height>16</height> |
1987 | + </size> |
1988 | + </property> |
1989 | + <property name="maximumSize"> |
1990 | + <size> |
1991 | + <width>16</width> |
1992 | + <height>16</height> |
1993 | + </size> |
1994 | + </property> |
1995 | + <property name="focusPolicy"> |
1996 | + <enum>Qt::NoFocus</enum> |
1997 | + </property> |
1998 | + <property name="text"> |
1999 | + <string/> |
2000 | + </property> |
2001 | + </widget> |
2002 | + </item> |
2003 | + </layout> |
2004 | + </widget> |
2005 | + </item> |
2006 | + <item> |
2007 | + <widget class="QGroupBox" name="customDeltaTEquationGroupBox"> |
2008 | + <property name="title"> |
2009 | + <string/> |
2010 | + </property> |
2011 | + <property name="alignment"> |
2012 | + <set>Qt::AlignCenter</set> |
2013 | + </property> |
2014 | + <layout class="QVBoxLayout" name="verticalLayout_3"> |
2015 | + <property name="margin"> |
2016 | + <number>0</number> |
2017 | + </property> |
2018 | + <item> |
2019 | + <widget class="QLabel" name="labelDescription"> |
2020 | + <property name="text"> |
2021 | + <string notr="true">description</string> |
2022 | + </property> |
2023 | + </widget> |
2024 | + </item> |
2025 | + <item> |
2026 | + <widget class="QLabel" name="labelEquation"> |
2027 | + <property name="text"> |
2028 | + <string notr="true">equation</string> |
2029 | + </property> |
2030 | + <property name="textFormat"> |
2031 | + <enum>Qt::RichText</enum> |
2032 | + </property> |
2033 | + <property name="alignment"> |
2034 | + <set>Qt::AlignCenter</set> |
2035 | + </property> |
2036 | + </widget> |
2037 | + </item> |
2038 | + <item> |
2039 | + <widget class="QLabel" name="labelSubEquation"> |
2040 | + <property name="text"> |
2041 | + <string notr="true">subequation</string> |
2042 | + </property> |
2043 | + </widget> |
2044 | + </item> |
2045 | + <item> |
2046 | + <layout class="QHBoxLayout" name="horizontalLayout"> |
2047 | + <item> |
2048 | + <widget class="QLabel" name="labelCoefficientA"> |
2049 | + <property name="text"> |
2050 | + <string notr="true">a:</string> |
2051 | + </property> |
2052 | + </widget> |
2053 | + </item> |
2054 | + <item> |
2055 | + <widget class="QLineEdit" name="lineEditCoefficientA"> |
2056 | + <property name="alignment"> |
2057 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
2058 | + </property> |
2059 | + </widget> |
2060 | + </item> |
2061 | + </layout> |
2062 | + </item> |
2063 | + <item> |
2064 | + <layout class="QHBoxLayout" name="horizontalLayout_2"> |
2065 | + <item> |
2066 | + <widget class="QLabel" name="labelCoefficientB"> |
2067 | + <property name="text"> |
2068 | + <string notr="true">b:</string> |
2069 | + </property> |
2070 | + </widget> |
2071 | + </item> |
2072 | + <item> |
2073 | + <widget class="QLineEdit" name="lineEditCoefficientB"> |
2074 | + <property name="alignment"> |
2075 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
2076 | + </property> |
2077 | + </widget> |
2078 | + </item> |
2079 | + </layout> |
2080 | + </item> |
2081 | + <item> |
2082 | + <layout class="QHBoxLayout" name="horizontalLayout_4"> |
2083 | + <item> |
2084 | + <widget class="QLabel" name="labelCoefficientC"> |
2085 | + <property name="text"> |
2086 | + <string notr="true">c:</string> |
2087 | + </property> |
2088 | + </widget> |
2089 | + </item> |
2090 | + <item> |
2091 | + <widget class="QLineEdit" name="lineEditCoefficientC"> |
2092 | + <property name="alignment"> |
2093 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
2094 | + </property> |
2095 | + </widget> |
2096 | + </item> |
2097 | + </layout> |
2098 | + </item> |
2099 | + <item> |
2100 | + <layout class="QHBoxLayout" name="horizontalLayout_5"> |
2101 | + <item> |
2102 | + <widget class="QLabel" name="labelYear"> |
2103 | + <property name="text"> |
2104 | + <string notr="true">y:</string> |
2105 | + </property> |
2106 | + </widget> |
2107 | + </item> |
2108 | + <item> |
2109 | + <widget class="QLineEdit" name="lineEditYear"> |
2110 | + <property name="alignment"> |
2111 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
2112 | + </property> |
2113 | + </widget> |
2114 | + </item> |
2115 | + </layout> |
2116 | + </item> |
2117 | + <item> |
2118 | + <layout class="QHBoxLayout" name="horizontalLayout_6"> |
2119 | + <item> |
2120 | + <widget class="QLabel" name="labelNDot"> |
2121 | + <property name="text"> |
2122 | + <string notr="true">ndot:</string> |
2123 | + </property> |
2124 | + </widget> |
2125 | + </item> |
2126 | + <item> |
2127 | + <widget class="QLineEdit" name="lineEditNDot"> |
2128 | + <property name="alignment"> |
2129 | + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
2130 | + </property> |
2131 | + </widget> |
2132 | + </item> |
2133 | + </layout> |
2134 | + </item> |
2135 | + </layout> |
2136 | + </widget> |
2137 | + </item> |
2138 | + </layout> |
2139 | + </widget> |
2140 | + <customwidgets> |
2141 | + <customwidget> |
2142 | + <class>BarFrame</class> |
2143 | + <extends>QFrame</extends> |
2144 | + <header>Dialog.hpp</header> |
2145 | + <container>1</container> |
2146 | + </customwidget> |
2147 | + </customwidgets> |
2148 | + <resources/> |
2149 | + <connections/> |
2150 | +</ui> |
2151 | |
2152 | === modified file 'src/gui/DateTimeDialog.cpp' |
2153 | --- src/gui/DateTimeDialog.cpp 2013-01-27 19:19:38 +0000 |
2154 | +++ src/gui/DateTimeDialog.cpp 2013-02-17 21:34:20 +0000 |
2155 | @@ -55,7 +55,7 @@ |
2156 | // Add in a DeltaT correction. Divide DeltaT by 86400 to convert from seconds to days. |
2157 | double deltaT = 0.; |
2158 | if (StelApp::getInstance().getCore()->getCurrentLocation().planetName=="Earth") |
2159 | - deltaT = StelUtils::getDeltaT(jd)/86400.; |
2160 | + deltaT = StelApp::getInstance().getCore()->getDeltaT(jd)/86400.; |
2161 | setDateTime(jd + (StelApp::getInstance().getLocaleMgr().getGMTShift(jd)/24.0)-deltaT); |
2162 | |
2163 | connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate())); |
2164 | @@ -177,7 +177,7 @@ |
2165 | // Add in a DeltaT correction. Divide DeltaT by 86400 to convert from seconds to days. |
2166 | double deltaT = 0.; |
2167 | if (StelApp::getInstance().getCore()->getCurrentLocation().planetName=="Earth") |
2168 | - deltaT = StelUtils::getDeltaT(jd)/86400.; |
2169 | + deltaT = StelApp::getInstance().getCore()->getDeltaT(jd)/86400.; |
2170 | jd -= (StelApp::getInstance().getLocaleMgr().getGMTShift(jd)/24.0-deltaT); // local tz -> UTC |
2171 | return jd; |
2172 | } |
2173 | @@ -211,7 +211,7 @@ |
2174 | // Add in a DeltaT correction. Divide DeltaT by 86400 to convert from seconds to days. |
2175 | double deltaT = 0.; |
2176 | if (StelApp::getInstance().getCore()->getCurrentLocation().planetName=="Earth") |
2177 | - deltaT = StelUtils::getDeltaT(newJd)/86400.; |
2178 | + deltaT = StelApp::getInstance().getCore()->getDeltaT(newJd)/86400.; |
2179 | newJd += (StelApp::getInstance().getLocaleMgr().getGMTShift(newJd)/24.0-deltaT); // UTC -> local tz |
2180 | StelUtils::getDateFromJulianDay(newJd, &year, &month, &day); |
2181 | StelUtils::getTimeFromJulianDay(newJd, &hour, &minute, &second); |
2182 | |
2183 | === modified file 'src/gui/StelGuiItems.cpp' |
2184 | --- src/gui/StelGuiItems.cpp 2013-01-30 18:50:32 +0000 |
2185 | +++ src/gui/StelGuiItems.cpp 2013-02-17 21:34:20 +0000 |
2186 | @@ -582,11 +582,16 @@ |
2187 | StelCore* core = StelApp::getInstance().getCore(); |
2188 | double jd = core->getJDay(); |
2189 | double deltaT = 0.; |
2190 | + double sigma = -1.; |
2191 | + QString sigmaInfo = ""; |
2192 | + QString validRangeInfo = ""; |
2193 | bool displayDeltaT = false; |
2194 | - if (StelApp::getInstance().getCore()->getCurrentLocation().planetName=="Earth") |
2195 | + if (core->getCurrentLocation().planetName.contains("Earth")) |
2196 | { |
2197 | - deltaT = StelUtils::getDeltaT(jd); |
2198 | - displayDeltaT = true; |
2199 | + deltaT = core->getDeltaT(jd); |
2200 | + displayDeltaT = true; |
2201 | + sigma = StelUtils::getDeltaTStandardError(jd); |
2202 | + core->getCurrentDeltaTAlgorithmValigRange(jd, &validRangeInfo); |
2203 | } |
2204 | |
2205 | // Add in a DeltaT correction. Divide DeltaT by 86400 to convert from seconds to days. |
2206 | @@ -596,12 +601,15 @@ |
2207 | { |
2208 | updatePos = true; |
2209 | datetime->setText(newDate); |
2210 | - if (displayDeltaT) |
2211 | + if (displayDeltaT && core->getCurrentDeltaTAlgorithm()!=StelCore::WithoutCorrection) |
2212 | { |
2213 | - if (deltaT>60.) |
2214 | - datetime->setToolTip(QString("%1T = %2 (%3s)").arg(QChar(0x0394)).arg(StelUtils::hoursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2)); |
2215 | + if (sigma>0) |
2216 | + sigmaInfo = QString("; %1(%2T) = %3s").arg(QChar(0x03c3)).arg(QChar(0x0394)).arg(sigma, 3, 'f', 1); |
2217 | + |
2218 | + if (std::abs(deltaT)>60.) |
2219 | + datetime->setToolTip(QString("%1T = %2 (%3s)%8 [%4 @ -23.8946%5/cy%6%7]").arg(QChar(0x0394)).arg(StelUtils::hoursToHmsStr(deltaT/3600.)).arg(deltaT, 5, 'f', 2).arg(QChar(0x1e45)).arg(QChar(0x2033)).arg(QChar(0x00B2)).arg(sigmaInfo).arg(validRangeInfo)); |
2220 | else |
2221 | - datetime->setToolTip(QString("%1T = %2s").arg(QChar(0x0394)).arg(deltaT, 3, 'f', 3)); |
2222 | + datetime->setToolTip(QString("%1T = %2s%7 [%3 @ -23.8946%4/cy%5%6]").arg(QChar(0x0394)).arg(deltaT, 3, 'f', 3).arg(QChar(0x1e45)).arg(QChar(0x2033)).arg(QChar(0x00B2)).arg(sigmaInfo).arg(validRangeInfo)); |
2223 | } |
2224 | else |
2225 | datetime->setToolTip(""); |
2226 | |
2227 | === modified file 'src/gui/configurationDialog.ui' |
2228 | --- src/gui/configurationDialog.ui 2012-10-03 20:25:38 +0000 |
2229 | +++ src/gui/configurationDialog.ui 2013-02-17 21:34:20 +0000 |
2230 | @@ -6,8 +6,8 @@ |
2231 | <rect> |
2232 | <x>0</x> |
2233 | <y>0</y> |
2234 | - <width>521</width> |
2235 | - <height>483</height> |
2236 | + <width>481</width> |
2237 | + <height>445</height> |
2238 | </rect> |
2239 | </property> |
2240 | <layout class="QVBoxLayout"> |
2241 | @@ -130,7 +130,7 @@ |
2242 | <item row="1" column="0"> |
2243 | <widget class="QStackedWidget" name="configurationStackedWidget"> |
2244 | <property name="currentIndex"> |
2245 | - <number>0</number> |
2246 | + <number>2</number> |
2247 | </property> |
2248 | <widget class="QWidget" name="page"> |
2249 | <layout class="QVBoxLayout" name="verticalLayout_10"> |
2250 | @@ -310,11 +310,8 @@ |
2251 | <property name="title"> |
2252 | <string>Selected object information</string> |
2253 | </property> |
2254 | - <layout class="QVBoxLayout" name="verticalLayout_5"> |
2255 | - <property name="margin"> |
2256 | - <number>0</number> |
2257 | - </property> |
2258 | - <item> |
2259 | + <layout class="QGridLayout" name="gridLayout_2"> |
2260 | + <item row="0" column="0"> |
2261 | <widget class="QRadioButton" name="allSelectedInfoRadio"> |
2262 | <property name="toolTip"> |
2263 | <string>Display all information available</string> |
2264 | @@ -324,7 +321,17 @@ |
2265 | </property> |
2266 | </widget> |
2267 | </item> |
2268 | - <item> |
2269 | + <item row="0" column="1"> |
2270 | + <widget class="QRadioButton" name="noSelectedInfoRadio"> |
2271 | + <property name="toolTip"> |
2272 | + <string>Display no information</string> |
2273 | + </property> |
2274 | + <property name="text"> |
2275 | + <string>None</string> |
2276 | + </property> |
2277 | + </widget> |
2278 | + </item> |
2279 | + <item row="1" column="0"> |
2280 | <widget class="QRadioButton" name="briefSelectedInfoRadio"> |
2281 | <property name="toolTip"> |
2282 | <string>Display less information</string> |
2283 | @@ -334,17 +341,7 @@ |
2284 | </property> |
2285 | </widget> |
2286 | </item> |
2287 | - <item> |
2288 | - <widget class="QRadioButton" name="noSelectedInfoRadio"> |
2289 | - <property name="toolTip"> |
2290 | - <string>Display no information</string> |
2291 | - </property> |
2292 | - <property name="text"> |
2293 | - <string>None</string> |
2294 | - </property> |
2295 | - </widget> |
2296 | - </item> |
2297 | - <item> |
2298 | + <item row="1" column="1"> |
2299 | <widget class="QRadioButton" name="customSelectedInfoRadio"> |
2300 | <property name="toolTip"> |
2301 | <string>Display user settings information</string> |
2302 | @@ -385,19 +382,6 @@ |
2303 | </attribute> |
2304 | </widget> |
2305 | </item> |
2306 | - <item row="4" column="0"> |
2307 | - <widget class="QCheckBox" name="checkBoxHourAngle"> |
2308 | - <property name="toolTip"> |
2309 | - <string>Topocentric equatorial coordinates</string> |
2310 | - </property> |
2311 | - <property name="text"> |
2312 | - <string>Hour angle/Declination</string> |
2313 | - </property> |
2314 | - <attribute name="buttonGroup"> |
2315 | - <string notr="true">buttonGroupDisplayedFields</string> |
2316 | - </attribute> |
2317 | - </widget> |
2318 | - </item> |
2319 | <item row="4" column="1"> |
2320 | <widget class="QCheckBox" name="checkBoxAltAz"> |
2321 | <property name="toolTip"> |
2322 | @@ -421,42 +405,6 @@ |
2323 | </attribute> |
2324 | </widget> |
2325 | </item> |
2326 | - <item row="5" column="1"> |
2327 | - <widget class="QCheckBox" name="checkBoxSize"> |
2328 | - <property name="toolTip"> |
2329 | - <string>Angular or physical size</string> |
2330 | - </property> |
2331 | - <property name="text"> |
2332 | - <string>Size</string> |
2333 | - </property> |
2334 | - <attribute name="buttonGroup"> |
2335 | - <string notr="true">buttonGroupDisplayedFields</string> |
2336 | - </attribute> |
2337 | - </widget> |
2338 | - </item> |
2339 | - <item row="7" column="0" colspan="2"> |
2340 | - <widget class="QCheckBox" name="checkBoxExtra3"> |
2341 | - <property name="text"> |
2342 | - <string>Additional information 3</string> |
2343 | - </property> |
2344 | - <attribute name="buttonGroup"> |
2345 | - <string notr="true">buttonGroupDisplayedFields</string> |
2346 | - </attribute> |
2347 | - </widget> |
2348 | - </item> |
2349 | - <item row="6" column="1"> |
2350 | - <widget class="QCheckBox" name="checkBoxExtra2"> |
2351 | - <property name="toolTip"> |
2352 | - <string/> |
2353 | - </property> |
2354 | - <property name="text"> |
2355 | - <string>Additional information 2</string> |
2356 | - </property> |
2357 | - <attribute name="buttonGroup"> |
2358 | - <string notr="true">buttonGroupDisplayedFields</string> |
2359 | - </attribute> |
2360 | - </widget> |
2361 | - </item> |
2362 | <item row="1" column="1"> |
2363 | <widget class="QCheckBox" name="checkBoxAbsoluteMag"> |
2364 | <property name="text"> |
2365 | @@ -467,16 +415,6 @@ |
2366 | </attribute> |
2367 | </widget> |
2368 | </item> |
2369 | - <item row="5" column="0"> |
2370 | - <widget class="QCheckBox" name="checkBoxDistance"> |
2371 | - <property name="text"> |
2372 | - <string>Distance</string> |
2373 | - </property> |
2374 | - <attribute name="buttonGroup"> |
2375 | - <string notr="true">buttonGroupDisplayedFields</string> |
2376 | - </attribute> |
2377 | - </widget> |
2378 | - </item> |
2379 | <item row="1" column="0"> |
2380 | <widget class="QCheckBox" name="checkBoxCatalogNumbers"> |
2381 | <property name="text"> |
2382 | @@ -497,19 +435,6 @@ |
2383 | </attribute> |
2384 | </widget> |
2385 | </item> |
2386 | - <item row="6" column="0"> |
2387 | - <widget class="QCheckBox" name="checkBoxExtra1"> |
2388 | - <property name="toolTip"> |
2389 | - <string>Spectral class, nebula type, etc.</string> |
2390 | - </property> |
2391 | - <property name="text"> |
2392 | - <string>Additional information 1</string> |
2393 | - </property> |
2394 | - <attribute name="buttonGroup"> |
2395 | - <string notr="true">buttonGroupDisplayedFields</string> |
2396 | - </attribute> |
2397 | - </widget> |
2398 | - </item> |
2399 | <item row="3" column="0"> |
2400 | <widget class="QCheckBox" name="checkBoxRaDecOfDate"> |
2401 | <property name="toolTip"> |
2402 | @@ -533,6 +458,78 @@ |
2403 | </property> |
2404 | </widget> |
2405 | </item> |
2406 | + <item row="3" column="1"> |
2407 | + <widget class="QCheckBox" name="checkBoxHourAngle"> |
2408 | + <property name="toolTip"> |
2409 | + <string>Topocentric equatorial coordinates</string> |
2410 | + </property> |
2411 | + <property name="text"> |
2412 | + <string>Hour angle/Declination</string> |
2413 | + </property> |
2414 | + <attribute name="buttonGroup"> |
2415 | + <string notr="true">buttonGroupDisplayedFields</string> |
2416 | + </attribute> |
2417 | + </widget> |
2418 | + </item> |
2419 | + <item row="4" column="0"> |
2420 | + <widget class="QCheckBox" name="checkBoxDistance"> |
2421 | + <property name="text"> |
2422 | + <string>Distance</string> |
2423 | + </property> |
2424 | + <attribute name="buttonGroup"> |
2425 | + <string notr="true">buttonGroupDisplayedFields</string> |
2426 | + </attribute> |
2427 | + </widget> |
2428 | + </item> |
2429 | + <item row="5" column="0"> |
2430 | + <widget class="QCheckBox" name="checkBoxSize"> |
2431 | + <property name="toolTip"> |
2432 | + <string>Angular or physical size</string> |
2433 | + </property> |
2434 | + <property name="text"> |
2435 | + <string>Size</string> |
2436 | + </property> |
2437 | + <attribute name="buttonGroup"> |
2438 | + <string notr="true">buttonGroupDisplayedFields</string> |
2439 | + </attribute> |
2440 | + </widget> |
2441 | + </item> |
2442 | + <item row="5" column="1"> |
2443 | + <widget class="QCheckBox" name="checkBoxExtra1"> |
2444 | + <property name="toolTip"> |
2445 | + <string>Spectral class, nebula type, etc.</string> |
2446 | + </property> |
2447 | + <property name="text"> |
2448 | + <string>Additional information 1</string> |
2449 | + </property> |
2450 | + <attribute name="buttonGroup"> |
2451 | + <string notr="true">buttonGroupDisplayedFields</string> |
2452 | + </attribute> |
2453 | + </widget> |
2454 | + </item> |
2455 | + <item row="6" column="0"> |
2456 | + <widget class="QCheckBox" name="checkBoxExtra2"> |
2457 | + <property name="toolTip"> |
2458 | + <string/> |
2459 | + </property> |
2460 | + <property name="text"> |
2461 | + <string>Additional information 2</string> |
2462 | + </property> |
2463 | + <attribute name="buttonGroup"> |
2464 | + <string notr="true">buttonGroupDisplayedFields</string> |
2465 | + </attribute> |
2466 | + </widget> |
2467 | + </item> |
2468 | + <item row="6" column="1"> |
2469 | + <widget class="QCheckBox" name="checkBoxExtra3"> |
2470 | + <property name="text"> |
2471 | + <string>Additional information 3</string> |
2472 | + </property> |
2473 | + <attribute name="buttonGroup"> |
2474 | + <string notr="true">buttonGroupDisplayedFields</string> |
2475 | + </attribute> |
2476 | + </widget> |
2477 | + </item> |
2478 | </layout> |
2479 | </widget> |
2480 | </item> |
2481 | @@ -551,7 +548,7 @@ |
2482 | <property name="title"> |
2483 | <string>Control</string> |
2484 | </property> |
2485 | - <layout class="QGridLayout" name="gridLayout"> |
2486 | + <layout class="QGridLayout" name="gridLayoutStartup"> |
2487 | <property name="margin"> |
2488 | <number>0</number> |
2489 | </property> |
2490 | @@ -565,7 +562,7 @@ |
2491 | </property> |
2492 | </widget> |
2493 | </item> |
2494 | - <item row="1" column="0" colspan="2"> |
2495 | + <item row="1" column="0"> |
2496 | <widget class="QCheckBox" name="enableMouseNavigationCheckBox"> |
2497 | <property name="toolTip"> |
2498 | <string>Allow mouse to pan (drag) and zoom (mousewheel)</string> |
2499 | @@ -582,6 +579,58 @@ |
2500 | </property> |
2501 | </widget> |
2502 | </item> |
2503 | + <item row="1" column="1"> |
2504 | + <layout class="QHBoxLayout" name="_8"> |
2505 | + <item> |
2506 | + <widget class="QCheckBox" name="mouseTimeoutCheckbox"> |
2507 | + <property name="toolTip"> |
2508 | + <string>Hides the mouse cursor when inactive</string> |
2509 | + </property> |
2510 | + <property name="text"> |
2511 | + <string>Mouse cursor timeout:</string> |
2512 | + </property> |
2513 | + </widget> |
2514 | + </item> |
2515 | + <item> |
2516 | + <widget class="QDoubleSpinBox" name="mouseTimeoutSpinBox"> |
2517 | + <property name="maximumSize"> |
2518 | + <size> |
2519 | + <width>16777215</width> |
2520 | + <height>24</height> |
2521 | + </size> |
2522 | + </property> |
2523 | + <property name="toolTip"> |
2524 | + <string>seconds</string> |
2525 | + </property> |
2526 | + <property name="decimals"> |
2527 | + <number>1</number> |
2528 | + </property> |
2529 | + <property name="minimum"> |
2530 | + <double>0.000000000000000</double> |
2531 | + </property> |
2532 | + <property name="maximum"> |
2533 | + <double>3600.000000000000000</double> |
2534 | + </property> |
2535 | + <property name="value"> |
2536 | + <double>10.000000000000000</double> |
2537 | + </property> |
2538 | + </widget> |
2539 | + </item> |
2540 | + <item> |
2541 | + <spacer name="horizontalSpacer"> |
2542 | + <property name="orientation"> |
2543 | + <enum>Qt::Horizontal</enum> |
2544 | + </property> |
2545 | + <property name="sizeHint" stdset="0"> |
2546 | + <size> |
2547 | + <width>40</width> |
2548 | + <height>20</height> |
2549 | + </size> |
2550 | + </property> |
2551 | + </spacer> |
2552 | + </item> |
2553 | + </layout> |
2554 | + </item> |
2555 | </layout> |
2556 | </widget> |
2557 | </item> |
2558 | @@ -594,6 +643,60 @@ |
2559 | <property name="margin"> |
2560 | <number>0</number> |
2561 | </property> |
2562 | + <item row="2" column="0"> |
2563 | + <layout class="QHBoxLayout" name="_4"> |
2564 | + <item> |
2565 | + <widget class="QRadioButton" name="fixedTimeRadio"> |
2566 | + <property name="toolTip"> |
2567 | + <string>Use a specific date and time when Stellarium starts up</string> |
2568 | + </property> |
2569 | + <property name="text"> |
2570 | + <string>Other:</string> |
2571 | + </property> |
2572 | + </widget> |
2573 | + </item> |
2574 | + <item> |
2575 | + <widget class="QDateTimeEdit" name="fixedDateTimeEdit"> |
2576 | + <property name="minimumSize"> |
2577 | + <size> |
2578 | + <width>0</width> |
2579 | + <height>24</height> |
2580 | + </size> |
2581 | + </property> |
2582 | + <property name="maximumSize"> |
2583 | + <size> |
2584 | + <width>16777215</width> |
2585 | + <height>24</height> |
2586 | + </size> |
2587 | + </property> |
2588 | + <property name="date"> |
2589 | + <date> |
2590 | + <year>1952</year> |
2591 | + <month>5</month> |
2592 | + <day>11</day> |
2593 | + </date> |
2594 | + </property> |
2595 | + <property name="time"> |
2596 | + <time> |
2597 | + <hour>0</hour> |
2598 | + <minute>42</minute> |
2599 | + <second>0</second> |
2600 | + </time> |
2601 | + </property> |
2602 | + <property name="calendarPopup"> |
2603 | + <bool>true</bool> |
2604 | + </property> |
2605 | + </widget> |
2606 | + </item> |
2607 | + </layout> |
2608 | + </item> |
2609 | + <item row="2" column="1"> |
2610 | + <widget class="QPushButton" name="fixedDateTimeCurrentButton"> |
2611 | + <property name="text"> |
2612 | + <string>use current</string> |
2613 | + </property> |
2614 | + </widget> |
2615 | + </item> |
2616 | <item row="0" column="0"> |
2617 | <widget class="QRadioButton" name="systemTimeRadio"> |
2618 | <property name="toolTip"> |
2619 | @@ -604,7 +707,7 @@ |
2620 | </property> |
2621 | </widget> |
2622 | </item> |
2623 | - <item row="1" column="0"> |
2624 | + <item row="0" column="1"> |
2625 | <layout class="QHBoxLayout" name="_3"> |
2626 | <property name="spacing"> |
2627 | <number>6</number> |
2628 | @@ -662,165 +765,87 @@ |
2629 | </item> |
2630 | </layout> |
2631 | </item> |
2632 | - <item row="2" column="0"> |
2633 | - <layout class="QHBoxLayout" name="_4"> |
2634 | - <item> |
2635 | - <widget class="QRadioButton" name="fixedTimeRadio"> |
2636 | - <property name="toolTip"> |
2637 | - <string>Use a specific date and time when Stellarium starts up</string> |
2638 | - </property> |
2639 | - <property name="text"> |
2640 | - <string>Other:</string> |
2641 | - </property> |
2642 | - </widget> |
2643 | - </item> |
2644 | - <item> |
2645 | - <widget class="QDateTimeEdit" name="fixedDateTimeEdit"> |
2646 | - <property name="minimumSize"> |
2647 | - <size> |
2648 | - <width>0</width> |
2649 | - <height>24</height> |
2650 | - </size> |
2651 | - </property> |
2652 | - <property name="maximumSize"> |
2653 | - <size> |
2654 | - <width>16777215</width> |
2655 | - <height>24</height> |
2656 | - </size> |
2657 | - </property> |
2658 | - <property name="date"> |
2659 | - <date> |
2660 | - <year>1952</year> |
2661 | - <month>5</month> |
2662 | - <day>11</day> |
2663 | - </date> |
2664 | - </property> |
2665 | - <property name="time"> |
2666 | - <time> |
2667 | - <hour>0</hour> |
2668 | - <minute>42</minute> |
2669 | - <second>0</second> |
2670 | - </time> |
2671 | - </property> |
2672 | - <property name="calendarPopup"> |
2673 | - <bool>true</bool> |
2674 | - </property> |
2675 | - </widget> |
2676 | - </item> |
2677 | - </layout> |
2678 | - </item> |
2679 | - <item row="1" column="1"> |
2680 | - <spacer name="horizontalSpacer_2"> |
2681 | - <property name="orientation"> |
2682 | - <enum>Qt::Horizontal</enum> |
2683 | - </property> |
2684 | - <property name="sizeHint" stdset="0"> |
2685 | - <size> |
2686 | - <width>123</width> |
2687 | - <height>20</height> |
2688 | - </size> |
2689 | - </property> |
2690 | - </spacer> |
2691 | - </item> |
2692 | - <item row="2" column="1"> |
2693 | - <widget class="QPushButton" name="fixedDateTimeCurrentButton"> |
2694 | - <property name="text"> |
2695 | - <string>use current</string> |
2696 | - </property> |
2697 | - </widget> |
2698 | - </item> |
2699 | - <item row="2" column="2"> |
2700 | - <spacer name="horizontalSpacer_3"> |
2701 | - <property name="orientation"> |
2702 | - <enum>Qt::Horizontal</enum> |
2703 | - </property> |
2704 | - <property name="sizeHint" stdset="0"> |
2705 | - <size> |
2706 | - <width>40</width> |
2707 | - <height>20</height> |
2708 | - </size> |
2709 | - </property> |
2710 | - </spacer> |
2711 | - </item> |
2712 | </layout> |
2713 | </widget> |
2714 | </item> |
2715 | <item> |
2716 | - <widget class="QGroupBox" name="groupBox_9"> |
2717 | + <widget class="QGroupBox" name="deltaTGroupBox"> |
2718 | <property name="title"> |
2719 | - <string>Other</string> |
2720 | + <string>Time correction</string> |
2721 | </property> |
2722 | - <layout class="QVBoxLayout" name="verticalLayout"> |
2723 | + <layout class="QHBoxLayout" name="horizontalLayout_9"> |
2724 | <property name="margin"> |
2725 | <number>0</number> |
2726 | </property> |
2727 | <item> |
2728 | - <layout class="QHBoxLayout" name="_8"> |
2729 | - <item> |
2730 | - <widget class="QCheckBox" name="mouseTimeoutCheckbox"> |
2731 | - <property name="toolTip"> |
2732 | - <string>Hides the mouse cursor when inactive</string> |
2733 | - </property> |
2734 | - <property name="text"> |
2735 | - <string>Mouse cursor timeout (seconds):</string> |
2736 | - </property> |
2737 | - </widget> |
2738 | - </item> |
2739 | - <item> |
2740 | - <spacer name="horizontalSpacer"> |
2741 | - <property name="orientation"> |
2742 | - <enum>Qt::Horizontal</enum> |
2743 | - </property> |
2744 | - <property name="sizeHint" stdset="0"> |
2745 | - <size> |
2746 | - <width>40</width> |
2747 | - <height>20</height> |
2748 | - </size> |
2749 | - </property> |
2750 | - </spacer> |
2751 | - </item> |
2752 | - <item> |
2753 | - <widget class="QDoubleSpinBox" name="mouseTimeoutSpinBox"> |
2754 | - <property name="maximumSize"> |
2755 | - <size> |
2756 | - <width>16777215</width> |
2757 | - <height>24</height> |
2758 | - </size> |
2759 | - </property> |
2760 | - <property name="decimals"> |
2761 | - <number>1</number> |
2762 | - </property> |
2763 | - <property name="minimum"> |
2764 | - <double>0.000000000000000</double> |
2765 | - </property> |
2766 | - <property name="maximum"> |
2767 | - <double>3600.000000000000000</double> |
2768 | - </property> |
2769 | - <property name="value"> |
2770 | - <double>10.000000000000000</double> |
2771 | - </property> |
2772 | - </widget> |
2773 | - </item> |
2774 | - </layout> |
2775 | - </item> |
2776 | - <item> |
2777 | - <widget class="QCheckBox" name="showFlipButtonsCheckbox"> |
2778 | - <property name="toolTip"> |
2779 | - <string>Toggle vertical and horizontal image flip buttons.</string> |
2780 | - </property> |
2781 | - <property name="text"> |
2782 | - <string>Show flip buttons</string> |
2783 | - </property> |
2784 | - </widget> |
2785 | - </item> |
2786 | - <item> |
2787 | - <widget class="QCheckBox" name="showNebulaBgButtonCheckbox"> |
2788 | - <property name="toolTip"> |
2789 | - <string>Toggle display backgrounds of the nebulae.</string> |
2790 | - </property> |
2791 | - <property name="text"> |
2792 | - <string>Show nebula background button</string> |
2793 | - </property> |
2794 | + <widget class="QFrame" name="frame"> |
2795 | + <property name="frameShape"> |
2796 | + <enum>QFrame::StyledPanel</enum> |
2797 | + </property> |
2798 | + <property name="frameShadow"> |
2799 | + <enum>QFrame::Raised</enum> |
2800 | + </property> |
2801 | + <layout class="QVBoxLayout" name="verticalLayout"> |
2802 | + <property name="margin"> |
2803 | + <number>0</number> |
2804 | + </property> |
2805 | + <item> |
2806 | + <layout class="QHBoxLayout" name="horizontalLayout_12"> |
2807 | + <property name="leftMargin"> |
2808 | + <number>6</number> |
2809 | + </property> |
2810 | + <item> |
2811 | + <widget class="QLabel" name="deltaTLabel"> |
2812 | + <property name="text"> |
2813 | + <string/> |
2814 | + </property> |
2815 | + </widget> |
2816 | + </item> |
2817 | + <item> |
2818 | + <widget class="QComboBox" name="deltaTAlgorithmComboBox"/> |
2819 | + </item> |
2820 | + <item> |
2821 | + <widget class="QPushButton" name="pushButtonCustomDeltaTEquationDialog"> |
2822 | + <property name="enabled"> |
2823 | + <bool>false</bool> |
2824 | + </property> |
2825 | + <property name="toolTip"> |
2826 | + <string>Edit equation</string> |
2827 | + </property> |
2828 | + <property name="text"> |
2829 | + <string notr="true">...</string> |
2830 | + </property> |
2831 | + </widget> |
2832 | + </item> |
2833 | + <item> |
2834 | + <spacer name="horizontalSpacer_2"> |
2835 | + <property name="orientation"> |
2836 | + <enum>Qt::Horizontal</enum> |
2837 | + </property> |
2838 | + <property name="sizeHint" stdset="0"> |
2839 | + <size> |
2840 | + <width>40</width> |
2841 | + <height>20</height> |
2842 | + </size> |
2843 | + </property> |
2844 | + </spacer> |
2845 | + </item> |
2846 | + </layout> |
2847 | + </item> |
2848 | + <item> |
2849 | + <widget class="QTextBrowser" name="deltaTAlgorithmDescription"> |
2850 | + <property name="autoFillBackground"> |
2851 | + <bool>true</bool> |
2852 | + </property> |
2853 | + <property name="openExternalLinks"> |
2854 | + <bool>true</bool> |
2855 | + </property> |
2856 | + <property name="openLinks"> |
2857 | + <bool>true</bool> |
2858 | + </property> |
2859 | + </widget> |
2860 | + </item> |
2861 | + </layout> |
2862 | </widget> |
2863 | </item> |
2864 | </layout> |
2865 | @@ -838,14 +863,27 @@ |
2866 | </property> |
2867 | <item> |
2868 | <widget class="QGroupBox" name="groupBox_7"> |
2869 | + <property name="sizePolicy"> |
2870 | + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> |
2871 | + <horstretch>0</horstretch> |
2872 | + <verstretch>0</verstretch> |
2873 | + </sizepolicy> |
2874 | + </property> |
2875 | <property name="title"> |
2876 | <string>Planetarium options</string> |
2877 | </property> |
2878 | - <layout class="QGridLayout" name="gridLayoutx"> |
2879 | - <property name="margin"> |
2880 | - <number>0</number> |
2881 | - </property> |
2882 | - <item row="1" column="0"> |
2883 | + <layout class="QGridLayout" name="gridLayoutOptions"> |
2884 | + <item row="0" column="0"> |
2885 | + <widget class="QCheckBox" name="sphericMirrorCheckbox"> |
2886 | + <property name="toolTip"> |
2887 | + <string>Spheric mirror distortion is used when projecting Stellarium onto a spheric mirror for low-cost planetarium systems.</string> |
2888 | + </property> |
2889 | + <property name="text"> |
2890 | + <string>Spheric mirror distortion</string> |
2891 | + </property> |
2892 | + </widget> |
2893 | + </item> |
2894 | + <item row="0" column="1"> |
2895 | <widget class="QCheckBox" name="diskViewportCheckbox"> |
2896 | <property name="toolTip"> |
2897 | <string>Mask out everything outside a central circle in the main view</string> |
2898 | @@ -855,17 +893,17 @@ |
2899 | </property> |
2900 | </widget> |
2901 | </item> |
2902 | - <item row="0" column="0"> |
2903 | - <widget class="QCheckBox" name="sphericMirrorCheckbox"> |
2904 | - <property name="toolTip"> |
2905 | - <string>Spheric mirror distortion is used when projecting Stellarium onto a spheric mirror for low-cost planetarium systems.</string> |
2906 | + <item row="1" column="0"> |
2907 | + <widget class="QCheckBox" name="selectSingleConstellationButton"> |
2908 | + <property name="statusTip"> |
2909 | + <string>Hide other constellations when you click one</string> |
2910 | </property> |
2911 | <property name="text"> |
2912 | - <string>Spheric mirror distortion</string> |
2913 | + <string>Select single constellation</string> |
2914 | </property> |
2915 | </widget> |
2916 | </item> |
2917 | - <item row="2" column="0"> |
2918 | + <item row="1" column="1"> |
2919 | <widget class="QCheckBox" name="gravityLabelCheckbox"> |
2920 | <property name="toolTip"> |
2921 | <string>Align labels with the horizon</string> |
2922 | @@ -875,24 +913,27 @@ |
2923 | </property> |
2924 | </widget> |
2925 | </item> |
2926 | - <item row="3" column="0"> |
2927 | - <widget class="QCheckBox" name="selectSingleConstellationButton"> |
2928 | - <property name="statusTip"> |
2929 | - <string>Hide other constellations when you click one</string> |
2930 | - </property> |
2931 | - <property name="text"> |
2932 | - <string>Select single constellation</string> |
2933 | - </property> |
2934 | - </widget> |
2935 | - </item> |
2936 | - <item row="6" column="0"> |
2937 | - <widget class="QCheckBox" name="renderSolarShadowsCheckbox"> |
2938 | - <property name="text"> |
2939 | - <string>Render Solar Shadows</string> |
2940 | - </property> |
2941 | - </widget> |
2942 | - </item> |
2943 | - <item row="5" column="0"> |
2944 | + <item row="2" column="0"> |
2945 | + <widget class="QCheckBox" name="showNebulaBgButtonCheckbox"> |
2946 | + <property name="toolTip"> |
2947 | + <string>Toggle display backgrounds of the nebulae.</string> |
2948 | + </property> |
2949 | + <property name="text"> |
2950 | + <string>Show nebula background button</string> |
2951 | + </property> |
2952 | + </widget> |
2953 | + </item> |
2954 | + <item row="2" column="1"> |
2955 | + <widget class="QCheckBox" name="showFlipButtonsCheckbox"> |
2956 | + <property name="toolTip"> |
2957 | + <string>Toggle vertical and horizontal image flip buttons.</string> |
2958 | + </property> |
2959 | + <property name="text"> |
2960 | + <string>Show flip buttons</string> |
2961 | + </property> |
2962 | + </widget> |
2963 | + </item> |
2964 | + <item row="3" column="0" colspan="2"> |
2965 | <widget class="QCheckBox" name="autoZoomResetsDirectionCheckbox"> |
2966 | <property name="toolTip"> |
2967 | <string>When enabled, the "auto zoom out" key will also set the initial viewing direction</string> |
2968 | @@ -902,6 +943,13 @@ |
2969 | </property> |
2970 | </widget> |
2971 | </item> |
2972 | + <item row="4" column="0"> |
2973 | + <widget class="QCheckBox" name="renderSolarShadowsCheckbox"> |
2974 | + <property name="text"> |
2975 | + <string>Render Solar Shadows</string> |
2976 | + </property> |
2977 | + </widget> |
2978 | + </item> |
2979 | </layout> |
2980 | </widget> |
2981 | </item> |
2982 | @@ -1344,10 +1392,6 @@ |
2983 | <tabstop>programLanguageComboBox</tabstop> |
2984 | <tabstop>setViewingOptionAsDefaultPushButton</tabstop> |
2985 | <tabstop>restoreDefaultsButton</tabstop> |
2986 | - <tabstop>allSelectedInfoRadio</tabstop> |
2987 | - <tabstop>briefSelectedInfoRadio</tabstop> |
2988 | - <tabstop>noSelectedInfoRadio</tabstop> |
2989 | - <tabstop>customSelectedInfoRadio</tabstop> |
2990 | <tabstop>checkBoxName</tabstop> |
2991 | <tabstop>checkBoxCatalogNumbers</tabstop> |
2992 | <tabstop>checkBoxVisualMag</tabstop> |
2993 | @@ -1355,15 +1399,8 @@ |
2994 | <tabstop>checkBoxRaDecJ2000</tabstop> |
2995 | <tabstop>checkBoxRaDecOfDate</tabstop> |
2996 | <tabstop>checkBoxGalacticCoordJ2000</tabstop> |
2997 | - <tabstop>checkBoxHourAngle</tabstop> |
2998 | <tabstop>checkBoxAltAz</tabstop> |
2999 | - <tabstop>checkBoxDistance</tabstop> |
3000 | - <tabstop>checkBoxSize</tabstop> |
3001 | - <tabstop>checkBoxExtra1</tabstop> |
3002 | - <tabstop>checkBoxExtra2</tabstop> |
3003 | - <tabstop>checkBoxExtra3</tabstop> |
3004 | <tabstop>enableKeysNavigationCheckBox</tabstop> |
3005 | - <tabstop>enableMouseNavigationCheckBox</tabstop> |
3006 | <tabstop>editShortcutsPushButton</tabstop> |
3007 | <tabstop>systemTimeRadio</tabstop> |
3008 | <tabstop>todayRadio</tabstop> |
3009 | @@ -1373,8 +1410,6 @@ |
3010 | <tabstop>fixedDateTimeCurrentButton</tabstop> |
3011 | <tabstop>mouseTimeoutCheckbox</tabstop> |
3012 | <tabstop>mouseTimeoutSpinBox</tabstop> |
3013 | - <tabstop>showFlipButtonsCheckbox</tabstop> |
3014 | - <tabstop>showNebulaBgButtonCheckbox</tabstop> |
3015 | <tabstop>sphericMirrorCheckbox</tabstop> |
3016 | <tabstop>diskViewportCheckbox</tabstop> |
3017 | <tabstop>gravityLabelCheckbox</tabstop> |
3018 | |
3019 | === modified file 'src/scripting/StelMainScriptAPI.cpp' |
3020 | --- src/scripting/StelMainScriptAPI.cpp 2013-02-08 16:40:32 +0000 |
3021 | +++ src/scripting/StelMainScriptAPI.cpp 2013-02-17 21:34:20 +0000 |
3022 | @@ -146,7 +146,7 @@ |
3023 | |
3024 | QString StelMainScriptAPI::getDeltaT() const |
3025 | { |
3026 | - return StelUtils::hoursToHmsStr(StelUtils::getDeltaT(getJDay())/3600.); |
3027 | + return StelUtils::hoursToHmsStr(StelApp::getInstance().getCore()->getDeltaT(getJDay())/3600.); |
3028 | } |
3029 | |
3030 | //! Set time speed in JDay/sec |
3031 | |
3032 | === modified file 'src/tests/testDeltaT.cpp' |
3033 | --- src/tests/testDeltaT.cpp 2013-01-03 09:27:01 +0000 |
3034 | +++ src/tests/testDeltaT.cpp 2013-02-17 21:34:20 +0000 |
3035 | @@ -88,7 +88,7 @@ |
3036 | double expectedResult = data.takeFirst().toDouble(); |
3037 | double acceptableError = data.takeFirst().toDouble(); |
3038 | StelUtils::getJDFromDate(&JD, year, 1, 1, 0, 0, 0); |
3039 | - double result = StelUtils::getDeltaT(JD); |
3040 | + double result = StelUtils::getDeltaTByEspenakMeeus(JD); |
3041 | double actualError = std::abs(expectedResult) - std::abs(result); |
3042 | StelUtils::getDateFromJulianDay(JD, &yout, &mout, &dout); |
3043 | QVERIFY2(actualError <= acceptableError, QString("date=%2 year=%3 result=%4 error=%5 acceptable=%6") |
In all, it looks great. However, there is still the problem that in "current time/real-time" mode, the time displayed is not the system (PC clock) time, but system time corrected by DeltaT. This must be fixed before merge, IMHO. Small changes (docfix etc.) can be done later. Pfleger( 2000).
I also had liked the warning signs for "out of recommended range", if possible.
I am afraid the JPL Horizons value for the present time cannot be correct, and likewise Meeus&Simmons (2000), Montenbruck&