Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion holodeck/gravwaves.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,9 @@ def char_strain_sq_from_bin_edges_redz(edges, redz):

# convert from observer-frame to rest-frame; still using frequency-bin centers
fr = utils.frst_from_fobs(fc[np.newaxis, np.newaxis, np.newaxis, :], redz)

# redz is set to -np.inf instead of -1, which makes fr negative and creates a nan error in hs calculation
# so, to avoid nan, setting those fr to zero
fr[fr<0] = 0.0
hs = utils.gw_strain_source(mc, dc, fr)
hc2 = (hs ** 2) * (fc / df)
return hc2
Expand Down
2 changes: 2 additions & 0 deletions holodeck/librarian/lib_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,8 @@ def run_model(
data['hc_bg'] = hc_bg

if gwb_flag:
negative_mask = use_redz < 0.0 # galaxy mergers that stall
use_redz[negative_mask] = -np.inf # set to -inf so they can't contribute to GWB
gwb = holo.gravwaves._gws_from_number_grid_integrated_redz(edges, use_redz, number, nreals)
data['gwb'] = gwb

Expand Down
Loading