In [1]:
%load_ext autoreload
#%autoreload 2
%matplotlib inline

execfile ("_ImportScript.py")


1

In [2]:
import time
import matplotlib.pyplot as plt

In [3]:
beatbox.You.create_original_Universe()
#beatbox.You.initiate_simulated_universe(truncated_nmax=20)

In [4]:
beatbox.You.initiate_simulated_universe(truncated_nmax=5)


Generated  514  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
/Users/LaurencePeanuts/Documents/Travail/Stanford/Music/Music/beatbox/universe.py:580: RuntimeWarning: divide by zero encountered in power
  self.Power_Spectrum = self.PSnorm*10000*np.power((self.k/self.kstar) ,(-3+(self.n_s-1)))

In [ ]:
beatbox.You.all_simulated_universes[0].show_CMB_T_map()
ordered_inds_largenmax = beatbox.You.all_simulated_universes[0].get_ordered_fn_indices()

In [5]:
if not os.path.isfile('../data/covCyy_lmax%d_lmin%d.txt' % (beatbox.Multiverse.truncated_lmax, beatbox.Multiverse.truncated_lmin)):
    beatbox.You.read_Planck_samples()
    beatbox.You.calculate_covariance_matrix(filename='lmax%d_lmin%d' % (beatbox.Multiverse.truncated_lmax, beatbox.Multiverse.truncated_lmin))
else:
    beatbox.You.load_covariance_matrix(filename='covCyy_lmax%d_lmin%d.txt' % (beatbox.Multiverse.truncated_lmax, beatbox.Multiverse.truncated_lmin))
    
# Calculate the inverse of the a_y covariance matrix
beatbox.You.calculate_sdv_Cyy_inverse()

datamap = beatbox.You.all_simulated_universes[0].ay2ayreal_for_inference(beatbox.You.all_simulated_universes[0].ay)+beatbox.You.generate_one_realization_of_noise()
 

MOCK = 1



#execfile ("_ReconstructionScript.py")


/Users/LaurencePeanuts/Documents/Travail/Stanford/Music/Music/beatbox/universe.py:414: ComplexWarning: Casting complex values to real discards the imaginary part
  ay_real[zero_ind] = value[zero_ind].astype(np.float)

In [6]:
beatbox.You.solve_for_3D_potential(datamap.T , A=None, print_alpha=0)


0.00119590759277
total time is:
0.0369589328766
/Users/LaurencePeanuts/Documents/Travail/Stanford/Music/Music/beatbox/multiverse.py:493: ComplexWarning: Casting complex values to real discards the imaginary part
  R_real[zero_ind,:] = beatbox.Universe.R[zero_ind,:].astype(np.float)
/Users/LaurencePeanuts/Documents/Travail/Stanford/Music/Music/beatbox/multiverse.py:439: RuntimeWarning: divide by zero encountered in power
  Power_Spectrum = PSnorm*10000*np.power((beatbox.Universe.k/kstar) ,(-3+(n_s-1)))

In [ ]:
# np.savetxt( "/Users/LaurencePeanuts/Dropbox/KleineBar_KlaineTiger/MUSIC/2018/Acov_inv.txt", beatbox.You.inv_A)
# np.savetxt( "/Users/LaurencePeanuts/Dropbox/KleineBar_KlaineTiger/MUSIC/2018/Yash1.txt", beatbox.You.Yash1)
# np.savetxt( "/Users/LaurencePeanuts/Dropbox/KleineBar_KlaineTiger/MUSIC/2018/Yash2.txt", beatbox.You.Yash2)

In [ ]:
We = beatbox.Universe()
We.fn = beatbox.You.reconstrunct_fn
#We.fn = beatbox.You.all_simulated_universes[-1].fn * 0.5
We.transform_3D_potential_into_alm(usedefault=1, fn=1)
We.show_CMB_T_map(title = "Best Fit Model", from_perspective_of="observer", max=100)
We.rearrange_fn_from_vector_to_grid()
We.evaluate_potential_given_fourier_coefficients()
ordered_inds_smallnmax = We.get_ordered_fn_indices()

In [ ]:
beatbox.You.all_simulated_universes[0].show_CMB_T_map()

In [ ]:


In [ ]:
beatbox.You.inv_A = beatbox.You.calculate_pure_A_inverse()

