Skip to content

Commit

Permalink
Update random in optimal_estimator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
p-slash authored Jun 28, 2024
1 parent 9e4b420 commit 095ced5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lya_2pt/optimal_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,13 @@ def compute_xi_and_fisher(healpix_id):
tracer1.set_inverse_covariance(xi1d_interp, globals.continuum_order)
tracer1.apply_invcov_to_deltas()

np.random.seed(globals.seed)
w = np.random.rand(neighbours.size) > globals.rejection_fraction
for tracer2, angle in zip(neighbours[w], angles[w]):
if globals.rejection_fraction < 1:
np.random.seed(tracer1.los_id)
w = np.random.rand(neighbours.size) > globals.rejection_fraction
neighbours = neighbours[w]
angles = angles[w]

for tracer2, angle in zip(neighbours, angles):
tracer2.set_inverse_covariance(xi1d_interp, globals.continuum_order)
tracer2.apply_invcov_to_deltas()
compute_xi_and_fisher_pair(tracer1, tracer2, angle, xi_est, fisher_est)
Expand Down

0 comments on commit 095ced5

Please sign in to comment.