From e7cd0d7e3ed85d6655f3edddba2cf0fd1ccfa6ad Mon Sep 17 00:00:00 2001 From: Pierre Burger <51719634+pburger112@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:13:34 -0400 Subject: [PATCH] Update prepare_sim.py Updated Menv correction at boundaries 1. Added more randoms, such that after cutting into an octant, we have twelve times more randoms than haloes. 2. Changed random correction from multiplying to division. --- abacusnbody/hod/prepare_sim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abacusnbody/hod/prepare_sim.py b/abacusnbody/hod/prepare_sim.py index 358a288..2398966 100644 --- a/abacusnbody/hod/prepare_sim.py +++ b/abacusnbody/hod/prepare_sim.py @@ -528,7 +528,7 @@ def prepare_slab( if len(index_bounds) > 0: # factor of rands to generate - rand = 10 + rand = 100 # to ensure 12 times more randoms than haloes in the octant. rand_N = allpos.shape[0] * rand # generate randoms in L shape @@ -591,7 +591,7 @@ def prepare_slab( gc.collect() if halo_lc and len(index_bounds) > 0: - Menv[index_bounds] *= rand_norm + Menv[index_bounds] /= rand_norm halos['fenv_rank'] = calc_fenv_opt(Menv, mbins, allmasses)