Example #1
0
 def generic_test(self, datafile=data_file, result="", fct=None):
     change_to_test_dir()
     testutils.test_row_by_row(fct,
                               datafile,
                               1.0,
                               result,
                               verbose=verbose,
                               tolerance=tolerance)
Example #2
0
 def generic_test(self, datafile=data_file, result="", fct=None):
     change_to_test_dir()
     testutils.test_row_by_row(fct,
                               datafile,
                               rate,
                               result,
                               verbose=verbose,
                               tolerance=tolerance,
                               frequency=True,
                               normalize=False)
def run():
	# hack to run script from its own directory
	abspath = os.path.abspath(__file__)
	dname = os.path.dirname(abspath)
	os.chdir(dname)

	data_file = '5071A_phase.txt'
	adev_result =  'adev_all.txt'
	oadev_result = 'oadev_all.txt'
	mdev_result =  'mdev_all.txt'
	tdev_result =  'tdev_all.txt'
	hdev_result =  'hdev_all.txt'
	ohdev_result = 'ohdev_all.txt'
	totdev_result ='totdev_all.txt'
	mtie_result =  'mtie_all.txt'
	tierms_result ='tierms_all.txt'
	verbose = 1
	
	tolerance = 1e-4
	rate = 1/float(1.0) # stable32 runs were done with this data-interval
	
	print "WARNING: this test takes a long time to run!!"
	print " ~12 minutes as of 2014-02-07 on an i7 CPU"
	print ""
	verbose = 0
	start0 = time.clock()
	start = print_elapsed(time.clock(), start0)
	
	testutils.test_row_by_row( allan.adev_phase, data_file, rate, adev_result , verbose, tolerance)   # 1.34 s
	start = print_elapsed(start, start0)
	
	testutils.test_row_by_row( allan.hdev_phase, data_file, rate, hdev_result, verbose, tolerance ) # 1.9 s
	start = print_elapsed(start, start0)
	
	testutils.test_row_by_row( allan.mtie_phase, data_file, rate, mtie_result, verbose, tolerance ) # 13 s
	start = print_elapsed(start, start0)
	
	testutils.test_row_by_row( allan.oadev_phase, data_file, rate, oadev_result, verbose, tolerance ) # 63 s
	start = print_elapsed(start, start0)
	
	testutils.test_row_by_row( allan.ohdev_phase, data_file, rate, ohdev_result, verbose, tolerance ) # 88 s
	start = print_elapsed(start, start0)
	
	testutils.test_row_by_row( allan.mdev_phase, data_file, rate, mdev_result, verbose, tolerance ) # 98 s
	start = print_elapsed(start, start0)
	
	testutils.test_row_by_row( allan.tdev_phase, data_file, rate, tdev_result, verbose, tolerance ) # 99 s
	start = print_elapsed(start, start0)
	
	testutils.test_row_by_row( allan.tierms_phase, data_file, rate, tierms_result, verbose, tolerance ) # 117 s
	start = print_elapsed(start, start0)
	
	testutils.test_row_by_row( allan.totdev_phase, data_file, rate, totdev_result, verbose, tolerance ) # 245 s
	start = print_elapsed(start, start0)
	
	
	end = time.clock()
	print "Tests done in %2.3f s" % (end-start0) # total time 470s on i7 CPU (without mtie!)
Example #4
0
 def generic_test(self, datafile = data_file, result="", fct=None):
     change_to_test_dir()
     testutils.test_row_by_row( fct, datafile, rate, result , verbose=verbose, tolerance=tolerance, frequency=True, normalize=False)
Example #5
0
 def generic_test(self, datafile = data_file, result="", fct=None):
     change_to_test_dir()
     testutils.test_row_by_row( fct, datafile, 1.0, result , verbose=verbose, tolerance=tolerance)
