Bug 77564 - Sun and other planets ovelay in dumped image
Summary: Sun and other planets ovelay in dumped image
Alias: None
Product: kstars
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kstars
: 97794 (view as bug list)
Depends on:
Reported: 2004-03-14 11:55 UTC by arrigo
Modified: 2005-01-25 06:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description arrigo 2004-03-14 11:55:40 UTC
Version:           1.0 (using KDE 3.2.0, Gentoo)
Compiler:          gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)
OS:          Linux (i686) release 2.6.2

I found kstars so wonderful i decided to use its dumps as my desktop background with the command:

kstars --dump --width %x --height %y --filename %f

from the Advanced Background Settings window in order to increase my sky knowledge between a compilation and the next. All works pretty good but the sun and other solar planets and comets ovelay in the same point of image, always the same, approximately at:
x=520 px
y=640 px (using 1024x768 resolution)
The problem doesn't appear saving sky image from kstars.

Comment 1 kstars 2004-06-01 10:03:29 UTC
I can't confirm this; can you update and try again, or post a screenshot?
Comment 2 Chris Sommer 2004-08-05 19:35:26 UTC
I found the exact same problem with the --dump option for generating an image.  The major planets did not seem to have a problem displaying in their correct positions, but the Sun an Pluto both display on top of each other.  Comets and Asteroids also show up overlayed with the sun and pluto.

I am using SuSE 9.1 on i386 and initially found the bug using the SuSE RPM's for kdeedu.  I have since uninstalled the default SuSE RPM's and compiled KStars from CVS and still have the same issue.
Comment 3 Tibor Keller 2004-12-29 15:09:26 UTC
I found the exact same problem with the --dump option for generating an image. under Fedora 2.
Sun an Pluto both display on top of each other.
Sun is much above Eclyptica.
Comment 4 kstars 2005-01-24 15:35:25 UTC
*** Bug 97794 has been marked as a duplicate of this bug. ***
Comment 5 kstars 2005-01-24 15:48:46 UTC
I am (finally) seeing this bug also.  So hopefully I will have a fix shortly, now that I can track it down.
Comment 6 kstars 2005-01-25 06:25:10 UTC
CVS commit by harris: 

Fixing positions of the planets in image-dump mode.  There was a bug 
that made the first calculated position of the planets incorrect, though 
all subsequent calculations were correct.  In image-dump mode, positions 
are only calculated once, so you got the wrong positions.

The bug was in the correction for "figure of the Earth" (i.e., our point 
of view is from a point on the surface of the Earth, not at its center).  
As the code was written, it attempted to apply the figure-of-the-Earth 
correction *before* the planet's distance from the Earth was calculated.  
The correction needs the Earth distance, so it returned a garbage 
answer.  The problem only manifested the first time, because on 
subsequent calls, the earth distance had by then been defined. 

Now, the distance from Earth is computed before the correction is made.

Thanks for the bug reports.  If you have the KStars source code, you can 
easily patch your local copy.  Edit the file ksplanetbase.cpp, and find 
the "findPosition" function.  Move the line containing "setRearth" to 
just after the "findGeocentricPosition" line.

CCMAIL: kstars-devel@kde.org
BUG: 77564

  M +2 -2      ksplanetbase.cpp   1.22
  M +0 -1      planetcatalog.cpp   1.17

--- kdeedu/kstars/kstars/ksplanetbase.cpp  #1.21:1.22
@@ -73,9 +73,9 @@ void KSPlanetBase::findPosition( const K
         findGeocentricPosition( num, Earth );  //private function, reimplemented in each subclass
+        if ( Earth ) setRearth( Earth );
         if ( lat && LST )
                 localizeCoords( num, lat, LST ); //correct for figure-of-the-Earth
-        if ( Earth ) setRearth( Earth );
         if ( hasTrail() ) {
                 Trail.append( new SkyPoint( ra(), dec() ) );