[Kstars-devel] branches/kstars/hdevalence/kstars/kstars/projections

Henry de Valence hdevalence at gmail.com
Sun Aug 8 23:20:54 CEST 2010


SVN commit 1160714 by hdevalence:

Don't use altRefracted() in checkVisibility().

SkyPoint::altRefracted() is approximately 35 times slower than SkyPoint::alt(),
and 70% of the total time spent in checkVisibility() is spent on altRefracted().

CCMAIL:kstars-devel at kde.org


 M  +3 -1      projector.cpp  


--- branches/kstars/hdevalence/kstars/kstars/projections/projector.cpp #1160713:1160714
@@ -200,7 +200,9 @@
     if( m_vp.fillGround /*&& m_vp.useAltAz*/ && p->alt().Degrees() < -1.0 ) return false;
 
     if ( m_vp.useAltAz ) {
-        dY = fabs( p->altRefracted().Degrees() - m_vp.focus->alt().Degrees() );
+        /** To avoid calculating refraction, we just use the unrefracted
+            altitude and add a 2-degree 'safety factor' */
+        dY = fabs( p->alt().Degrees() - m_vp.focus->alt().Degrees() ) -2.;
     } else {
         dY = fabs( p->dec().Degrees() - m_vp.focus->dec().Degrees() );
     }


More information about the Kstars-devel mailing list