Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autogalaxy/analysis/model_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
13 changes: 13 additions & 0 deletions test_autogalaxy/analysis/test_model_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading