Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce eboss resolution xi1d #19

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions lya_2pt/optimal_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ def build_xi1d(z1=1.8, z2=4., nz=50, lambda_max=2048):
return RGI((z, r), xi_wwindow, method='linear', bounds_error=False)


def build_xi1d_eboss(z1=1.8, z2=4., nz=50, lambda_max=2048):
z = np.linspace(z1, z2, nz)

r, dlambda = np.linspace(-lambda_max, lambda_max, int(10 * lambda_max) + 1, retstep=True)
k = np.fft.rfftfreq(r.size, d=dlambda) * 2 * np.pi

kk, zz = np.meshgrid(k, z)
c_kms = speed_of_light / 1000
A2kms = 1215.67 * (1 + zz) / c_kms

fid_pk_angstrom = fiducial_Pk_angstrom(kk, zz)
window = window_squared_angstrom(kk, A2kms * 207.0, A2kms * 69.0)
xi_wwindow = np.fft.irfft(fid_pk_angstrom * window, n=r.size) / dlambda
xi_wwindow = np.fft.fftshift(xi_wwindow, axes=1)

return RGI((z, r), xi_wwindow, method='linear', bounds_error=False)


def get_xi_bins(tracer1, tracer2, angle):
rp = np.abs(np.subtract.outer(tracer1.dist_c, tracer2.dist_c) * np.cos(angle / 2))
rt = np.add.outer(tracer1.dist_m, tracer2.dist_m) * np.sin(angle / 2)
Expand Down Expand Up @@ -170,7 +188,7 @@ def compute_xi_and_fisher_pair(
return xi_est, fisher_est


def compute_xi_and_fisher(healpix_id):
def compute_xi_and_fisher(healpix_id, eboss=True):
"""Compute correlation function

Parameters
Expand Down Expand Up @@ -198,7 +216,10 @@ def compute_xi_and_fisher(healpix_id):

xi_est = np.zeros(total_size)
fisher_est = np.zeros((total_size, total_size))
xi1d_interp = build_xi1d()
if eboss:
xi1d_interp = build_xi1d_eboss()
else:
xi1d_interp = build_xi1d()

for tracer1 in globals.tracers1[healpix_id]:
potential_neighbours = [tracer2 for hp in hp_neighs for tracer2 in globals.tracers2[hp]]
Expand Down
Loading