From ad6f37fb3b535b838b0748ebf0a482ba9fb27c2b Mon Sep 17 00:00:00 2001 From: "J. Xavier Prochaska" Date: Mon, 26 Aug 2024 11:41:46 -0700 Subject: [PATCH] fixing DM_cosmic --- frb/galaxies/utils.py | 2 +- frb/scripts/pz_dm.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frb/galaxies/utils.py b/frb/galaxies/utils.py index 7358e3ba..46a7ca84 100644 --- a/frb/galaxies/utils.py +++ b/frb/galaxies/utils.py @@ -70,7 +70,7 @@ def load_specdb(specdb_file=None): specdb_file = specdb_files[0] print("Loading spectra from {:s}".format(specdb_file)) else: - raise IOError("There are no FRB_specdb.hdf5 files in your SPECDB folder") + raise IOError("There are no FRB_specDB_*.hdf5 files in your SPECDB folder") # Load it up specDB = SpecDB(db_file=specdb_file) # Return diff --git a/frb/scripts/pz_dm.py b/frb/scripts/pz_dm.py index f082ffb0..3fd5c4af 100644 --- a/frb/scripts/pz_dm.py +++ b/frb/scripts/pz_dm.py @@ -51,8 +51,9 @@ def main(pargs): print("-----------------------------------------------------") print(f"NE2001 = {DM_ISM:.2f}") - # DM extragalactic - DM_extragalactic = pargs.DM_FRB - DM_ISM.value - pargs.dm_host - pargs.dm_mwhalo + # DM cosmic and EG + DM_cosmic = pargs.DM_FRB - DM_ISM.value - pargs.dm_mwhalo + DM_extragalactic = DM_cosmic + pargs.dm_host # Redshift estimates @@ -74,7 +75,8 @@ def main(pargs): PDM_z = sdict['PDM_z'] z = sdict['z'] DM = sdict['DM'] - DM_cosmic = DM_extragalactic + pargs.dm_host #DM_cosmic = DM_extragalactic + DM_host + + # Grab the right entry iDM = np.argmin(np.abs(DM - DM_cosmic)) PzDM = PDM_z[iDM, :] / np.sum(PDM_z[iDM, :])