Merge lp:~i-martividal/stellarium/Observability-Bug into lp:stellarium

Proposed by Ivan Marti-Vidal
Status: Merged
Merged at revision: 8122
Proposed branch: lp:~i-martividal/stellarium/Observability-Bug
Merge into: lp:stellarium
Diff against target: 42 lines (+17/-6)
1 file modified
plugins/Observability/src/Observability.cpp (+17/-6)
To merge this branch: bzr merge lp:~i-martividal/stellarium/Observability-Bug
Reviewer Review Type Date Requested Status
Alexander Wolf Approve
Review via email: mp+281985@code.launchpad.net

Description of the change

Hi all,

This is the new version of observability, with the bug 1531561 corrected.

   Cheers!

        Ivan

To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) wrote :

Yes, the current patch is definitely fixes the issue.

review: Approve
Revision history for this message
Alexander Wolf (alexwolf) wrote :

Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Observability/src/Observability.cpp'
2--- plugins/Observability/src/Observability.cpp 2015-12-22 15:15:35 +0000
3+++ plugins/Observability/src/Observability.cpp 2016-01-08 11:47:54 +0000
4@@ -601,7 +601,18 @@
5
6 if (culmAlt < (halfpi - refractedHorizonAlt)) // Source can be observed.
7 {
8- double altiAtCulmi = Rad2Deg*(halfpi-culmAlt-refractedHorizonAlt);
9+// THESE IS FREE OF ATMOSPHERE AND REFERRED TO TRUE HORIZON!
10+ double altiAtCulmi = (halfpi-culmAlt); //-refractedHorizonAlt);
11+
12+// Add refraction, if necessary:
13+ Vec3d TempRefr;
14+ TempRefr[0] = std::cos(altiAtCulmi);
15+ TempRefr[1] = 0.0;
16+ TempRefr[2] = std::sin(altiAtCulmi);
17+ Vec3d CorrRefr = core->altAzToEquinoxEqu(TempRefr,StelCore::RefractionOff);
18+ TempRefr = core->equinoxEquToAltAz(CorrRefr,StelCore::RefractionAuto);
19+ altiAtCulmi = Rad2Deg*std::asin(TempRefr[2]);
20+
21 double2hms(TFrac*currH,dc,mc,sc);
22
23 //String with the time span for culmination:
24@@ -723,13 +734,13 @@
25 QString acroRiseStr, acroSetStr;
26 QString cosRiseStr, cosSetStr;
27 QString heliRiseStr, heliSetStr;
28- // TODO: Possible error? Day 0 is 1 Jan.
29- acroRiseStr = (acroRise>0)?formatAsDate(acroRise):msgNone;
30- acroSetStr = (acroSet>0)?formatAsDate(acroSet):msgNone;
31+ // TODO: Possible error? Day 0 is 1 Jan. ==> IMV: Indeed! Corrected
32+ acroRiseStr = (acroRise>=0)?formatAsDate(acroRise):msgNone;
33+ acroSetStr = (acroSet>=0)?formatAsDate(acroSet):msgNone;
34 cosRiseStr = (cosRise>0)?formatAsDate(cosRise):msgNone;
35 cosSetStr = (cosSet>0)?formatAsDate(cosSet):msgNone;
36- heliRiseStr = (heliRise>0)?formatAsDate(heliRise):msgNone;
37- heliSetStr = (heliSet>0)?formatAsDate(heliSet):msgNone;
38+ heliRiseStr = (heliRise>=0)?formatAsDate(heliRise):msgNone;
39+ heliSetStr = (heliSet>=0)?formatAsDate(heliSet):msgNone;
40
41
42 if (result==3 || result==1)