Esempio n. 1
0
"""
plt.figure(figsize=(15,7))
plt.scatter(z_d, mr, marker="o", s=1, color="b")
plt.scatter(z_mng, mr_mng, marker="o", s=1, color="r")
plt.title("entire set")
plt.show()

exit()
"""

# Do the correlation function for the bright subsample
nr_bt 	    = len(bt_rand_cart)
nd_bt 	    = len(bright_cart)
DD          = md.auto_sort_pair_counter(bright_cart[:,0:3], bin_select, 0)
RR          = md.auto_sort_pair_counter(bt_rand_cart, bin_select, 0)
DR          = md.improved_cross_correlate(bright_cart[:,0:3], bt_rand_cart, bin_select, 0)
bright_est1 = md.davis_peebles_simple(DD, RR, nd_bt, nr_bt)
bright_est2 = md.davis_peebles(DD, DR, nd_bt, nr_bt)
bright_est3 = md.landay_szalay(DD, RR, DR, nd_bt, nr_bt)
print("Bright:")
print("DD: " + str(DD))
print("RR: " + str(RR))
print("DR: " + str(DR))
print(bright_est1)
print(bright_est2)

# Do the correlation function for the dim sample
nr_dm	   = len(dm_rand_cart)
nd_dm 	   = len(dim_cart)
DD  	   = md.auto_sort_pair_counter(dim_cart[:,0:3], bin_select, 0)
RR  	   = md.auto_sort_pair_counter(dm_rand_cart, bin_select, 0)
Esempio n. 2
0
#plt.gca().set_yscale("log")
plt.title("ACF With Jackknife Error Bars")
plt.show()

exit()

##################################
### 	 Jackknife Tests	   ###
##################################

# on the whole data set.
Nd = len(data_cartesian)
Nr = len(rand_cartesian)
DD = md.auto_sort_pair_counter(data_cartesian, bin_select, 0)
RR = md.auto_sort_pair_counter(rand_cartesian, bin_select, 0)
DR = md.improved_cross_correlate(data_cartesian, rand_cartesian, bin_select, 0)
(xi_1_m, xi_2_m, xi_3_m) = md.estimator_calculator(Nd, Nr, DD, RR, DR, 3)
#print(xi_2_m)

RA_sub    = 2
DEC_sub	  = 2
RA_subs  = np.linspace(RA_low, RA_high, RA_sub+1, endpoint=True)
DEC_subs = np.linspace(DEC_low, DEC_high, DEC_sub+1, endpoint=True)
#print(RA_subs)
#print(DEC_subs)
plot_subs_d = []
plot_subs_r = []
data_subs = []
rand_subs = []
# Loop over all subsections and select the data
for ii in range(RA_sub):
Esempio n. 3
0
	RA_r  = []
	DEC_r = []
	for jj in rand_3vec_dwn:
		RA_r.append(jj[0])
		DEC_r.append(jj[1])
	RA_array  = [RA_1, RA_r]
	DEC_array = [DEC_1, DEC_r]
	pot.sky_positions_2(RA_array, DEC_array)
	plt.show()
	"""
    # size of data sets
    N_d = len(data_cartesian)
    N_r = len(rand_cart_dwn)
    # Calculate the pair counts
    RR = md.auto_sort_pair_counter(rand_cart_dwn, bin_select, 0)
    DR = md.improved_cross_correlate(data_cartesian, rand_cart_dwn, bin_select,
                                     0)
    # calculate the estimators
    (xi_1, xi_2, xi_3) = md.estimator_calculator(N_d, N_r, DD, RR, DR, 3)
    end = time.time()
    # Display data
    print("Factor Multiple:", ii)
    print("time taken: " + str(end - start))
    print("data len = " + str(N_d))
    print("rand len = " + str(N_r))
    print("DD count = " + str(DD))
    print("RR count = " + str(RR))
    print("DR count = " + str(DR))
    print("Simple Davis & Peebles estimator per bin:" + "\n", xi_1)
    print("Davis & Peebles estimator per bin:" + "\n", xi_2)
    print("Landay & Szalay estimator per bin:" + "\n", xi_3)
    print("### \n")
Esempio n. 4
0
test_data = manga_c
rand_data = mrand_c
#kdtree    = build_kdtree(rand_data, tree_depth)
kd_counts = kd_tree_pair_counter(test_data, rand_data, bin_select, tree_depth)

end = time.time() - start
print("Bin Counts:")
print(kd_counts)
print("Total time taken for k-d tree search: " + str(end))

# Run a comparison test with existing ACF and CCFs
# ACF
start = time.time()
#ACF = md.auto_sort_pair_counter(data_c, bin_select, 1)
CCF = md.improved_cross_correlate(manga_c, mrand_c, bin_select, 0)
end = time.time() - start
print("ACF module pair count:")
print(CCF)
print("Total time taken for ACF: " + str(end))
"""
# Most basic crude cross correlation
start = time.time()
bin_counts   = []
for ii in range(0, len(bin_select)-1):
	bin = [bin_select[ii], bin_select[ii+1]]
	CCF = md.crude_cross_correlate(data_c, rand_c, bin[0], bin[1])
	bin_counts.append(CCF)
end = time.time() - start
print("ACF module pair count:")
print(bin_counts)