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
22 changes: 11 additions & 11 deletions test_autogalaxy/imaging/test_fit_imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test__fit_figure_of_merit(
)

assert fit.perform_inversion is True
assert fit.figure_of_merit == pytest.approx(-22.9005, 1.0e-4)
assert fit.figure_of_merit == pytest.approx(-22.91411868616, 1.0e-4)

galaxy_light = ag.Galaxy(
redshift=0.5, bulge=ag.lp.Sersic(intensity=1.0, centre=(0.05, 0.05))
Expand All @@ -75,7 +75,7 @@ def test__fit_figure_of_merit(
fit = ag.FitImaging(dataset=masked_imaging_7x7, galaxies=[galaxy_light, galaxy_pix])

assert fit.perform_inversion is True
assert fit.figure_of_merit == pytest.approx(-29.201919365, 1.0e-4)
assert fit.figure_of_merit == pytest.approx(-29.235208518732776, 1.0e-4)

g0_linear_light = ag.Galaxy(
redshift=0.5, bulge=ag.lp_linear.Sersic(sersic_index=1.0, centre=(0.05, 0.05))
Expand Down Expand Up @@ -157,7 +157,7 @@ def test__fit_figure_of_merit(
)

assert fit.perform_inversion is True
assert fit.figure_of_merit == pytest.approx(-22.87827302, 1.0e-4)
assert fit.figure_of_merit == pytest.approx(-22.8918119554022, 1.0e-4)

g0 = ag.Galaxy(redshift=0.5, bulge=ag.lp.Sersic(intensity=1.0, centre=(0.05, 0.05)))
g1 = ag.Galaxy(redshift=0.5, bulge=ag.lp.Sersic(intensity=1.0, centre=(0.05, 0.05)))
Expand Down Expand Up @@ -231,7 +231,7 @@ def test__fit__model_dataset__grid_offset__handles_special_behaviour(
dataset_model=ag.DatasetModel(grid_offset=(1.0, 2.0)),
)

assert fit.figure_of_merit == pytest.approx(-22.9005, 1.0e-4)
assert fit.figure_of_merit == pytest.approx(-22.914118686169, 1.0e-4)


def test__galaxy_model_image_dict(masked_imaging_7x7):
Expand Down Expand Up @@ -307,13 +307,13 @@ def test__galaxy_model_image_dict(masked_imaging_7x7):

assert (fit.galaxy_model_image_dict[g0] == np.zeros(9)).all()

assert fit.galaxy_model_image_dict[g1][4] == pytest.approx(1.2570779, 1.0e-4)
assert fit.galaxy_model_image_dict[g1].native == pytest.approx(
fit.inversion.mapped_reconstructed_image.native, 1.0e-4
assert fit.galaxy_model_image_dict[g1][4] == pytest.approx(1.25795063, 1.0e-4)
assert fit.galaxy_model_image_dict[g1].native.array == pytest.approx(
fit.inversion.mapped_reconstructed_image.native.array, 1.0e-4
)

assert fit.model_data.native == pytest.approx(
fit.galaxy_model_image_dict[g1].native, 1.0e-4
assert fit.model_data.native.array == pytest.approx(
fit.galaxy_model_image_dict[g1].native.array, 1.0e-4
)

# Linear Light PRofiles + Pixelization + Regularizaiton
Expand Down Expand Up @@ -344,10 +344,10 @@ def test__galaxy_model_image_dict(masked_imaging_7x7):
-9.658085312, 1.0e-4
)
assert fit.galaxy_model_image_dict[galaxy_pix_0][4] == pytest.approx(
1.107969179, 1.0e-4
1.10780906, 1.0e-4
)
assert fit.galaxy_model_image_dict[galaxy_pix_1][4] == pytest.approx(
1.1079691840, 1.0e-4
1.10780906, 1.0e-4
)

mapped_reconstructed_image = (
Expand Down
16 changes: 8 additions & 8 deletions test_autogalaxy/interferometer/test_fit_interferometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test__fit_figure_of_merit(interferometer_7):
)

assert fit.perform_inversion is True
assert fit.figure_of_merit == pytest.approx(-66.90612, 1.0e-4)
assert fit.figure_of_merit == pytest.approx(-71.770448724198, 1.0e-4)

galaxy_light = ag.Galaxy(
redshift=0.5, bulge=ag.lp.Sersic(intensity=1.0, centre=(0.05, 0.05))
Expand All @@ -72,7 +72,7 @@ def test__fit_figure_of_merit(interferometer_7):
)

assert fit.perform_inversion is True
assert fit.figure_of_merit == pytest.approx(-250.2259451235, 1.0e-4)
assert fit.figure_of_merit == pytest.approx(-196.15073725528504, 1.0e-4)

g0_linear_light = ag.Galaxy(
redshift=0.5, bulge=ag.lp_linear.Sersic(sersic_index=1.0, centre=(0.05, 0.05))
Expand Down Expand Up @@ -107,8 +107,8 @@ def test__fit_figure_of_merit(interferometer_7):
dataset=interferometer_7, galaxies=[g0_linear_light, galaxy_pix]
)

assert fit.log_evidence == pytest.approx(-35.17166165, 1e-4)
assert fit.figure_of_merit == pytest.approx(-35.17166165, 1.0e-4)
assert fit.log_evidence == pytest.approx(-37.4081355120388, 1e-4)
assert fit.figure_of_merit == pytest.approx(-37.4081355120388, 1.0e-4)


def test___galaxy_model_image_dict(interferometer_7):
Expand Down Expand Up @@ -212,10 +212,10 @@ def test___galaxy_model_image_dict(interferometer_7):
)
assert fit.galaxy_model_image_dict[g1] == pytest.approx(g1_image.array, 1.0e-4)
assert fit.galaxy_model_image_dict[galaxy_pix_0][4] == pytest.approx(
-0.00560239, 1.0e-2
-0.00541699, 1.0e-2
)
assert fit.galaxy_model_image_dict[galaxy_pix_1][4] == pytest.approx(
-0.00529861, 1.0e-2
-0.00563034, 1.0e-2
)

mapped_reconstructed_image = (
Expand Down Expand Up @@ -340,10 +340,10 @@ def test___galaxy_model_visibilities_dict(interferometer_7):
g1_visibilities.array, 1.0e-4
)
assert fit.galaxy_model_visibilities_dict[galaxy_pix_0][0] == pytest.approx(
-0.007889864570437388 + 0.22558558295704295j, 1.0e-4
-0.00889895 + 0.22151583j, 1.0e-4
)
assert fit.galaxy_model_visibilities_dict[galaxy_pix_1][0] == pytest.approx(
-0.007760865740849596 + 0.05639639626962996j, 1.0e-4
-0.00857457 + 0.05537896j, 1.0e-4
)

mapped_reconstructed_visibilities = (
Expand Down
Loading