[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Sun Nov 4 22:51:55 CET 2007


SVN commit 732841 by harris:

Display apparent altitude, not true altitude in statusbar and details
dialog.

Also, added some debug code: when you press "Q", it dumps a series of
angle values, followed by their value after refraction correction,
followed by the value after the inverse correction.  The values in
columns 1 and 3 are not quite the same; they differ by up to a few
arcseconds.

TODO: SkyObject::riseSetTime() does not take refraction into account,
so if you right-click on an object that is just above the south
horizon, the popup menu may indicate that it never rises!

CCMAIL: kstars-devel at kde.org



 M  +5 -1      detaildialog.cpp  
 M  +25 -9     skymapevents.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/detaildialog.cpp #732840:732841
@@ -45,6 +45,7 @@
 #include "ksplanetbase.h"
 #include "ksmoon.h"
 #include "thumbnailpicker.h"
+#include "Options.h"
 
 #include "indielement.h"
 #include "indiproperty.h"
@@ -270,7 +271,10 @@
     Pos->RA->setText( selectedObject->ra()->toHMSString() );
     Pos->Dec->setText( selectedObject->dec()->toDMSString() );
     Pos->Az->setText( selectedObject->az()->toDMSString() );
-    Pos->Alt->setText( selectedObject->alt()->toDMSString() );
+    dms a( selectedObject->alt()->Degrees() );
+    if ( Options::useAltAz() && Options::useRefraction() )
+        a = ksw->map()->refract( selectedObject->alt(), true ); //true: compute apparent alt from true alt
+    Pos->Alt->setText( a.toDMSString() );
 
     //Hour Angle can be negative, but dms HMS expressions cannot.
     //Here's a kludgy workaround:
--- trunk/KDE/kdeedu/kstars/kstars/skymapevents.cpp #732840:732841
@@ -317,14 +317,16 @@
         }
         break;
 
-        //DEBUG_KIO_JOB
-        // *** Testing KIO::Job stuff
+    //DEBUG_REFRACT
     case Qt::Key_Q:
         {
-            KUrl u( "http://www.30doradus.org/kstars/kstars-4.x.png" );
-            KIO::StoredTransferJob *j = KIO::storedGet( u, KIO::NoReload, KIO::HideProgressInfo );
-            j->setUiDelegate(0);
-            connect( j, SIGNAL( result(KJob*) ), SLOT( slotJobResult(KJob*) ) );
+            for ( double alt=-0.5; alt<30.5; alt+=1.0 ) {
+                dms a( alt );
+                dms b( refract( &a, true ) ); //find apparent alt from true alt
+                dms c( refract( &b, false ) );
+
+                kDebug() << a.toDMSString() << b.toDMSString() << c.toDMSString() << endl;
+            }
             break;
         }
 
@@ -570,14 +572,18 @@
 
         if ( ks ) {
             QString sX, sY, s;
-            sX = mousePoint()->az()->toDMSString(true);  //true = force +/- symbol
-            sY = mousePoint()->alt()->toDMSString(true); //true = force +/- symbol
+            sX = mousePoint()->az()->toDMSString(true);  //true: force +/- symbol
 
+            dms a( mousePoint()->alt()->Degrees() );
+            if ( Options::useAltAz() && Options::useRefraction() )
+                a = refract( mousePoint()->alt(), true ); //true: compute apparent alt from true alt
+            sY = a.toDMSString(true); //true: force +/- symbol
+
             s = sX + ",  " + sY;
             ks->statusBar()->changeItem( s, 1 );
 
             sX = mousePoint()->ra()->toHMSString();
-            sY = mousePoint()->dec()->toDMSString(true); //true = force +/- symbol
+            sY = mousePoint()->dec()->toDMSString(true); //true: force +/- symbol
             s = sX + ",  " + sY;
             ks->statusBar()->changeItem( s, 2 );
         }
@@ -679,6 +685,16 @@
         setClickedPoint( mousePoint() );
         clickedPoint()->EquatorialToHorizontal( data->LST, data->geo()->lat() );
 
+        //DEBUG
+        QPointF p = toScreen( clickedPoint() ); 
+        double dx2 = (width()/2.0 - p.x())/Options::zoomFactor();
+        double dy2 = (height()/2.0 - p.y())/Options::zoomFactor();
+        SkyPoint sp = fromScreen( dx2, dy2, data->LST, data->geo()->lat() );
+        kDebug() << "SP1: " << clickedPoint()->az()->toDMSString() 
+                << clickedPoint()->alt()->toDMSString() << endl;
+        kDebug() << "SP2: " << sp.az()->toDMSString() 
+                << sp.alt()->toDMSString() << endl;
+
         //Find object nearest to clickedPoint()
         double maxrad = 1000.0/Options::zoomFactor();
         setClickedObject( data->skyComposite()->objectNearest( clickedPoint(), maxrad ) );


More information about the Kstars-devel mailing list