Skip to content

Commit

Permalink
Merge pull request #104 from ArgonneCPAC/t_infall_bugfix
Browse files Browse the repository at this point in the history
Fix bug in calculation of time-since-infall argument
  • Loading branch information
aphearin authored Mar 5, 2025
2 parents 34b5225 + 4728dbd commit 4c0b318
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions diffsky/mc_diffsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ def mc_diffstar_galpop(
)

logmu_infall = subcat.logmp_ult_inf - subcat.logmhost_ult_inf
t_obs = flat_wcdm._age_at_z_kern(z_obs, *cosmo_params)
args = (
diffstarpop_params,
subcat.mah_params,
subcat.logmp0,
logmu_infall,
subcat.logmhost_ult_inf,
subcat.t_ult_inf,
t_obs - subcat.t_ult_inf,
sfh_key,
t_table,
)
Expand All @@ -93,8 +94,6 @@ def mc_diffstar_galpop(
sfh_table = jnp.where(mc_is_q.reshape((-1, 1)), sfh_q, sfh_ms)
smh_table = cumulative_mstar_formed_galpop(t_table, sfh_table)

t_obs = flat_wcdm._age_at_z_kern(z_obs, *cosmo_params)

diffstar_data = dict()
diffstar_data["subcat"] = subcat
diffstar_data["t_table"] = t_table
Expand Down Expand Up @@ -172,13 +171,14 @@ def mc_diffstar_cenpop(
)

logmu_infall = subcat.logmp_ult_inf - subcat.logmhost_ult_inf
t_obs = flat_wcdm._age_at_z_kern(z_obs, *cosmo_params)
args = (
diffstarpop_params,
subcat.mah_params,
subcat.logmp0,
logmu_infall,
subcat.logmhost_ult_inf,
subcat.t_ult_inf,
t_obs - subcat.t_ult_inf,
sfh_key,
t_table,
)
Expand All @@ -188,8 +188,6 @@ def mc_diffstar_cenpop(
sfh_table = jnp.where(mc_is_q.reshape((-1, 1)), sfh_q, sfh_ms)
smh_table = cumulative_mstar_formed_galpop(t_table, sfh_table)

t_obs = flat_wcdm._age_at_z_kern(z_obs, *cosmo_params)

diffstar_data = dict()
diffstar_data["subcat"] = subcat
diffstar_data["t_table"] = t_table
Expand Down

0 comments on commit 4c0b318

Please sign in to comment.