diff --git a/autogalaxy/analysis/model_util.py b/autogalaxy/analysis/model_util.py index 66db8131..a5f02750 100644 --- a/autogalaxy/analysis/model_util.py +++ b/autogalaxy/analysis/model_util.py @@ -127,7 +127,7 @@ def mge_model_from( def _make_centre_priors(): if centre_fixed is not None: - return centre[0], centre[1] + return centre_fixed[0], centre_fixed[1] elif centre_prior_is_uniform: return ( af.UniformPrior( diff --git a/test_autogalaxy/analysis/test_model_util.py b/test_autogalaxy/analysis/test_model_util.py index 5a3a352f..7a830ada 100644 --- a/test_autogalaxy/analysis/test_model_util.py +++ b/test_autogalaxy/analysis/test_model_util.py @@ -74,6 +74,19 @@ def test__mge_model_from__centre_fixed_with_two_bases(): assert model.prior_count == 4 +def test__mge_model_from__centre_fixed_uses_the_fixed_value(): + model = ag.model_util.mge_model_from( + mask_radius=1.0, + total_gaussians=5, + gaussian_per_basis=1, + centre_fixed=(1.5, -2.5), + ) + assert model.prior_count == 2 + + instance = model.instance_from_prior_medians() + assert instance.profile_list[0].centre == (1.5, -2.5) + + def test__mge_model_from__centre_fixed_overrides_centre_per_basis(): model = ag.model_util.mge_model_from( mask_radius=1.0,