[Kstars-devel] kdeedu/kstars/kstars

Pablo de Vicente p.devicente at wanadoo.es
Sat Apr 30 23:24:56 CEST 2005


CVS commit by pvicente: 

Fixes a bug I have introduced when computing the velocity of an observer
on the surface of the Earth. This bug caused wrong topocentric computations
when the topocentric velocity was used. 
CCMAIL: kstars-devel at kde.org


  M +4 -3      geolocation.cpp   1.14
  M +7 -21     tools/modcalcvlsr.cpp   1.4


--- kdeedu/kstars/kstars/geolocation.cpp  #1.13:1.14
@@ -189,11 +189,12 @@ void GeoLocation::TopocentricVelocity(do
         
         dms time= GSTtoLST(gst);
-        angularVEarth.setRadians(time.Hours()*Wearth*3600.);
+        // angularVEarth.setRadians(time.Hours()*Wearth*3600.);
         double se, ce;
-        angularVEarth.SinCos(se,ce);
+        // angularVEarth.SinCos(se,ce);
+        time.SinCos(se,ce);
 
         double d0 = sqrt(PosCartX*PosCartX+PosCartY*PosCartY);
         // km/s
-        vtopo[0] = d0 * Wearth * se /1000.;
+        vtopo[0] = - d0 * Wearth * se /1000.;
         vtopo[1] = d0 * Wearth * ce /1000.;
         vtopo[2] = 0.;

--- kdeedu/kstars/kstars/tools/modcalcvlsr.cpp  #1.3:1.4
@@ -224,4 +224,8 @@ void modCalcVlsr::slotComputeVelocities(
         KStarsDateTime dt0;
         dt0.setFromEpoch(epoch0);
+        KStarsDateTime dt1 = getDateTime();
+        double vst[3];
+        dms gsidt = dt1.gst();
+        geoPlace->TopocentricVelocity(vst, gsidt);
 
         if ( radioVlsr->isChecked() ) {
@@ -231,13 +235,8 @@ void modCalcVlsr::slotComputeVelocities(
                 showHelVel( vhelio );
 
-                KStarsDateTime dt1 = getDateTime();
                 double vg = sp.vGeocentric(vhelio, dt1.djd());
                 showGeoVel( vg );
 
-                double vtopo[3];
-                dms gsidt = dt1.gst();
-                geoPlace->TopocentricVelocity(vtopo, gsidt);
-
-                showTopoVel ( sp.vTopocentric(vg, vtopo) );
+                showTopoVel ( sp.vTopocentric(vg, vst) );
                 
         } else if (radioVhelio->isChecked() ) {
@@ -247,18 +246,12 @@ void modCalcVlsr::slotComputeVelocities(
                 showVlsr(vlsr);
 
-                KStarsDateTime dt1 = getDateTime();
                 double vg = sp.vGeocentric(vhel, dt1.djd());
                 showGeoVel( vg );
 
-                double vtopo[3];
-                dms gsidt = dt1.gst();
-                geoPlace->TopocentricVelocity(vtopo, gsidt);
-
-                showTopoVel ( sp.vTopocentric(vg, vtopo) );
+                showTopoVel ( sp.vTopocentric(vg, vst) );
 
         } else if (radioVgeo->isChecked() ) {
 
                 double vgeo = getVgeo();
-                KStarsDateTime dt1 = getDateTime();
                 double vhel = sp.vGeoToVHelio(vgeo, dt1.djd() );
                 showHelVel(vhel) ;
@@ -267,16 +260,9 @@ void modCalcVlsr::slotComputeVelocities(
                 showVlsr(vlsr);
 
-                double vtopo[3];
-                dms gsidt = dt1.gst();
-                geoPlace->TopocentricVelocity(vtopo, gsidt);
 
-                showTopoVel ( sp.vTopocentric(vgeo, vtopo) );
+                showTopoVel ( sp.vTopocentric(vgeo, vst) );
 
         } else {
                 double vtopo = getVtopo();
-                KStarsDateTime dt1 = getDateTime();
-                dms gsidt = dt1.gst();
-                double vst[3];
-                geoPlace->TopocentricVelocity(vst, gsidt);
                 double vgeo = sp.vTopoToVGeo(vtopo, vst);
                 showGeoVel( vgeo );




More information about the Kstars-devel mailing list