diff --git a/frb/dm/igm.py b/frb/dm/igm.py index 1f8b19c1..3924e55f 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 @@ -483,7 +482,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 6cf7e464..0607326d 100644 --- a/frb/frb.py +++ b/frb/frb.py @@ -431,7 +431,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