From 4c3422ca6ae6a3331393a1d4ece481cdf3c984d2 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Fri, 20 Dec 2019 23:03:52 +0100 Subject: [PATCH] oops ephAge was integer only - potentially messing with doppler measurements --- ephemeris.cc | 4 ++-- ephemeris.hh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ephemeris.cc b/ephemeris.cc index b58f88f..28acb4d 100644 --- a/ephemeris.cc +++ b/ephemeris.cc @@ -13,9 +13,9 @@ */ // positive age = t0e in the past -int ephAge(int tow, int t0e) +double ephAge(double tow, int t0e) { - int diff = tow - t0e; + double diff = tow - t0e; if(diff > 3.5*86400) diff -= 604800; if(diff < -3.5*86400) diff --git a/ephemeris.hh b/ephemeris.hh index cf02606..d42d140 100644 --- a/ephemeris.hh +++ b/ephemeris.hh @@ -4,10 +4,10 @@ // lat, lon, height (rad, rad, meters) std::tuple ecefToWGS84(double x, double y, double z); -int ephAge(int tow, int t0e); +double ephAge(double tow, int t0e); template -void getCoordinates(double tow, const T& iod, Point* p, bool quiet=true) +double getCoordinates(double tow, const T& iod, Point* p, bool quiet=true) { using namespace std; // here goes @@ -71,7 +71,7 @@ void getCoordinates(double tow, const T& iod, Point* p, bool quiet=true) double A3 = pow(sqrtA, 6.0); double n0 = sqrt(mu/A3); - double tk = ephAge(tow, t0e); // in seconds, should do ephAge + double tk = ephAge(tow, t0e); double n = n0 + deltan; if(!quiet) @@ -153,7 +153,7 @@ void getCoordinates(double tow, const T& iod, Point* p, bool quiet=true) Vector radius(core, *p); cerr << radius.length() << " calculated r "<