def test_DopplerSine_computeDistance(): ''' Test distance for sine doppler ''' doppler = DopplerSine(1000., 77., 100., 50., 3.) assert abs(1000. - doppler.computeDistanceM(0.)) < EPSILON assert abs(1250. - doppler.computeDistanceM(1.5)) < EPSILON assert abs(1300. - doppler.computeDistanceM(3.)) < EPSILON
def test_DopplerSine_computeSpeed(): ''' Test speed for sine doppler ''' doppler = DopplerSine(1000., 77., 100., 50., 4.) assert abs(100. - doppler.computeSpeedMps(0.)) < EPSILON assert abs(150. - doppler.computeSpeedMps(1.)) < EPSILON assert abs(100. - doppler.computeSpeedMps(2.)) < EPSILON assert abs(50. - doppler.computeSpeedMps(3.)) < EPSILON assert abs(100. - doppler.computeSpeedMps(4.)) < EPSILON
def test_SVBase_doppler(): ''' Doppler control ''' sv = SVBase("TEST_SV") doppler = DopplerSine(10000, 55, 10, 15, 20) sv.setDoppler(doppler) assert sv.doppler == doppler assert sv.getDoppler() == doppler assert sv.isCodeDopplerIgnored() == doppler.isCodeDopplerIgnored() flag = not sv.isCodeDopplerIgnored() sv.setCodeDopplerIgnored(flag) assert flag == sv.isCodeDopplerIgnored()
def test_DopplerSine_computeDopplerShift1(): ''' Test distance for sine doppler ''' doppler = DopplerSine(1000., 77., 1., 50., 4.) userTimeAll_s = numpy.asarray([0., 1., 2., 3.]) shift = doppler.computeDopplerShiftM(userTimeAll_s) pi = scipy.constants.pi assert abs(0. - shift[0]) < EPSILON assert abs(1. + 50. * 4. / (2. * pi) - shift[1]) < EPSILON assert abs(2. + 2. * 50. * 4. / (2. * pi) - shift[2]) < EPSILON assert abs(3. + 50. * 4. / (2. * pi) - shift[3]) < EPSILON