[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kstars-devel
Subject:    [Kstars-devel]  KDE/kdeedu/kstars/kstars/skyobjects
From:       Victor Carbune <victor.carbune () gmail ! com>
Date:       2010-11-28 12:46:54
Message-ID: 20101128124654.DBA98AC8A3 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1201712 by vcarbune:

Google Code-in task for refraction: commiting just a small refactoring of
the code to get the global static method inside the SkyPoint class.

Ana also implemented a different refraction algorithm, which remains
available as a patch. Her analysis will be included in the documentation
for further references.

CCMAIL: kstars-devel@kde.org, costansin5@gmail.com



 M  +6 -7      skypoint.cpp  
 M  +6 -0      skypoint.h  


--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/skypoint.cpp #1201711:1201712
@@ -727,21 +727,20 @@
         return Alt;
 }
 
-// Calculate refraction correction. Parameter and return value are in degrees
-static double refractionCorr(double alt) {
+double SkyPoint::refractionCorr(double alt) {
     return 1.02 / tan(dms::DegToRad * ( alt + 10.3/(alt + 5.11) )) / 60;
 }
 // Critical height. Below this height formula produce meaningless
 // results and correction value is just interpolated
-static const double altCrit  = -1;
-static const double corrCrit = refractionCorr( altCrit );
 
 dms SkyPoint::refract(dms h) {
     const double alt = h.Degrees();
-    if( alt > altCrit )
-        return dms( alt + refractionCorr(alt) );
+    const double corrCrit = SkyPoint::refractionCorr( SkyPoint::altCrit );
+
+    if( alt > SkyPoint::altCrit )
+        return dms( alt + SkyPoint::refractionCorr(alt) );
     else
-        return dms( alt + corrCrit * (alt + 90) / (altCrit + 90) );
+        return dms( alt + corrCrit * (alt + 90) / (SkyPoint::altCrit + 90) );
 }
 
 // Found uncorrected value by solving equation. This is OK since
--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/skypoint.h #1201711:1201712
@@ -473,11 +473,17 @@
      */
     bool checkCircumpolar( const dms *gLat );
 
+    /** Calculate refraction correction. Parameter and return value are in degrees */
+    static double refractionCorr( double alt );
+
     /** Apply refraction correction to altitude. */
     static dms refract(dms h);
 
     /** Remove refraction correction. */
     static dms unrefract(dms h);
+
+    static const double altCrit  = -1;
+
 protected:
     /**Precess this SkyPoint's catalog coordinates to the epoch described by the
     	*given KSNumbers object.
_______________________________________________
Kstars-devel mailing list
Kstars-devel@kde.org
https://mail.kde.org/mailman/listinfo/kstars-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic