getSelectedObjectInfo() - Azimuth figures reported incorrectly

Bug #1264805 reported by Alexander Wolf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
Medium
Alexander Wolf

Bug Description

Note: This report was taken from our forum - https://sourceforge.net/p/stellarium/discussion/278769/thread/93d4078c/

Hi all!

I think I've come across a bug with getSelectedObjectInfo(), specifically the figure it reports for a selected objects azimuth.

For the record I'm using 0.12.4 64bit on Win 7 Home Premium 64 bit. Also tried with the 32bit version of Stellarium but no difference.

There's a couple of examples below, but if you run the script in the console with an object selected, you'll see similar strangeness

This is the script:
TargetData = core.getSelectedObjectInfo();
TargetName = TargetData["localized-name"];
TargetGeoAzi = TargetData["azimuth-geometric"];
TargetGeoAlt = TargetData["altitude-geometric"];
core.debug(TargetName + "\t" + TargetGeoAzi + "\t" + TargetGeoAlt);

Observer Location: London
 Date: 2013-12-11 04:30 UTC

Target: Arcturus
 Azimuth: +95° 54' 54"
 Altitude: +29° 18' 57"

These are the figures shown in the information panel, top left of screen - all good

And when I run the script, the numbers that come out are haywire.

Script Azimuth: 84.08502474297381 (84° 05' 06.09")
 Script Altitude: 29.31577612575129 (29° 18' 56.793")

The altitude is correct, but the azimuth is not.

It only makes sense with the formula:

180° - Actual Azimuth = Reported Azimuth

e.g.
 180° - 95° 54' 54" = 84° 05' 06.09"

This is only true of objects with an actual azimuth of between 0° and 180°. Things get stranger if you go past 180°....

====================================

Observer Location: London
 Date: 2013-12-11 04:30 UTC

Target: Pollux
 Azimuth: +236° 26' 14"
 Altitude: +57° 00' 46"

Script Azimuth: -56.43734108748945 (-56° 26' 14.4276")
 Script Altitude: 57.01283417030654 (57° 00' 46.2018")

Again altitude is correct, but the situation with the azimuth is worse. Now the formula appears to be

Actual Azimuth - 180° = (-)Reported Azimuth

e.g.
 236° 26' 14" - 180° = -56° 26' 14.4276"

You see what happened? It took the actual azimuth, subtracted 180° to get a result, and then made the result negative!

I also noticed this behaviour with getObjectInfo

Any input greatly appreciated!
 Many thanks
 Richard

Tags: scripting

Related branches

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

A fix has been committed as revision 6426 of the trunk branch in Stellarium's Bazaar repository at Launchpad:
http://bazaar.launchpad.net/~stellarium/stellarium/trunk/revision/6426

tags: added: scripting
Changed in stellarium:
milestone: none → 0.13.0
assignee: nobody → Alexander Wolf (alexwolf)
importance: Undecided → Medium
status: New → Fix Committed
Changed in stellarium:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.