In [ ]:
# beatbox.You.load_A_matrix('nmax14', inv = 'y')
plt.plot(We.fn[ordered_inds_smallnmax ], '*')
plt.errorbar(range(len(We.fn)), We.fn[ordered_inds_smallnmax ], yerr = np.sqrt(np.diag(beatbox.You.inv_A))[ordered_inds_smallnmax ])
plt.plot(beatbox.You.all_simulated_universes[0].fn[ordered_inds_largenmax],  'x')
plt.axis([0, 256, -10, 10])

In [ ]:
frac = np.abs(np.divide((We.fn - beatbox.You.all_simulated_universes[0].fn),  np.sqrt(np.diag(beatbox.You.inv_A))))
print frac

In [ ]:
print np.double(np.sum(frac<=1))/np.double(len(frac))

In [ ]:
numreal = 100

for i in range(numreal):
    beatbox.You.initiate_simulated_universe()

In [ ]:
numCp = np.zeros(len(beatbox.You.all_simulated_universes[0].fn))


for j in range(len(beatbox.You.all_simulated_universes[0].fn)):
    fns = [beatbox.You.all_simulated_universes[i].fn[j] for i in range(numreal)]
    numCp[j] = 1./(np.std(fns)**2)

In [ ]:
print np.mean(numCp)

In [ ]:
beatbox.You.solve_for_3D_potential(datamap.T , A=None, print_alpha=0)

In [ ]:
plt.plot( np.divide(numCp , np.diag(beatbox.You.inv_Cf) ))

In [ ]:
ind = np.where(beatbox.Universe.kfilter>0)

print ind[]

In [ ]:
# Check calculated k covariance from samples, against prior covariance matrix
numCp = np.zeros(len(beatbox.You.all_simulated_universes[0].fn))
for j in range(len(beatbox.You.all_simulated_universes[0].fn)):
    fns = [beatbox.You.all_simulated_universes[i].fn[j] for i in range(numreal)]
    numCp[j] = np.std(fns) #1./(np.std(fns)**2)

plt.semilogy(numCp[ordered_inds_smallnmax])
plt.semilogy(1/np.sqrt(np.diag(beatbox.You.inv_Cf)[ordered_inds_smallnmax]),'--')

In [7]:
#Calculate coverage prob for 1sig
numreal = 100
cov_frac = np.zeros((numreal,1))

for i in range(numreal):
    print i
    beatbox.You.initiate_simulated_universe(truncated_nmax=10)
    if i == 0:
        ordered_inds_largenmax = beatbox.You.all_simulated_universes[i].get_ordered_fn_indices()
    datamap = beatbox.You.all_simulated_universes[i].ay2ayreal_for_inference(beatbox.You.all_simulated_universes[i].ay)+beatbox.You.generate_one_realization_of_noise()
    beatbox.You.solve_for_3D_potential(datamap.T , A=1, print_alpha=0)
    
    We=beatbox.Universe()        
    beatbox.You.all_data_universes = np.append(beatbox.You.all_data_universes,We)
    beatbox.You.all_data_universes[i].fn = beatbox.You.reconstrunct_fn
    num_fn = len(beatbox.You.reconstrunct_fn)
    if i == 0:
        ordered_inds_smallnmax = beatbox.You.all_data_universes[i].get_ordered_fn_indices()
    
    abs_diff = np.abs(beatbox.You.all_data_universes[i].fn[ordered_inds_smallnmax].reshape(-1,1) - (beatbox.You.all_simulated_universes[i].fn[ordered_inds_largenmax[:num_fn]]).reshape(-1,1))
    err_sig = np.sqrt(np.diag(beatbox.You.inv_A)[ordered_inds_smallnmax])
    diff_sigma = np.divide(abs_diff , err_sig ).reshape(-1,1)
    cov_frac[i,0] = np.double(np.sum(diff_sigma<=1)) / np.double(len(diff_sigma))
print diff_sigma


