From 7ade0752c57bf80c211fe574eb947258de92ec14 Mon Sep 17 00:00:00 2001 From: Clancy James Date: Sun, 17 May 2026 09:29:40 +0800 Subject: [PATCH] slight mods --- frb/dm/igm.py | 3 +-- frb/frb.py | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frb/dm/igm.py b/frb/dm/igm.py index 78d5c2d2..97dc0e92 100644 --- a/frb/dm/igm.py +++ b/frb/dm/igm.py @@ -13,7 +13,6 @@ from astropy import units from astropy.table import Table -from astropy.utils import isiterable from astropy import constants from frb.halos import hmf as frb_hmf @@ -541,7 +540,7 @@ def z_to_array(z): """ # float or ndarray? - if not isiterable(z): + if not np.iterable(z): z = np.array([z]) flg_z = 0 else: diff --git a/frb/frb.py b/frb/frb.py index 7c82a873..56ab358f 100644 --- a/frb/frb.py +++ b/frb/frb.py @@ -397,7 +397,11 @@ def by_name(cls, frb_name, **kwargs): Returns: """ - json_file = importlib_resources.files('frb.data')/ f'FRBs/{frb_name}.json' + # searches for defined input directory. Otherwise uses default + if "ZDM_PATH_FRBDIR" in os.environ: + json_file = os.environ["ZDM_PATH_FRBDIR"]+f"/{frb_name}.json" + else: + json_file = importlib_resources.files('frb.data')/ f'FRBs/{frb_name}.json' slf = cls.from_json(str(json_file), **kwargs) return slf