From 6560e588cf4b948596dd63ca76c881a8ed91c648 Mon Sep 17 00:00:00 2001 From: Cayenne Matt <59581529+CayenneMatt@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:45:17 -0400 Subject: [PATCH 1/4] Add redz=redz as argument to dmstar_dmbh Add redz=redz as argument to dmstar_dmbh in line 358 for use in evolving version of mmbulge function --- holodeck/sams/sam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/holodeck/sams/sam.py b/holodeck/sams/sam.py index 3f691459..f8761dbc 100644 --- a/holodeck/sams/sam.py +++ b/holodeck/sams/sam.py @@ -358,7 +358,7 @@ def static_binary_density(self): # ==> (dMstar-tot/dMbh-tot) = (dMstar-pri / dMbh-pri) * (dMbh-pri/dMbh-tot) / (dMstar-pri / dMstar-tot) # = (dMstar-pri / dMbh-pri) * (1 / (1+q_bh)) / (1 / (1+q_star)) # = (dMstar-pri / dMbh-pri) * ((1+q_star) / (1+q_bh)) - dmstar_dmbh_pri = self._mmbulge.dmstar_dmbh(mstar_pri) # [unitless] + dmstar_dmbh_pri = self._mmbulge.dmstar_dmbh(mstar_pri, redz=redz) # [unitless] qterm = (1.0 + mstar_rat) / (1.0 + self.mrat[np.newaxis, :, np.newaxis]) dmstar_dmbh = dmstar_dmbh_pri * qterm From dd0c7b70da5b6bc9f6cba2c3af7685bb531dcbf7 Mon Sep 17 00:00:00 2001 From: Cayenne Matt <59581529+CayenneMatt@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:46:38 -0400 Subject: [PATCH 2/4] Add except statement to mbh_from_mbulge Add except ValueError statement to mbh_from_mbulge (within MMBulge_Redshift) on line 848 to catch another instance where redz doesn't need to be reshaped --- holodeck/host_relations.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/holodeck/host_relations.py b/holodeck/host_relations.py index fed48c0b..7e6688c7 100644 --- a/holodeck/host_relations.py +++ b/holodeck/host_relations.py @@ -845,6 +845,8 @@ def mbh_from_mbulge(self, mbulge, redz, scatter): redz = np.broadcast_to(redz, mbulge.T.shape).T except TypeError: redz = redz + except ValueError: + redz = redz zmamp = self._mamp * (1.0 + redz)**self._zplaw mbh = _log10_relation(mbulge, zmamp, self._mplaw, scatter_dex, x0=self._mref) return mbh From 736b9ecd30fa25291b65c831d1bdfcbd7eea3a75 Mon Sep 17 00:00:00 2001 From: Cayenne Matt <59581529+CayenneMatt@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:59:56 -0400 Subject: [PATCH 3/4] Update try/except statement Changed line 846 to make the try/except statement more broad except TypeError: to except: --- holodeck/host_relations.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/holodeck/host_relations.py b/holodeck/host_relations.py index 7e6688c7..b1c107f1 100644 --- a/holodeck/host_relations.py +++ b/holodeck/host_relations.py @@ -843,9 +843,7 @@ def mbh_from_mbulge(self, mbulge, redz, scatter): # NOTE: this will work for (N,) ==> (N,) or (N,) ==> (N,X) try: redz = np.broadcast_to(redz, mbulge.T.shape).T - except TypeError: - redz = redz - except ValueError: + except: redz = redz zmamp = self._mamp * (1.0 + redz)**self._zplaw mbh = _log10_relation(mbulge, zmamp, self._mplaw, scatter_dex, x0=self._mref) From b765c76d11cba0e77af766f9f19a79d5888bc139 Mon Sep 17 00:00:00 2001 From: Cayenne Matt <59581529+CayenneMatt@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:57:23 -0400 Subject: [PATCH 4/4] Update param_spaces_classic.py Update to fix some differences between PS_Classic_Phenom_Uniform and PS_Uniform_09B. Changed the range of parameter space for mmbulge amplitude from (7.5, 9.5) to (7.6, 9.0) and scatter from (0, 1.2) to (0, 0.9). --- holodeck/librarian/param_spaces_classic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/holodeck/librarian/param_spaces_classic.py b/holodeck/librarian/param_spaces_classic.py index 3509d319..8e90e705 100644 --- a/holodeck/librarian/param_spaces_classic.py +++ b/holodeck/librarian/param_spaces_classic.py @@ -100,8 +100,8 @@ def __init__(self, log=None, nsamples=None, sam_shape=None, seed=None): parameters = [ PD_Uniform("gsmf_phi0_log10", -3.5, -1.5), PD_Uniform("gsmf_mchar0_log10", 10.5, 12.5), # [log10(Msol)] - PD_Uniform("mmb_mamp_log10", +7.5, +9.5), # [log10(Msol)] - PD_Uniform("mmb_scatter_dex", +0.0, +1.2), + PD_Uniform("mmb_mamp_log10", +7.6, +9.0), # [log10(Msol)] + PD_Uniform("mmb_scatter_dex", +0.0, +0.9), PD_Uniform("hard_time", 0.1, 11.0), # [Gyr] PD_Uniform("hard_gamma_inner", -1.5, +0.0), ]