Skip to content

Commit 9cbcbe6

Browse files
committed
first working version with gamma-gamma term
1 parent 2209351 commit 9cbcbe6

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

lya_2pt/correlation.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import lya_2pt.global_data as globals
66
from lya_2pt.tracer_utils import get_angle
7+
from lya_2pt.utils import gen_gamma
78

89

910
import pdb
@@ -71,9 +72,6 @@ def compute_xi(healpix_id):
7172
globals.rp_max, globals.rt_max
7273
)
7374

74-
ForkedPdb().set_trace()
75-
76-
7775
for tracer2 in neighbours:
7876
angle = get_angle(
7977
tracer1.x_cart, tracer1.y_cart, tracer1.z_cart, tracer1.ra, tracer1.dec,
@@ -83,7 +81,8 @@ def compute_xi(healpix_id):
8381
compute_xi_pair(
8482
tracer1.deltas, tracer1.weights, tracer1.z, tracer1.dist_c, tracer1.dist_m,
8583
tracer2.deltas, tracer2.weights, tracer2.z, tracer2.dist_c, tracer2.dist_m,
86-
angle, xi_grid, weights_grid, rp_grid, rt_grid, z_grid, num_pairs_grid
84+
angle, xi_grid, weights_grid, rp_grid, rt_grid, z_grid, num_pairs_grid,
85+
tracer1.z_qso, tracer2.z_qso
8786
)
8887

8988
# Normalize correlation and average coordinate grids
@@ -101,7 +100,8 @@ def compute_xi(healpix_id):
101100
def compute_xi_pair(
102101
deltas1, weights1, z1, dist_c1, dist_m1,
103102
deltas2, weights2, z2, dist_c2, dist_m2, angle,
104-
xi_grid, weights_grid, rp_grid, rt_grid, z_grid, num_pairs_grid
103+
xi_grid, weights_grid, rp_grid, rt_grid, z_grid, num_pairs_grid,
104+
z_qso1,z_qso2
105105
):
106106
sin_angle = np.sin(angle / 2)
107107
cos_angle = np.cos(angle / 2)
@@ -138,7 +138,8 @@ def compute_xi_pair(
138138
z_grid[bins] += (z1[i] + z2[j]) / 2 * weight12
139139
num_pairs_grid[bins] += 1
140140

141-
#gamma grid
142-
#globals.gamma_fun
143-
144-
#gamma_grid[bins] += globals.gamma_fun[i] * globals.gamma_fun[j] * weight12 #GAMMA FUNCTION
141+
#GAMMA FUNCTION
142+
sigma_v = globals.gamma_z_error
143+
lambda_rest_i = 1215.67 * (1 + z1) / (1 + z_qso1)
144+
lambda_rest_j = 1215.67 * (1 + z2)/ (1 + z_qso2)
145+
gamma_grid[bins] += gen_gamma(lambda_rest_i,sigma_v) * gen_gamma(lambda_rest_j,sigma_v) * weight12

lya_2pt/global_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
get_old_distortion = None
2424
rejection_fraction = None
2525

26-
gamma_fun = None
26+
gamma_z_error = None

lya_2pt/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def __init__(self, config):
9595
globals.num_bins_rt_model = self.settings.getint('num_bins_rt_model')
9696
globals.rejection_fraction = self.settings.getfloat('rejection_fraction')
9797
globals.get_old_distortion = self.settings.getboolean('get-old-distortion')
98-
globals.gamma_fun = self.settings.getfloat("gamma_z_error")
98+
globals.gamma_z_error = self.settings.getfloat("gamma_z_error")
9999

100100
self.nside = self.settings.getint("nside")
101101
self.num_cpu = self.settings.getint("num-cpu")

0 commit comments

Comments
 (0)