Example #6
0
def test_gps():
    # hack to run script from its own directory
    abspath = os.path.abspath(__file__)
    dname = os.path.dirname(abspath)
    os.chdir(dname)

    data_file = 'gps_1pps_phase_data.txt.gz'
    
    adev_result = 'stable32_ADEV_decade.txt'
    oadev_result = 'stable32_OADEV_octave.txt'
    mdev_result = 'stable32_MDEV_octave.txt'
    tdev_result = 'stable32_TDEV_octave.txt'
    hdev_result = 'stable32_HDEV_octave.txt'
    ohdev_result = 'stable32_OHDEV_octave.txt'
    totdev_result = 'stable32_TOTDEV_octave.txt'
    
    verbose = 1
    tolerance = 1e-4 # relative tolerance
    rate = 1/float(1.0) # 1 PPS measurements, data interval is 1 s

    start0 = time.clock()
    start = time.clock()

    
    testutils.test_row_by_row( allan.adev, data_file, rate, adev_result , verbose, tolerance)
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.oadev, data_file, rate, oadev_result, verbose, tolerance )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.mdev, data_file, rate, mdev_result, verbose, tolerance)
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.tdev, data_file, rate, tdev_result, verbose, tolerance )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.hdev, data_file, rate, hdev_result, verbose, tolerance )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.ohdev, data_file, rate, ohdev_result, verbose, tolerance )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.totdev, data_file, rate, totdev_result, verbose, tolerance )
    start = print_elapsed(start)
    
    print(" GPS tests took %.2f s" % ( time.clock()-start0 )) 
Example #7
0
def test_TIC():
    # hack to run script from its own directory
    abspath = os.path.abspath(__file__)
    dname = os.path.dirname(abspath)
    os.chdir(dname)

    data_file = 'tic_phase.txt'
    adev_result = 'tic_adev.txt'
    oadev_result = 'tic_oadev.txt'
    mdev_result = 'tic_mdev.txt'
    tdev_result = 'tic_tdev.txt'
    hdev_result = 'tic_hdev.txt'
    ohdev_result = 'tic_ohdev.txt'
    totdev_result = 'tic_totdev.txt'
    #mtie_result = 'mtie_fast.txt'
    tierms_result = 'tic_tierms.txt'
    
    verbose = 1
    
    tolerance = 1e-4
    rate = 1/float(1.0) # stable32 runs were done with this data-interval
    start0 = time.clock()
    start = print_elapsed(time.clock())
    
    testutils.test_row_by_row( allan.adev, data_file, rate, adev_result , verbose, tolerance)
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.oadev, data_file, rate, oadev_result, verbose, tolerance )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.mdev, data_file, rate, mdev_result, verbose, tolerance )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.tdev, data_file, rate, tdev_result, verbose, tolerance )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.hdev, data_file, rate, hdev_result, verbose, tolerance ) # 0.85 s
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.ohdev, data_file, rate, ohdev_result, verbose, tolerance ) # 5 s
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.tierms, data_file, rate, tierms_result, verbose, tolerance ) # 5.9 s
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.totdev, data_file, rate, totdev_result, verbose, tolerance ) # 13 s
    start = print_elapsed(start)
    
    #testutils.test_row_by_row( allan.mtie_phase, data_file, rate, mtie_result, verbose, tolerance ) # 13 s
    #start = print_elapsed(start)

    print(" TIC tests took %.2f s" % ( time.clock()-start0 )) 
