Skip to content

Commit

Permalink
Merge pull request #121 from abacusorg/sandydev
Browse files Browse the repository at this point in the history
backward compatible fix for velocity bias
  • Loading branch information
SandyYuan committed Dec 12, 2023
2 parents fe0eed1 + bc0449a commit 9209128
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions abacusnbody/hod/abacus_hod.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import gc
import time
from pathlib import Path
import warnings

import asdf
import h5py
Expand Down Expand Up @@ -313,6 +314,10 @@ def staging(self):
halo_vel_dev = maskedhalos["randoms_exp"] # halo velocity dispersions, km/s
else:
halo_vel_dev = maskedhalos["randoms_gaus_vrms"] # halo velocity dispersions, km/s

if len(halo_vel_dev.shape) == 1:
warnings.warn("Warning: galaxy x, y velocity bias randoms not set, using z randoms instead. x, y velocities may be unreliable.")
halo_vel_dev = np.concatenate((halo_vel_dev, halo_vel_dev, halo_vel_dev)).reshape(-1, 3)
halo_sigma3d = maskedhalos["sigmav3d_L2com"] # 3d velocity dispersion
halo_c = maskedhalos['r98_L2com']/maskedhalos['r25_L2com'] # concentration
halo_rvir = maskedhalos['r98_L2com'] # rvir but using r98
Expand Down

0 comments on commit 9209128

Please sign in to comment.