def test_tracking(): prn = 15 init_doppler = 1234 init_code_phase = 0 file_format = '2bits_x2' freq_profile = 'low_rate' skip_param = '--skip-ms' skip_val = 0 samples_filename = generate_sample_file(prn, init_doppler, init_code_phase, file_format, freq_profile) run_peregrine(samples_filename, file_format, freq_profile, skip_param, skip_val, False) # Comparison not working on Travis at the moment, needs further debugging. # Simply make sure tracking runs successfully for now. #with open(NEW_TRK_RES, 'rb') as f: # new_trk_results = cPickle.load(f) #with open(OLD_TRK_RES, 'rb') as f: # old_trk_results = cPickle.load(f) #assert new_trk_results == old_trk_results # Clean-up. os.remove(samples_filename)
def run_acq_test(init_doppler, init_code_phase, prns, file_format, freq_profile='low_rate', skip_samples=None, skip_ms=None): if skip_samples is not None: skip_param = '--skip-samples' skip_val = skip_samples elif skip_ms is not None: skip_param = '--skip-ms' skip_val = skip_ms else: skip_param = '--skip-ms' skip_val = 0 for prn in prns: samples_filename = generate_sample_file(prn, init_doppler, init_code_phase, file_format, freq_profile) run_peregrine(samples_filename, file_format, freq_profile, skip_param, skip_val) code_phase = propagate_code_phase(init_code_phase, get_sampling_freq(freq_profile), skip_param, skip_val) if skip_val == 0: check_acq_results(samples_filename, prn, init_doppler, code_phase) # Clean-up. os.remove(get_acq_result_file_name(samples_filename)) os.remove(samples_filename)
def test_tracking(): """ Test GPS L1C/A and L2C tracking """ prn = 1 init_doppler = 555 init_code_phase = 0 file_format = '2bits_x2' freq_profile = 'low_rate' samples = generate_sample_file(prn, init_doppler, init_code_phase, file_format, freq_profile, generate=5) run_track_test(samples, 0.6, init_doppler, init_code_phase, prn, file_format, freq_profile) run_track_test(samples, 0.3, init_doppler, init_code_phase, prn, file_format, freq_profile, pipelining=0.5) run_track_test(samples, 0.3, init_doppler, init_code_phase, prn, file_format, freq_profile, short_long_cycles=0.5) os.remove(samples) # test --no-run run_tracking_loop(1, L1CA, 0, 0, 'dummy', '2bits_x2', 'low_rate', 0, norun=True) # Test with different initial code phases # for code_phase in [0, 310, 620, 967]: # run_acq_test(-2345, code_phase, prns, '2bits') try: TrackingLoop().start(None, None,) assert False except NotImplementedError: pass try: TrackingLoop().update(None, None, None) assert False except NotImplementedError: pass try: NavBitSync().update_bit_sync(0, 0) assert False except NotImplementedError: pass nvb = NavBitSync() # Test ._equal nvb.synced = True assert NavBitSync() != nvb nvb.dummy = 'dummy' assert NavBitSync() != nvb # Test constructors assert NBSMatchBit() assert NavBitSyncSBAS() assert NBSSBAS() assert NBSLibSwiftNav() assert NBSHistogram() assert NBSMatchEdge()
def test_tracking(): """ Test GPS L1C/A and L2C tracking """ prn = 1 init_doppler = 555 init_code_phase = 0 file_format = '2bits_x2' freq_profile = 'low_rate' samples = generate_sample_file(prn, init_doppler, init_code_phase, file_format, freq_profile, generate=5) run_track_test(samples, 0.6, init_doppler, init_code_phase, prn, file_format, freq_profile) run_track_test(samples, 0.3, init_doppler, init_code_phase, prn, file_format, freq_profile, pipelining=0.5) run_track_test(samples, 0.3, init_doppler, init_code_phase, prn, file_format, freq_profile, short_long_cycles=0.5) os.remove(samples) # test --no-run run_tracking_loop(1, L1CA, 0, 0, 'dummy', '2bits_x2', 'low_rate', 0, norun=True) # Test with different initial code phases # for code_phase in [0, 310, 620, 967]: # run_acq_test(-2345, code_phase, prns, '2bits') try: TrackingLoop().start( None, None, ) assert False except NotImplementedError: pass try: TrackingLoop().update(None, None, None) assert False except NotImplementedError: pass try: NavBitSync().update_bit_sync(0, 0) assert False except NotImplementedError: pass nvb = NavBitSync() # Test ._equal nvb.synced = True assert NavBitSync() != nvb nvb.dummy = 'dummy' assert NavBitSync() != nvb # Test constructors assert NBSMatchBit() assert NavBitSyncSBAS() assert NBSSBAS() assert NBSLibSwiftNav() assert NBSHistogram() assert NBSMatchEdge()