0
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000549077987671
time for loading is:
0.00791501998901
successfully loaded A from the disk.
total time is:
0.00976896286011
1
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000330924987793
time for loading is:
0.00165605545044
successfully loaded A from the disk.
total time is:
0.00271892547607
2
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.00032901763916
time for loading is:
0.00124621391296
successfully loaded A from the disk.
total time is:
0.00239992141724
3
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000885009765625
time for loading is:
0.0112521648407
successfully loaded A from the disk.
total time is:
0.0139400959015
4
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000482797622681
time for loading is:
0.00163292884827
successfully loaded A from the disk.
total time is:
0.00300288200378
5
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000465869903564
time for loading is:
0.00105500221252
successfully loaded A from the disk.
total time is:
0.00287294387817
6
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000330924987793
time for loading is:
0.00167894363403
successfully loaded A from the disk.
total time is:
0.00333094596863
7
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000541925430298
time for loading is:
0.001620054245
successfully loaded A from the disk.
total time is:
0.00287795066833
8
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000509977340698
time for loading is:
0.00133681297302
successfully loaded A from the disk.
total time is:
0.00318598747253
9
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000320911407471
time for loading is:
0.00591206550598
successfully loaded A from the disk.
total time is:
0.00729393959045
10
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.00048303604126
time for loading is:
0.00340604782104
successfully loaded A from the disk.
total time is:
0.00483107566833
11
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000344038009644
time for loading is:
0.00132489204407
successfully loaded A from the disk.
total time is:
0.00242304801941
12
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000484943389893
time for loading is:
0.00444483757019
successfully loaded A from the disk.
total time is:
0.0165221691132
13
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000332832336426
time for loading is:
0.00159192085266
successfully loaded A from the disk.
total time is:
0.00272083282471
14
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000330924987793
time for loading is:
0.00104594230652
successfully loaded A from the disk.
total time is:
0.00205898284912
15
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000319004058838
time for loading is:
0.00144982337952
successfully loaded A from the disk.
total time is:
0.002525806427
16
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000534057617188
time for loading is:
0.00167298316956
successfully loaded A from the disk.
total time is:
0.00314211845398
17
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000325918197632
time for loading is:
0.00110101699829
successfully loaded A from the disk.
total time is:
0.00206708908081
18
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000326156616211
time for loading is:
0.00146198272705
successfully loaded A from the disk.
total time is:
0.00249910354614
19
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.00034499168396
time for loading is:
0.00154280662537
successfully loaded A from the disk.
total time is:
0.00264406204224
20
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000332832336426
time for loading is:
0.000910997390747
successfully loaded A from the disk.
total time is:
0.00186586380005
21
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000330924987793
time for loading is:
0.00283002853394
successfully loaded A from the disk.
total time is:
0.00384998321533
22
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000339984893799
time for loading is:
0.00143694877625
successfully loaded A from the disk.
total time is:
0.00251793861389
23
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000487804412842
time for loading is:
0.000985860824585
successfully loaded A from the disk.
total time is:
0.00231790542603
24
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.00032114982605
time for loading is:
0.0012788772583
successfully loaded A from the disk.
total time is:
0.00221109390259
25
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000339031219482
time for loading is:
0.00164794921875
successfully loaded A from the disk.
total time is:
0.00282716751099
26
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000418186187744
time for loading is:
0.000980138778687
successfully loaded A from the disk.
total time is:
0.00211811065674
27
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.00128388404846
successfully loaded A from the disk.
total time is:
0.00220608711243
28
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000541925430298
time for loading is:
0.00156188011169
successfully loaded A from the disk.
total time is:
0.0029878616333
29
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000410079956055
time for loading is:
0.00102114677429
successfully loaded A from the disk.
total time is:
0.00207591056824
30
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000483989715576
time for loading is:
0.00142908096313
successfully loaded A from the disk.
total time is:
0.00272607803345
31
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000322818756104
time for loading is:
0.00155711174011
successfully loaded A from the disk.
total time is:
0.0025429725647
32
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.000885009765625
successfully loaded A from the disk.
total time is:
0.00184607505798
33
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000322103500366
time for loading is:
0.00115299224854
successfully loaded A from the disk.
total time is:
0.00207114219666
34
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000329971313477
time for loading is:
0.00153708457947
successfully loaded A from the disk.
total time is:
0.00255703926086
35
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000342130661011
time for loading is:
0.00123810768127
successfully loaded A from the disk.
total time is:
0.00226402282715
36
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000323057174683
time for loading is:
0.00141501426697
successfully loaded A from the disk.
total time is:
0.002357006073
37
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000501871109009
time for loading is:
0.00162100791931
successfully loaded A from the disk.
total time is:
0.00301885604858
38
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324964523315
time for loading is:
0.000962018966675
successfully loaded A from the disk.
total time is:
0.00192999839783
39
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000330924987793
time for loading is:
0.00129795074463
successfully loaded A from the disk.
total time is:
0.00229287147522
40
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000337839126587
time for loading is:
0.00138711929321
successfully loaded A from the disk.
total time is:
0.00240302085876
41
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.000856161117554
successfully loaded A from the disk.
total time is:
0.00185799598694
42
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000363111495972
time for loading is:
0.00131297111511
successfully loaded A from the disk.
total time is:
0.00251293182373
43
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.00032114982605
time for loading is:
0.0012891292572
successfully loaded A from the disk.
total time is:
0.0022292137146
44
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000340938568115
time for loading is:
0.00112891197205
successfully loaded A from the disk.
total time is:
0.00213193893433
45
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.0013439655304
successfully loaded A from the disk.
total time is:
0.00229597091675
46
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000316858291626
time for loading is:
0.00132608413696
successfully loaded A from the disk.
total time is:
0.0022759437561
47
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000319957733154
time for loading is:
0.00101804733276
successfully loaded A from the disk.
total time is:
0.00194597244263
48
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000319957733154
time for loading is:
0.00132298469543
successfully loaded A from the disk.
total time is:
0.0022599697113
49
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000321865081787
time for loading is:
0.00141716003418
successfully loaded A from the disk.
total time is:
0.00236988067627
50
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000334024429321
time for loading is:
0.00102806091309
successfully loaded A from the disk.
total time is:
0.00199294090271
51
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000323057174683
time for loading is:
0.00135612487793
successfully loaded A from the disk.
total time is:
0.00229692459106
52
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000326156616211
time for loading is:
0.00129508972168
successfully loaded A from the disk.
total time is:
0.00224804878235
53
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000331163406372
time for loading is:
0.00103783607483
successfully loaded A from the disk.
total time is:
0.00209808349609
54
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000319957733154
time for loading is:
0.00115394592285
successfully loaded A from the disk.
total time is:
0.00205898284912
55
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000338077545166
time for loading is:
0.0013701915741
successfully loaded A from the disk.
total time is:
0.00234007835388
56
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000320196151733
time for loading is:
0.00110197067261
successfully loaded A from the disk.
total time is:
0.00215816497803
57
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000320196151733
time for loading is:
0.00122308731079
successfully loaded A from the disk.
total time is:
0.00217914581299
58
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000331163406372
time for loading is:
0.0013530254364
successfully loaded A from the disk.
total time is:
0.00239205360413
59
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000336885452271
time for loading is:
0.000854015350342
successfully loaded A from the disk.
total time is:
0.00190997123718
60
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000321865081787
time for loading is:
0.00138902664185
successfully loaded A from the disk.
total time is:
0.00237488746643
61
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000320911407471
time for loading is:
0.00136303901672
successfully loaded A from the disk.
total time is:
0.00236392021179
62
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000321865081787
time for loading is:
0.000960826873779
successfully loaded A from the disk.
total time is:
0.00203895568848
63
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000321865081787
time for loading is:
0.00125813484192
successfully loaded A from the disk.
total time is:
0.00221800804138
64
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000338077545166
time for loading is:
0.00161194801331
successfully loaded A from the disk.
total time is:
0.00264811515808
65
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.00107002258301
successfully loaded A from the disk.
total time is:
0.00209593772888
66
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000321865081787
time for loading is:
0.00121784210205
successfully loaded A from the disk.
total time is:
0.00215888023376
67
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000355005264282
time for loading is:
0.00145602226257
successfully loaded A from the disk.
total time is:
0.00240182876587
68
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000326871871948
time for loading is:
0.0010461807251
successfully loaded A from the disk.
total time is:
0.00203895568848
69
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000323057174683
time for loading is:
0.0013599395752
successfully loaded A from the disk.
total time is:
0.00232601165771
70
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000319957733154
time for loading is:
0.00139307975769
successfully loaded A from the disk.
total time is:
0.00234484672546
71
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000330924987793
time for loading is:
0.000963926315308
successfully loaded A from the disk.
total time is:
0.0019850730896
72
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.00131797790527
successfully loaded A from the disk.
total time is:
0.00228095054626
73
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000367164611816
time for loading is:
0.00142812728882
successfully loaded A from the disk.
total time is:
0.00241613388062
74
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.000996112823486
successfully loaded A from the disk.
total time is:
0.00212287902832
75
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.00122904777527
successfully loaded A from the disk.
total time is:
0.00219106674194
76
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000346899032593
time for loading is:
0.00163292884827
successfully loaded A from the disk.
total time is:
0.00270700454712
77
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000524044036865
time for loading is:
0.00228500366211
successfully loaded A from the disk.
total time is:
0.00388216972351
78
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000522136688232
time for loading is:
0.00151491165161
successfully loaded A from the disk.
total time is:
0.00289797782898
79
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000496864318848
time for loading is:
0.00164890289307
successfully loaded A from the disk.
total time is:
0.0030210018158
80
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000350952148438
time for loading is:
0.00102996826172
successfully loaded A from the disk.
total time is:
0.00218391418457
81
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000469923019409
time for loading is:
0.00149703025818
successfully loaded A from the disk.
total time is:
0.00282001495361
82
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000553846359253
time for loading is:
0.00175595283508
successfully loaded A from the disk.
total time is:
0.00357389450073
83
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000323057174683
time for loading is:
0.00104308128357
successfully loaded A from the disk.
total time is:
0.00198292732239
84
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000320911407471
time for loading is:
0.00116801261902
successfully loaded A from the disk.
total time is:
0.00214982032776
85
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000334978103638
time for loading is:
0.0014967918396
successfully loaded A from the disk.
total time is:
0.00261402130127
86
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000328063964844
time for loading is:
0.00113010406494
successfully loaded A from the disk.
total time is:
0.00219106674194
87
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000325918197632
time for loading is:
0.00152397155762
successfully loaded A from the disk.
total time is:
0.00253796577454
88
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000336170196533
time for loading is:
0.00157999992371
successfully loaded A from the disk.
total time is:
0.0026650428772
89
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000329971313477
time for loading is:
0.00113105773926
successfully loaded A from the disk.
total time is:
0.00209212303162
90
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000341176986694
time for loading is:
0.00131511688232
successfully loaded A from the disk.
total time is:
0.00229406356812
91
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000342130661011
time for loading is:
0.00133204460144
successfully loaded A from the disk.
total time is:
0.00237107276917
92
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000329971313477
time for loading is:
0.00086784362793
successfully loaded A from the disk.
total time is:
0.00182700157166
93
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000327110290527
time for loading is:
0.00137782096863
successfully loaded A from the disk.
total time is:
0.00232720375061
94
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.00139713287354
successfully loaded A from the disk.
total time is:
0.00233602523804
95
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324964523315
time for loading is:
0.000930070877075
successfully loaded A from the disk.
total time is:
0.00190711021423
96
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000324010848999
time for loading is:
0.0013530254364
successfully loaded A from the disk.
total time is:
0.002357006073
97
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000327110290527
time for loading is:
0.00162410736084
successfully loaded A from the disk.
total time is:
0.00265407562256
98
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000336170196533
time for loading is:
0.00102400779724
successfully loaded A from the disk.
total time is:
0.00201916694641
99
Generated  4168  potential Fourier coefficients
 with phases uniformly distributed between 0 and  6.28318530718
