From 5eab187d764082b5b10f3fe4dc36a679ba9c54b0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 21:35:26 +0000 Subject: [PATCH 1/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- abacusnbody/hod/abacus_hod.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/abacusnbody/hod/abacus_hod.py b/abacusnbody/hod/abacus_hod.py index 09910bf8..7f217165 100644 --- a/abacusnbody/hod/abacus_hod.py +++ b/abacusnbody/hod/abacus_hod.py @@ -153,8 +153,8 @@ def __init__(self, sim_params, HOD_params, clustering_params = None, chunk=-1, n self.shearbins = np.linspace(-0.5, 0.5, 101) self.halo_mass_func, edges = np.histogramdd( - np.vstack((np.log10(self.halo_data['hmass']), - self.halo_data.get('hdeltac', np.zeros(len(self.halo_data['hmass']))), + np.vstack((np.log10(self.halo_data['hmass']), + self.halo_data.get('hdeltac', np.zeros(len(self.halo_data['hmass']))), self.halo_data.get('hfenv', np.zeros(len(self.halo_data['hmass']))))).T, bins = [self.logMbins, self.deltacbins, self.fenvbins], weights = self.halo_data['hmultis']) @@ -168,9 +168,9 @@ def __init__(self, sim_params, HOD_params, clustering_params = None, chunk=-1, n assert 'hdeltac' in self.halo_data.keys() if self.want_shear: assert 'hshear' in self.halo_data.keys() - + self.halo_mass_func_wshear, edges = np.histogramdd( - np.vstack((np.log10(self.halo_data['hmass']), + np.vstack((np.log10(self.halo_data['hmass']), self.halo_data.get('hdeltac', np.zeros(len(self.halo_data['hmass']))), self.halo_data.get('hfenv', np.zeros(len(self.halo_data['hmass']))), self.halo_data.get('hshear', np.zeros(len(self.halo_data['hmass']))))).T, From 27324cb54958f6fb389f9567a91d7233731d2cba Mon Sep 17 00:00:00 2001 From: Sandy Yuan Date: Mon, 15 Jan 2024 15:38:25 -0800 Subject: [PATCH 2/2] fixed reseed and new vel bias --- abacusnbody/hod/abacus_hod.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/abacusnbody/hod/abacus_hod.py b/abacusnbody/hod/abacus_hod.py index 7f217165..0571cfb0 100644 --- a/abacusnbody/hod/abacus_hod.py +++ b/abacusnbody/hod/abacus_hod.py @@ -564,7 +564,10 @@ def run_hod(self, tracers = None, want_rsd = True, want_nfw = False, NFW_draw = r2 = np.vstack((r20, r21, r22)).T r3 = mtg.random(size=len(self.particle_data['prandoms']), nthread=Nthread, dtype=np.float32) self.halo_data['hrandoms'] = r1 - self.halo_data['hveldev'] = r2*self.halo_data['hsigma3d']/np.sqrt(3) + if len(self.halo_data['hveldev'].shape) == 1: + self.halo_data['hveldev'] = r20*self.halo_data['hsigma3d']/np.sqrt(3) + else: + self.halo_data['hveldev'] = r2*self.halo_data['hsigma3d']/np.sqrt(3) self.particle_data['prandoms'] = r3 print("gen randoms took, ", time.time() - start)