Example #8
0
def run():
    # hack to run script from its own directory
    abspath = os.path.abspath(__file__)
    dname = os.path.dirname(abspath)
    os.chdir(dname)

    data_file = '5071A_phase.txt.gz'  # input data

    adev_result = 'adev_all.txt'
    oadev_result = 'oadev_all.txt'
    mdev_result = 'mdev_all.txt'
    tdev_result = 'tdev_all.txt'
    hdev_result = 'hdev_all.txt'
    ohdev_result = 'ohdev_all.txt'
    totdev_result = 'totdev_all.txt'
    mtie_result = 'mtie_all.txt'
    tierms_result = 'tierms_all.txt'
    verbose = 1

    tolerance = 1e-4
    rate = 1/float(1.0)  # stable32 runs were done with this data-interval

    print("WARNING: this test takes a long time to run!!")
    print(" ~12 minutes as of 2014-02-07 on an i7 CPU")
    print("")
    verbose = 0
    start0 = time.clock()
    start = print_elapsed('Starting..', time.clock(), start0)

    testutils.test_row_by_row(allan.adev, data_file,
                              rate, adev_result, verbose, tolerance)   # 1.34 s
    start = print_elapsed('ADEV', start, start0)

    testutils.test_row_by_row(allan.hdev, data_file,
                              rate, hdev_result, verbose, tolerance)  # 1.9 s
    start = print_elapsed('HDEV', start, start0)

    testutils.test_row_by_row(allan.mtie, data_file,
                              rate, mtie_result, verbose, tolerance)  # 13 s
    start = print_elapsed('MTIE', start, start0)

    testutils.test_row_by_row(allan.oadev, data_file,
                              rate, oadev_result, verbose, tolerance)  # 63 s
    start = print_elapsed('OADEV', start, start0)

    testutils.test_row_by_row(allan.ohdev, data_file,
                              rate, ohdev_result, verbose, tolerance)  # 88 s
    start = print_elapsed('OHDEV', start, start0)

    testutils.test_row_by_row(allan.mdev, data_file,
                              rate, mdev_result, verbose, tolerance)  # 98 s
    start = print_elapsed('MDEV', start, start0)

    testutils.test_row_by_row(allan.tdev, data_file,
                              rate, tdev_result, verbose, tolerance)  # 99 s
    start = print_elapsed('TDEV', start, start0)

    testutils.test_row_by_row(allan.tierms, data_file,
                              rate, tierms_result, verbose, tolerance)  # 117 s
    start = print_elapsed('TIERMS', start, start0)

    testutils.test_row_by_row(allan.totdev, data_file,
                              rate, totdev_result, verbose, tolerance)  # 245 s
    start = print_elapsed('TOTDEV', start, start0)

    end = time.clock()
    # total time 470s on i7 CPU (without mtie!)
    print("Tests done in %2.3f s" % (end-start0))
Example #9
0
def run():
    # hack to run script from its own directory
    abspath = os.path.abspath(__file__)
    dname = os.path.dirname(abspath)
    os.chdir(dname)

    data_file = 'ocxo_frequency.txt'
    
    adev_result = 'stable32_adev_alltau.txt'
    oadev_result = 'stable32_oadev_alltau.txt'
    mdev_result = 'stable32_mdev_alltau.txt'
    tdev_result = 'stable32_tdev_alltau.txt'
    hdev_result = 'stable32_hdev_alltau.txt'
    ohdev_result = 'stable32_ohdev_alltau.txt'
    totdev_result = 'stable32_totdev_alltau.txt'
    
    verbose = 1
    tolerance = 1e-4 # relative tolerance
    rate = 1/float(1.0) # stable32 runs were done with this data-interval

    start0 = time.clock()
    start = time.clock()
    
    testutils.test_row_by_row( allan.adev, data_file, rate, adev_result , verbose, tolerance, normalize=True)
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.oadev, data_file, rate, oadev_result, verbose, tolerance, normalize=True )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.mdev, data_file, rate, mdev_result, verbose, tolerance, normalize=True)
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.tdev, data_file, rate, tdev_result, verbose, tolerance, normalize=True )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.hdev, data_file, rate, hdev_result, verbose, tolerance, normalize=True )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.ohdev, data_file, rate, ohdev_result, verbose, tolerance, normalize=True  )
    start = print_elapsed(start)
    
    testutils.test_row_by_row( allan.totdev, data_file, rate, totdev_result, verbose, tolerance, normalize=True  )
    start = print_elapsed(start)
    
    print " OCXO tests took %.2f s" % ( time.clock()-start0 )