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 "<