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 1/2] 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) From 5811cae3ee5dbf4fff5055ec156a9dc742f58087 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 18:29:56 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- 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 2398966..ba0d320 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 = 100 # to ensure 12 times more randoms than haloes in the octant. + 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)