[Kstars-devel] kdeedu/kstars/kstars

Pablo de Vicente pvicentea at wanadoo.es
Fri Sep 5 15:31:44 CEST 2003


CVS commit by pvicente: 

Changed function GSTat0hUT. This function is called by GSTtoUT and the latter
by LSTtoUT and UTtoLST. Therefore the code here is used everywhere a time 
transformation is needed.

I have added a correction so that the function returns the apparent GST instead
of the mean GST. The correction is made by adding the term 
dEcLong*cos(obliquity) where dEcLong = the change in Ecliptic Longitude 
due to nutation, and obliquity is the obliquity of the ecliptic. The correction
may amount 0.3 seconds of time.

CCMAIL: kstars-devel at kde.org


  M +18 -0     ksutils.cpp   1.15


--- kdeedu/kstars/kstars/ksutils.cpp  #1.14:1.15
@@ -23,4 +23,5 @@
 #include "dms.h"
 #include "ksutils.h"
+#include "ksnumbers.h"
 
 long double KSUtils::UTtoJD(const QDateTime &t) {
@@ -152,4 +153,8 @@ QTime KSUtils::LSTtoUT( const dms &LST, 
 
 dms KSUtils::GSTat0hUT( const QDateTime &td ) {
+        double sinOb, cosOb;
+        
+        // Mean greenwich sidereal time
+        
         QDateTime t0( td.date(), QTime( 0, 0, 0 ) );
         long double jd0 = KSUtils::UTtoJD( t0 );
@@ -158,4 +163,17 @@ dms KSUtils::GSTat0hUT( const QDateTime 
         double t1 = 6.697374558 + 2400.051336*t + 0.000025862*t*t +
                 0.000000002*t*t*t;
+
+        // To obtain the apparent sidereal time, we have to correct the
+        // mean greenwich sidereal time with nutation in longitude multiplied
+        // by the cosine of the obliquity of the ecliptic. This correction
+        // is called nutation in right ascention, and may ammount 0.3 secs. 
+        
+        KSNumbers *num = new KSNumbers(jd0);
+        num->obliquity()->SinCos( sinOb, cosOb );
+        
+        // nutLong has to be in hours of time since t1 is hours of time.
+        double nutLong = num->dEcLong()*cosOb/15.0;
+
+        t1 += nutLong;
 
         dms gst;




More information about the Kstars-devel mailing list