def test_noise_id(self): """ test for noise-identification """ s32_rows = testutils.read_stable32( 'mdev_octave.txt' , rate ) freq = testutils.read_datafile(data_file) y_freq = allan.frequency2fractional(freq, mean_frequency=1.0e7) phase = allan.frequency2phase(freq, rate) for s32 in s32_rows: s32_tau, s32_alpha, s32_AF = s32['tau'], s32['alpha'], int(s32['m']) # noise-ID from frequency if len(phase)/s32_AF > 20: alpha_int, alpha, d, rho = allan.autocorr_noise_id(freq, data_type='freq', af=s32_AF ) print( "y: ",s32_tau, s32_alpha, alpha_int, alpha, rho, d ) assert alpha_int == s32_alpha # noise-ID from phase if len(phase)/s32_AF > 20: alpha_int, alpha, d, rho = allan.autocorr_noise_id( phase, data_type='phase', af=s32_AF ) print( "x: ",s32_tau, s32_alpha, alpha_int, alpha, rho, d ) assert alpha_int == s32_alpha
def test_noise_id(self): """ test for noise-identification """ s32_rows = testutils.read_stable32( 'tic_oadev.txt' , 1.0 ) phase = testutils.read_datafile(data_file) for s32 in s32_rows: tau, alpha, af = s32['tau'], s32['alpha'], int(s32['m']) try: alpha_int = allan.autocorr_noise_id( phase , af=af)[0] #if len(phase)/af > 30: # noise-id only works for length 30 or longer time-series assert alpha_int == alpha print( tau, alpha, alpha_int ) except NotImplementedError: print ("no noise-ID: ",tau, alpha, alpha_int )
def test_noise_id(self): """ test for noise-identification """ s32_rows = testutils.read_stable32('stable32_ADEV_decade.txt', rate) phase = testutils.read_datafile('gps_1pps_phase_data.txt.gz') # test noise-ID for s32 in s32_rows: tau, alpha, AF = s32['tau'], s32['alpha'], int(s32['m']) try: alpha_int = allan.autocorr_noise_id(phase, af=AF)[0] print(tau, alpha, alpha_int) assert alpha_int == alpha except NotImplementedError: print("can't do noise-ID for tau= %f" % s32['tau'])
def test_noise_id(self): """ test for noise-identification """ s32_rows = testutils.read_stable32( 'phase_dat_oadev_octave.txt' , 1.0 ) phase = testutils.read_datafile('PHASE.DAT') for s32 in s32_rows: tau, alpha, af = s32['tau'], s32['alpha'], int(s32['m']) try: alpha_int = allan.autocorr_noise_id( phase , af=af)[0] assert alpha_int == alpha except: print("can't do noise-ID for af= ",af) pass print( tau, alpha, alpha_int )
def test_noise_id(self): """ test for noise-identification """ s32_rows = testutils.read_stable32('stable32_ADEV_decade.txt', rate) phase = testutils.read_datafile('gps_1pps_phase_data.txt.gz') # test noise-ID for s32 in s32_rows: tau, alpha, AF = s32['tau'], s32['alpha'], int(s32['m']) try: alpha_int = allan.autocorr_noise_id(phase, af=AF)[0] print(tau, alpha, alpha_int) assert alpha_int == alpha except NotImplementedError: print("can't do noise-ID for tau= %f"%s32['tau'])
def test_noise_id(self): """ test for noise-identification """ s32_rows = testutils.read_stable32('phase_dat_oadev_octave.txt', 1.0) phase = testutils.read_datafile('PHASE.DAT') for s32 in s32_rows: tau, alpha, af = s32['tau'], s32['alpha'], int(s32['m']) try: alpha_int = allan.autocorr_noise_id(phase, af=af)[0] assert alpha_int == alpha print("OK noise-ID for af = %d" % af) except: print("can't do noise-ID for af = %d" % af) print("tau= %f, alpha= %f, alpha_int = %d" % (tau, alpha, alpha_int))
nr = pow(2,14) # np.random.choice(nrrange) brange = [0,-1, -2, -3, -4, -5] pts=[[], [], [], [], [], []] # 6 different b-values for n in range(N_points): b = np.random.choice(brange) taus=np.logspace(0,np.log10( nr/30.0 ),200) # note we stop at 30 pts series length taus = [int(t) for t in taus] taus = remove_duplicates(taus) af = np.random.choice( taus ) ng.set_input(nr,qd,b) ng.generateNoise() x = ng.time_series alpha_int, alpha, rho, d = at.autocorr_noise_id(x, af, data_type="phase", dmin=0, dmax=2) pts[-1*b].append( ( af, alpha, alpha_int) ) print("calc done") colors = { 0:'r', -1:'g', -2:'b', -3:'m', -4:'k', -5:'y'} for (series, idx) in zip(pts, range(len(pts))): b=-idx af = [s[0] for s in series] alpha = [s[1] for s in series] alphai = [s[2] for s in series] plt.semilogx( af, alpha, "%s."%colors[b],label='b=%d'%b) #plt.semilogx( af, alphai, "%so"%colors[b],label='b=%d'%b) # integer alpha print("plot done") plt.ylim((-4,3)) plt.xlim((.8,1e3))
nr = pow(2,14) # np.random.choice(nrrange) brange = [0,-1, -2, -3, -4, -5] pts=[[], [], [], [], [], []] # 6 different b-values for n in range(N_points): b = np.random.choice(brange) taus=np.logspace(0,np.log10( nr/30.0 ),200) # note we stop at 30 pts series length taus = [int(t) for t in taus] taus = remove_duplicates(taus) af = np.random.choice( taus ) ng.set_input(nr,qd,b) ng.generateNoise() x = ng.time_series alpha_int, alpha, rho, d = at.autocorr_noise_id(x, af, data_type="phase", dmin=0, dmax=2) pts[-1*b].append( ( af, alpha, alpha_int) ) print "calc done" colors = { 0:'r', -1:'g', -2:'b', -3:'m', -4:'k', -5:'y'} for (series, idx) in zip(pts, range(len(pts))): b=-idx af = [s[0] for s in series] alpha = [s[1] for s in series] alphai = [s[2] for s in series] plt.semilogx( af, alpha, "%s."%colors[b],label='b=%d'%b) #plt.semilogx( af, alphai, "%so"%colors[b],label='b=%d'%b) # integer alpha print "plot done" plt.ylim((-4,3)) plt.xlim((.8,1e3))