53 #define LDEXP(x,y) ldexp(x,y)
55 #define LDEXP(x,y) std::ldexp(x,y)
63 unsigned initializationTest();
64 unsigned equalityTest();
66 unsigned relativityTest();
67 unsigned fitIntTest();
74 ObsID oi(ObservationType::NavMsg, CarrierBand::L5, TrackingCode::Y);
78 LDEXP(
double( int16_t(0xfe17)), -29),
79 LDEXP(
double( int16_t(0x0b0e)), -29),
80 LDEXP(
double( int16_t(0x22b4)), -5),
81 LDEXP(
double( int16_t(0xfde4)), -5),
82 LDEXP(
double( int16_t(0xffae)), -29),
83 LDEXP(
double( int16_t(0x0005)), -29),
84 LDEXP(
double( int32_t(0x2dbbccf8)), -31) *
PI,
85 LDEXP(
double( int16_t(0x35bb)), -43) *
PI,
87 LDEXP(
double(uint32_t(0x04473adb)), -33),
89 LDEXP(
double(uint32_t(0xa10dcc28)), -19),
91 LDEXP(
double( int32_t(0x3873d1d1)), -31) *
PI,
92 LDEXP(
double( int32_t(0x2747e88f)), -31) *
PI,
93 LDEXP(
double( int32_t(0xb078a8d5)), -31) *
PI,
94 LDEXP(
double( int32_t(0xffffa3c7)), -43) *
PI,
95 LDEXP(
double( int16_t(0xfdc6)), -43) *
PI
106 TUDEF(
"BrcKeplerOrbit",
"Default Constructor");
141 TUDEF(
"BrcKeplerOrbit",
"operator== / !=");
157 orbitCopy.
satSys =
"twaffle";
169 orbitCopy.
PRNID = 93;
181 orbitCopy.
URAoe = 943;
193 orbitCopy.
Cuc = 1.5e-12;
199 orbitCopy.
Cus = 1.7e-12;
205 orbitCopy.
Crc = 1.9e-12;
211 orbitCopy.
Crs = 2.1e-12;
217 orbitCopy.
Cic = 2.4e-12;
223 orbitCopy.
Cis = 2.5e-12;
229 orbitCopy.
M0 = 2.6e-12;
235 orbitCopy.
dn = 2.7e-12;
241 orbitCopy.
dndot = 2.8e-12;
247 orbitCopy.
ecc = 2.9e-12;
253 orbitCopy.
A = 3.0e-12;
259 orbitCopy.
Ahalf = 3.1e-12;
265 orbitCopy.
Adot = 3.2e-12;
271 orbitCopy.
OMEGA0 = 3.3e-12;
277 orbitCopy.
i0 = 3.4e-12;
283 orbitCopy.
w = 3.5e-12;
295 orbitCopy.
idot = 3.7e-12;
316 TUDEF(
"BrcKeplerOrbit",
"svXvt");
321 orbit.
loadData(
"GPS", oi, 2, toc, toc+7200,
323 -.324845314026e-05, .101532787085e-04, .168968750000e+03,
324 -.646250000000e+02, .320374965668e-06, .117346644402e-06,
325 -.136404614938e+01, .489591822036e-08, 0,
326 .146582192974e-01, .515359719276e+04 * .515359719276e+04,
327 .515359719276e+04, 0, -.296605403382e+01,
328 .941587707856e+00, -.224753761329e+01, -.804390648956e-08,
331 bool testFailed =
false;
335 static const unsigned SECONDS = 7200;
337 for (
unsigned ii = 0; ii < SECONDS; ii++)
344 for (
unsigned ii = 0; ii < SECONDS; ii++)
348 deriv[ii] = (1/h)*(-1.5*zeroth_array[ii].getPos() +
349 2.0*zeroth_array[ii+1].
getPos() -
350 0.5*zeroth_array[ii+2].
getPos());
352 else if ((ii == 1) || (ii == (SECONDS-2)))
354 deriv[ii] = (1/h)*(-0.5*zeroth_array[ii-1].getPos() +
355 0.5*zeroth_array[ii+1].
getPos());
357 else if (ii == (SECONDS-1))
359 deriv[ii] = (1/h)*(0.5*zeroth_array[ii-2].getPos() -
360 2.0*zeroth_array[ii-1].
getPos() +
361 1.5*zeroth_array[ii].
getPos());
365 deriv[ii] = (1/h)*((1.0/12.0)*zeroth_array[ii-2].
getPos() -
366 (2.0/3.0)*zeroth_array[ii-1].
getPos() +
367 (2.0/3.0)*zeroth_array[ii+1].
getPos() -
368 (1.0/12.0)*zeroth_array[ii+2].
getPos());
372 for (
unsigned ii = 0; ii < SECONDS; ii++)
374 double derivedMag = deriv[ii].
mag();
375 double computedMag = zeroth_array[ii].
getVel().
mag();
390 TUFAIL(
"computed velocity is significantly different from derived"
414 TUDEF(
"BrcKeplerOrbit",
"svRelativity");
426 TUDEF(
"BrcKeplerOrbit",
"getBeginningOfFitInterval");
433 TUCSM(
"getEndOfFitInterval");
435 TUCSM(
"withinFitInterval");
448 unsigned errorTotal = 0;
456 cout <<
"Total Failures for " << __FILE__ <<
": " << errorTotal << endl;