0.000329971313477
time for loading is:
0.00137686729431
successfully loaded A from the disk.
total time is:
0.002366065979
[[ 0.06269447]
 [ 0.07602156]
 [ 0.07602467]
 ..., 
 [ 0.33630223]
 [ 0.33634499]
 [ 0.3363014 ]]

In [8]:
print np.mean(cov_frac)


0.921847340611

In [ ]:
ind = np.where(beatbox.You.all_simulated_universes[0].kfilter>0)
        
k, theta, phi = beatbox.You.all_simulated_universes[0].k[ind], np.arctan2(beatbox.You.all_simulated_universes[0].ky[ind],beatbox.You.all_simulated_universes[0].kx[ind]), np.arccos(beatbox.You.all_simulated_universes[0].kz[ind]/beatbox.You.all_simulated_universes[0].k[ind])

kvec_long = np.zeros(2*len(ind[1]))
kvec_long[:len(ind[1])] = k
kvec_long[len(ind[1]):] = k
        
kvec = np.zeros(len(ind[1]))
kvec[:len(ind[1])/2] = kvec_long[:len(ind[1])/2]
kvec[len(ind[1])/2:] = kvec_long[len(ind[1]):3*len(ind[1])/2]
        
#ind_for_ordered_fn = np.argsort(kvec)

In [ ]:
print kvec[ordered_inds_largenmax[:50]].shape

In [ ]:
len(We.fn)

In [ ]: