diff --git a/pyHalo/Halos/HaloModels/gaussian.py b/pyHalo/Halos/HaloModels/gaussianhalo.py similarity index 86% rename from pyHalo/Halos/HaloModels/gaussian.py rename to pyHalo/Halos/HaloModels/gaussianhalo.py index e717f92..49e4124 100644 --- a/pyHalo/Halos/HaloModels/gaussian.py +++ b/pyHalo/Halos/HaloModels/gaussianhalo.py @@ -2,7 +2,7 @@ from lenstronomy.LensModel.Profiles.gaussian import Gaussian import numpy as np -class Gaussian(Halo): +class GaussianHalo(Halo): """ The base class for a Gaussian fluctuation @@ -19,8 +19,8 @@ def __init__(self, mass, x, y, r3d, z, self._concentration_class = concentration_class self._truncation_class = truncation_class mdef = 'GAUSSIAN_KAPPA' - super(Gaussian, self).__init__(mass, x, y, r3d, mdef, z, sub_flag, - lens_cosmo_instance, args, unique_tag, fixed_position=True) + super(GaussianHalo, self).__init__(mass, x, y, r3d, mdef, z, sub_flag, + lens_cosmo_instance, args, unique_tag, fixed_position=True) @property def profile_args(self): diff --git a/pyHalo/realization_extensions.py b/pyHalo/realization_extensions.py index 6498dd0..9bf2647 100644 --- a/pyHalo/realization_extensions.py +++ b/pyHalo/realization_extensions.py @@ -2,7 +2,7 @@ from pyHalo.Halos.HaloModels.powerlaw import PowerLawSubhalo, PowerLawFieldHalo, GlobularCluster from pyHalo.Halos.HaloModels.generalized_nfw import GeneralNFWSubhalo, GeneralNFWFieldHalo from pyHalo.single_realization import Realization -from pyHalo.Halos.HaloModels.gaussian import Gaussian +from pyHalo.Halos.HaloModels.gaussianhalo import GaussianHalo from pyHalo.Rendering.correlated_structure import CorrelatedStructure from pyHalo.Rendering.MassFunctions.delta_function import DeltaFunction from pyHalo.Rendering.MassFunctions.gaussian import Gaussian @@ -557,10 +557,10 @@ def _get_fluctuation_halos(realization, fluctuation_amplitude, fluctuation_size, args_fluc=[{'amp': amps[i], 'sigma': sigs[i], 'center_x': xs[i], 'center_y': ys[i]} for i in range(len(amps))] masses = np.absolute(amps) - fluctuations = [Gaussian(masses[i], xs[i], ys[i], None, realization.lens_cosmo.z_lens, - True, realization.lens_cosmo, args_fluc[i], - truncation_class=None, concentration_class=None, - unique_tag=np.random.rand()) for i in range(len(amps))] + fluctuations = [GaussianHalo(masses[i], xs[i], ys[i], None, realization.lens_cosmo.z_lens, + True, realization.lens_cosmo, args_fluc[i], + truncation_class=None, concentration_class=None, + unique_tag=np.random.rand()) for i in range(len(amps))] return fluctuations diff --git a/pyHalo/single_realization.py b/pyHalo/single_realization.py index 3851586..7a96691 100644 --- a/pyHalo/single_realization.py +++ b/pyHalo/single_realization.py @@ -9,7 +9,7 @@ from pyHalo.Halos.HaloModels.PTMass import PTMass from pyHalo.Halos.HaloModels.ULDM import ULDMFieldHalo, ULDMSubhalo from pyHalo.Halos.HaloModels.NFW_core_trunc import TNFWCFieldHaloSIDM, TNFWCSubhaloSIDM -from pyHalo.Halos.HaloModels.gaussian import Gaussian +from pyHalo.Halos.HaloModels.gaussianhalo import GaussianHalo import numpy as np from copy import deepcopy @@ -677,7 +677,7 @@ def _load_halo_model(mass, x, y, r3d, mdef, z, is_subhalo, else: model = ULDMFieldHalo elif mdef == 'GAUSSIAN_KAPPA': - model = Gaussian + model = GaussianHalo elif mdef == 'GNFW': if is_subhalo: model = GeneralNFWSubhalo diff --git a/tests/test_halos/test_gaussian.py b/tests/test_halos/test_gaussian.py index a81a91e..14f838e 100644 --- a/tests/test_halos/test_gaussian.py +++ b/tests/test_halos/test_gaussian.py @@ -1,6 +1,6 @@ import numpy.testing as npt import numpy as np -from pyHalo.Halos.HaloModels.gaussian import Gaussian +from pyHalo.Halos.HaloModels.gaussianhalo import GaussianHalo from pyHalo.Halos.lens_cosmo import LensCosmo from pyHalo.Cosmology.cosmology import Cosmology from astropy.cosmology import FlatLambdaCDM @@ -22,9 +22,9 @@ def setup_method(self): lens_cosmo = LensCosmo(z, 2., cosmo) profile_args = {'amp':1,'sigma':1,'center_x':1.0,'center_y':1.0} sub_flag = False - self.halo = Gaussian(mass, x, y, r3d, z, - sub_flag, lens_cosmo, - profile_args, None, None, unique_tag=np.random.rand()) + self.halo = GaussianHalo(mass, x, y, r3d, z, + sub_flag, lens_cosmo, + profile_args, None, None, unique_tag=np.random.rand()) def test_lenstronomy_params(self): diff --git a/tests/test_halos/test_globular_clusters.py b/tests/test_halos/test_globular_clusters.py index 18fd543..28693c0 100644 --- a/tests/test_halos/test_globular_clusters.py +++ b/tests/test_halos/test_globular_clusters.py @@ -24,11 +24,12 @@ def test_lenstronomy_ID(self): profile = GlobularCluster(mass, 0.0, 0.0, self.zhalo, self.lens_cosmo, args, 1) lenstronomy_ID = profile.lenstronomy_ID - npt.assert_string_equal(lenstronomy_ID[0], 'SPLCORE') + npt.assert_string_equal(lenstronomy_ID[0], 'SPL_CORE') def test_lenstronomy_args(self): - mass = 10 ** 5 + logM = 5.0 + mass = 10 ** logM args = {'gamma': 2.5, 'r_core_fraction': 0.05, 'gc_size_lightyear': 100} @@ -45,7 +46,7 @@ def test_lenstronomy_args(self): sigma_crit_mpc = self.lens_cosmo.get_sigma_crit_lensing(profile.z, self.lens_cosmo.z_source) kpc_per_arcsec = self.lens_cosmo.cosmo.kpc_proper_per_asec(profile.z) sigma_crit_arcsec = sigma_crit_mpc * (0.001 * kpc_per_arcsec) ** 2 - npt.assert_almost_equal(np.log10(mass), np.log10(mass * sigma_crit_arcsec)) + npt.assert_almost_equal(logM, np.log10(mass * sigma_crit_arcsec)) if __name__ == '__main__': pytest.main()