From 15121a77365140e3115774c4203c40843177a1df Mon Sep 17 00:00:00 2001 From: mtremmel Date: Thu, 19 Dec 2024 16:30:46 +0000 Subject: [PATCH] fix another bug in unit conversion. convert string to float before operating --- tangos/tools/changa_bh_importer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tangos/tools/changa_bh_importer.py b/tangos/tools/changa_bh_importer.py index 7ed6fa08..3cadcf9c 100644 --- a/tangos/tools/changa_bh_importer.py +++ b/tangos/tools/changa_bh_importer.py @@ -115,7 +115,7 @@ def _generate_halolinks(self, pairs): l_split = l.split() #convert time to Gyr and account for negative times #(for "fake" mergers but we'd still want them if the BHs actually make it to the database) - t = float(np.abs(l_split[6]))*gyr_ratio + t = np.abs(float(l_split[6]))*gyr_ratio bh_dest_id = int(l_split[0]) bh_src_id = int(l_split[1]) ratio = float(l_split[4])