diff --git a/autogalaxy/aggregator/imaging/imaging.py b/autogalaxy/aggregator/imaging/imaging.py index a3e3493b..f1116daf 100644 --- a/autogalaxy/aggregator/imaging/imaging.py +++ b/autogalaxy/aggregator/imaging/imaging.py @@ -51,7 +51,7 @@ def _imaging_from( psf = None try: - over_sampling_uniform = aa.Array2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.over_sampling_size_uniform")).native + over_sampling_uniform = aa.Array2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.over_sampling_size_lp")).native except AttributeError: over_sampling_uniform = 1 try: @@ -63,7 +63,7 @@ def _imaging_from( data=data, noise_map=noise_map, psf=psf, - over_sampling=aa.OverSamplingDataset(uniform=over_sampling_uniform, pixelization=over_sampling_pixelization), + over_sampling=aa.OverSamplingDataset(lp=over_sampling_uniform, pixelization=over_sampling_pixelization), check_noise_map=False, ) diff --git a/autogalaxy/analysis/analysis/analysis.py b/autogalaxy/analysis/analysis/analysis.py index 66d9ccc2..ceeecbbb 100644 --- a/autogalaxy/analysis/analysis/analysis.py +++ b/autogalaxy/analysis/analysis/analysis.py @@ -191,10 +191,10 @@ def profile_log_likelihood_function( fit.figure_of_merit try: - info_dict["image_pixels"] = self.dataset.grids.uniform.shape_slim + info_dict["image_pixels"] = self.dataset.grids.lp.shape_slim info_dict[ "sub_total_light_profiles" - ] = self.dataset.grids.uniform.over_sampler.sub_total + ] = self.dataset.grids.lp.over_sampler.sub_total except AttributeError: pass diff --git a/autogalaxy/analysis/analysis/dataset.py b/autogalaxy/analysis/analysis/dataset.py index ea448137..8c9c5f2b 100644 --- a/autogalaxy/analysis/analysis/dataset.py +++ b/autogalaxy/analysis/analysis/dataset.py @@ -179,8 +179,8 @@ def save_attributes(self, paths: af.DirectoryPaths): prefix="dataset", ) paths.save_fits( - name="over_sampling_size_uniform", - hdu=self.dataset.grids.uniform.over_sampling_size.native.hdu_for_output, + name="over_sampling_size_lp", + hdu=self.dataset.grids.lp.over_sampling_size.native.hdu_for_output, prefix="dataset", ) paths.save_fits( diff --git a/autogalaxy/galaxy/to_inversion.py b/autogalaxy/galaxy/to_inversion.py index ed0dc451..23660ad6 100644 --- a/autogalaxy/galaxy/to_inversion.py +++ b/autogalaxy/galaxy/to_inversion.py @@ -317,7 +317,7 @@ def cls_light_profile_func_list_galaxy_dict_from( if len(light_profile_list) > 0: lp_linear_func = LightProfileLinearObjFuncList( - grid=self.dataset.grids.uniform, + grid=self.dataset.grids.lp, blurring_grid=self.dataset.grids.blurring, convolver=self.dataset.convolver, light_profile_list=light_profile_list, diff --git a/autogalaxy/imaging/fit_imaging.py b/autogalaxy/imaging/fit_imaging.py index ff72fe5e..192213be 100644 --- a/autogalaxy/imaging/fit_imaging.py +++ b/autogalaxy/imaging/fit_imaging.py @@ -104,11 +104,11 @@ def blurred_image(self) -> aa.Array2D: self.galaxies.cls_list_from(cls=LightProfileOperated) ): return self.galaxies.image_2d_from( - grid=self.grids.uniform, + grid=self.grids.lp, ) return self.galaxies.blurred_image_2d_from( - grid=self.grids.uniform, + grid=self.grids.lp, convolver=self.dataset.convolver, blurring_grid=self.grids.blurring, ) @@ -185,7 +185,7 @@ def galaxy_model_image_dict(self) -> Dict[Galaxy, np.ndarray]: """ galaxy_blurred_image_2d_dict = self.galaxies.galaxy_blurred_image_2d_dict_from( - grid=self.grids.uniform, + grid=self.grids.lp, convolver=self.dataset.convolver, blurring_grid=self.grids.blurring, ) @@ -257,7 +257,7 @@ def unmasked_blurred_image(self) -> aa.Array2D: exc.raise_linear_light_profile_in_unmasked() return self.galaxies.unmasked_blurred_image_2d_from( - grid=self.grids.uniform, psf=self.dataset.psf + grid=self.grids.lp, psf=self.dataset.psf ) @property @@ -272,7 +272,7 @@ def unmasked_blurred_image_of_galaxies_list(self) -> List[aa.Array2D]: exc.raise_linear_light_profile_in_unmasked() return self.galaxies.unmasked_blurred_image_2d_list_from( - grid=self.grids.uniform, psf=self.dataset.psf + grid=self.grids.lp, psf=self.dataset.psf ) @property diff --git a/autogalaxy/imaging/model/visualizer.py b/autogalaxy/imaging/model/visualizer.py index 201c72d4..d3b8f1a0 100644 --- a/autogalaxy/imaging/model/visualizer.py +++ b/autogalaxy/imaging/model/visualizer.py @@ -87,10 +87,10 @@ def visualize( galaxies = fit.galaxies_linear_light_profiles_to_light_profiles plotter.galaxies( - galaxies=galaxies, grid=fit.grids.uniform, during_analysis=during_analysis + galaxies=galaxies, grid=fit.grids.lp, during_analysis=during_analysis ) plotter.galaxies_1d( - galaxies=galaxies, grid=fit.grids.uniform, during_analysis=during_analysis + galaxies=galaxies, grid=fit.grids.lp, during_analysis=during_analysis ) if fit.inversion is not None: plotter.inversion(inversion=fit.inversion, during_analysis=during_analysis) diff --git a/autogalaxy/interferometer/fit_interferometer.py b/autogalaxy/interferometer/fit_interferometer.py index 7f7f6fe6..2606da88 100644 --- a/autogalaxy/interferometer/fit_interferometer.py +++ b/autogalaxy/interferometer/fit_interferometer.py @@ -101,7 +101,7 @@ def profile_visibilities(self) -> aa.Visibilities: a Fourier transform to the sum of light profile images. """ return self.galaxies.visibilities_from( - grid=self.grids.uniform, transformer=self.dataset.transformer + grid=self.grids.lp, transformer=self.dataset.transformer ) @property @@ -173,7 +173,7 @@ def galaxy_model_image_dict(self) -> Dict[Galaxy, np.ndarray]: data being fitted. """ galaxy_model_image_dict = self.galaxies.galaxy_image_2d_dict_from( - grid=self.grids.uniform + grid=self.grids.lp ) galaxy_linear_obj_image_dict = self.galaxy_linear_obj_data_dict_from( @@ -197,7 +197,7 @@ def galaxy_model_visibilities_dict(self) -> Dict[Galaxy, np.ndarray]: data being fitted. """ galaxy_model_visibilities_dict = self.galaxies.galaxy_visibilities_dict_from( - grid=self.grids.uniform, transformer=self.dataset.transformer + grid=self.grids.lp, transformer=self.dataset.transformer ) galaxy_linear_obj_data_dict = self.galaxy_linear_obj_data_dict_from( diff --git a/autogalaxy/interferometer/model/visualizer.py b/autogalaxy/interferometer/model/visualizer.py index 03e5d465..84d0f048 100644 --- a/autogalaxy/interferometer/model/visualizer.py +++ b/autogalaxy/interferometer/model/visualizer.py @@ -86,10 +86,10 @@ def visualize( galaxies = fit.galaxies_linear_light_profiles_to_light_profiles PlotterInterface.galaxies( - galaxies=galaxies, grid=fit.grids.uniform, during_analysis=during_analysis + galaxies=galaxies, grid=fit.grids.lp, during_analysis=during_analysis ) PlotterInterface.galaxies_1d( - galaxies=galaxies, grid=fit.grids.uniform, during_analysis=during_analysis + galaxies=galaxies, grid=fit.grids.lp, during_analysis=during_analysis ) try: diff --git a/autogalaxy/interferometer/plot/fit_interferometer_plotters.py b/autogalaxy/interferometer/plot/fit_interferometer_plotters.py index 710aec7b..8fd3995a 100644 --- a/autogalaxy/interferometer/plot/fit_interferometer_plotters.py +++ b/autogalaxy/interferometer/plot/fit_interferometer_plotters.py @@ -111,7 +111,7 @@ def galaxies_plotter_from(self, galaxies: List[Galaxy]) -> GalaxiesPlotter: """ return GalaxiesPlotter( galaxies=galaxies, - grid=self.fit.grids.uniform, + grid=self.fit.grids.lp, mat_plot_2d=self.mat_plot_2d, visuals_2d=self.get_visuals_2d_real_space(), include_2d=self.include_2d, diff --git a/autogalaxy/plot/get_visuals/two_d.py b/autogalaxy/plot/get_visuals/two_d.py index b9aac1b5..73f0efc0 100644 --- a/autogalaxy/plot/get_visuals/two_d.py +++ b/autogalaxy/plot/get_visuals/two_d.py @@ -280,7 +280,7 @@ def via_fit_imaging_from(self, fit: FitImaging) -> Visuals2D: visuals_2d_via_fit = super().via_fit_imaging_from(fit=fit) visuals_2d_via_light_mass_obj = self.via_light_mass_obj_from( - light_mass_obj=fit.galaxies, grid=fit.grids.uniform + light_mass_obj=fit.galaxies, grid=fit.grids.lp ) return visuals_2d_via_fit + visuals_2d_via_light_mass_obj diff --git a/autogalaxy/quantity/fit_quantity.py b/autogalaxy/quantity/fit_quantity.py index 675e37db..6e976b88 100644 --- a/autogalaxy/quantity/fit_quantity.py +++ b/autogalaxy/quantity/fit_quantity.py @@ -56,7 +56,7 @@ def __init__( def model_data(self): if self.model_data_manual is None: func = getattr(self.light_mass_obj, self.func_str) - return func(grid=self.grids.uniform) + return func(grid=self.grids.lp) return self.model_data_manual diff --git a/test_autogalaxy/aggregator/imaging/test_aggregator_imaging.py b/test_autogalaxy/aggregator/imaging/test_aggregator_imaging.py index 8e78b7a8..27623220 100644 --- a/test_autogalaxy/aggregator/imaging/test_aggregator_imaging.py +++ b/test_autogalaxy/aggregator/imaging/test_aggregator_imaging.py @@ -13,7 +13,7 @@ def test__dataset_generator_from_aggregator__analysis_has_single_dataset( psf=psf_3x3, noise_map=noise_map_7x7, over_sampling=ag.OverSamplingDataset( - uniform=5, + lp=5, pixelization=3, ), ) @@ -34,7 +34,7 @@ def test__dataset_generator_from_aggregator__analysis_has_single_dataset( for dataset_list in dataset_gen: assert (dataset_list[0].data == masked_imaging_7x7.data).all() - assert dataset_list[0].grids.uniform.over_sampling_size[0] == 5 + assert dataset_list[0].grids.lp.over_sampling_size[0] == 5 assert dataset_list[0].grids.pixelization.over_sampling_size[0] == 3 clean(database_file=database_file) diff --git a/test_autogalaxy/analysis/test_plotter_interface.py b/test_autogalaxy/analysis/test_plotter_interface.py index 003ca4b0..e5a08273 100644 --- a/test_autogalaxy/analysis/test_plotter_interface.py +++ b/test_autogalaxy/analysis/test_plotter_interface.py @@ -24,7 +24,7 @@ def test__galaxies( plotter_interface.galaxies( galaxies=galaxies_7x7, - grid=masked_imaging_7x7.grids.uniform, + grid=masked_imaging_7x7.grids.lp, during_analysis=False, ) @@ -57,7 +57,7 @@ def test__galaxies_1d( plotter_interface.galaxies_1d( galaxies=galaxies_7x7, - grid=masked_imaging_7x7.grids.uniform, + grid=masked_imaging_7x7.grids.lp, during_analysis=False, ) diff --git a/test_autogalaxy/imaging/test_fit_imaging.py b/test_autogalaxy/imaging/test_fit_imaging.py index 457507b1..3b3103fc 100644 --- a/test_autogalaxy/imaging/test_fit_imaging.py +++ b/test_autogalaxy/imaging/test_fit_imaging.py @@ -237,13 +237,13 @@ def test__galaxy_model_image_dict(masked_imaging_7x7): fit = ag.FitImaging(dataset=masked_imaging_7x7, galaxies=[g0, g1, g2, g3]) g0_blurred_image_2d = g0.blurred_image_2d_from( - grid=masked_imaging_7x7.grids.uniform, + grid=masked_imaging_7x7.grids.lp, blurring_grid=masked_imaging_7x7.grids.blurring, convolver=masked_imaging_7x7.convolver, ) g1_blurred_image_2d = g1.blurred_image_2d_from( - grid=masked_imaging_7x7.grids.uniform, + grid=masked_imaging_7x7.grids.lp, blurring_grid=masked_imaging_7x7.grids.blurring, convolver=masked_imaging_7x7.convolver, ) @@ -426,14 +426,14 @@ def test___unmasked_blurred_images(masked_imaging_7x7): fit = ag.FitImaging(dataset=masked_imaging_7x7, galaxies=[g0, g1]) unmasked_blurred_image = galaxies.unmasked_blurred_image_2d_from( - grid=masked_imaging_7x7.grids.uniform, psf=masked_imaging_7x7.psf + grid=masked_imaging_7x7.grids.lp, psf=masked_imaging_7x7.psf ) assert (fit.unmasked_blurred_image == unmasked_blurred_image).all() unmasked_blurred_image_of_galaxies_list = ( galaxies.unmasked_blurred_image_2d_list_from( - grid=masked_imaging_7x7.grids.uniform, psf=masked_imaging_7x7.psf + grid=masked_imaging_7x7.grids.lp, psf=masked_imaging_7x7.psf ) ) diff --git a/test_autogalaxy/imaging/test_simulate_and_fit_imaging.py b/test_autogalaxy/imaging/test_simulate_and_fit_imaging.py index 5a61f8e6..f783de98 100644 --- a/test_autogalaxy/imaging/test_simulate_and_fit_imaging.py +++ b/test_autogalaxy/imaging/test_simulate_and_fit_imaging.py @@ -60,7 +60,7 @@ def test__perfect_fit__chi_squared_0(): noise_map_path=path.join(file_path, "noise_map.fits"), psf_path=path.join(file_path, "psf.fits"), pixel_scales=0.2, - over_sampling=ag.OverSamplingDataset(uniform=1), + over_sampling=ag.OverSamplingDataset(lp=1), ) mask = ag.Mask2D.circular( @@ -171,7 +171,7 @@ def test__simulate_imaging_data_and_fit__linear_light_profiles_agree_with_standa masked_dataset = dataset.apply_mask(mask=mask) masked_dataset = masked_dataset.apply_over_sampling( - over_sampling=ag.OverSamplingDataset(uniform=1) + over_sampling=ag.OverSamplingDataset(lp=1) ) fit = ag.FitImaging(dataset=masked_dataset, galaxies=[galaxy]) @@ -203,7 +203,7 @@ def test__simulate_imaging_data_and_fit__linear_light_profiles_agree_with_standa assert fit_linear.figure_of_merit == pytest.approx(-45.02798, 1.0e-4) galaxy_image = galaxy.blurred_image_2d_from( - grid=masked_dataset.grids.uniform, + grid=masked_dataset.grids.lp, convolver=masked_dataset.convolver, blurring_grid=masked_dataset.grids.blurring, ) diff --git a/test_autogalaxy/interferometer/test_fit_interferometer.py b/test_autogalaxy/interferometer/test_fit_interferometer.py index 23e3963c..e55deff7 100644 --- a/test_autogalaxy/interferometer/test_fit_interferometer.py +++ b/test_autogalaxy/interferometer/test_fit_interferometer.py @@ -148,8 +148,8 @@ def test___galaxy_model_image_dict(interferometer_7): settings_inversion=ag.SettingsInversion(use_w_tilde=False), ) - g0_image = g0.image_2d_from(grid=interferometer_7.grids.uniform) - g1_image = g1.image_2d_from(grid=interferometer_7.grids.uniform) + g0_image = g0.image_2d_from(grid=interferometer_7.grids.lp) + g1_image = g1.image_2d_from(grid=interferometer_7.grids.lp) assert fit.galaxy_model_image_dict[g0] == pytest.approx(g0_image, 1.0e-4) assert fit.galaxy_model_image_dict[g1] == pytest.approx(g1_image, 1.0e-4) @@ -187,7 +187,7 @@ def test___galaxy_model_image_dict(interferometer_7): mapper_grids = pixelization.mesh.mapper_grids_from( mask=interferometer_7.real_space_mask, - source_plane_data_grid=interferometer_7.grids.uniform, + source_plane_data_grid=interferometer_7.grids.lp, border_relocator=interferometer_7.grids.border_relocator, source_plane_mesh_grid=None, ) @@ -265,10 +265,10 @@ def test___galaxy_model_visibilities_dict(interferometer_7): ) g0_visibilities = g0.visibilities_from( - grid=interferometer_7.grids.uniform, transformer=interferometer_7.transformer + grid=interferometer_7.grids.lp, transformer=interferometer_7.transformer ) g1_visibilities = g1.visibilities_from( - grid=interferometer_7.grids.uniform, transformer=interferometer_7.transformer + grid=interferometer_7.grids.lp, transformer=interferometer_7.transformer ) assert fit.galaxy_model_visibilities_dict[g0] == pytest.approx( @@ -313,7 +313,7 @@ def test___galaxy_model_visibilities_dict(interferometer_7): mapper_grids = pixelization.mesh.mapper_grids_from( mask=interferometer_7.real_space_mask, - source_plane_data_grid=interferometer_7.grids.uniform, + source_plane_data_grid=interferometer_7.grids.lp, border_relocator=interferometer_7.grids.border_relocator, source_plane_mesh_grid=None, ) diff --git a/test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py b/test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py index 68131d80..47a219ce 100644 --- a/test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py +++ b/test_autogalaxy/interferometer/test_simulate_and_fit_interferometer.py @@ -206,14 +206,14 @@ def test__linear_light_profiles_agree_with_standard_light_profiles(): ] == pytest.approx(0.2, 1.0e-2) assert fit.log_likelihood == pytest.approx(fit_linear.log_likelihood, 1.0e-4) - galaxy_image = galaxy.image_2d_from(grid=dataset.grids.uniform) + galaxy_image = galaxy.image_2d_from(grid=dataset.grids.lp) assert fit_linear.galaxy_model_image_dict[galaxy_linear] == pytest.approx( galaxy_image, 1.0e-4 ) galaxy_visibilities = galaxy.visibilities_from( - grid=dataset.grids.uniform, transformer=dataset.transformer + grid=dataset.grids.lp, transformer=dataset.transformer ) assert fit_linear.galaxy_model_visibilities_dict[galaxy_linear] == pytest.approx( diff --git a/test_autogalaxy/quantity/test_dataset_quantity.py b/test_autogalaxy/quantity/test_dataset_quantity.py index 267c0937..de314d0f 100644 --- a/test_autogalaxy/quantity/test_dataset_quantity.py +++ b/test_autogalaxy/quantity/test_dataset_quantity.py @@ -75,20 +75,20 @@ def test__grid( ): dataset = dataset_quantity_7x7_array_2d.apply_mask(mask=mask_2d_7x7) - assert isinstance(dataset.grids.uniform, ag.Grid2D) - assert (dataset.grids.uniform == grid_2d_7x7).all() + assert isinstance(dataset.grids.lp, ag.Grid2D) + assert (dataset.grids.lp == grid_2d_7x7).all() dataset_quantity = ag.DatasetQuantity( data=ag.Array2D.ones(shape_native=(7, 7), pixel_scales=1.0), noise_map=ag.Array2D.full( fill_value=2.0, shape_native=(7, 7), pixel_scales=1.0 ), - over_sampling=ag.OverSamplingDataset(uniform=4), + over_sampling=ag.OverSamplingDataset(lp=4), ) dataset = dataset_quantity.apply_mask(mask=mask_2d_7x7) - assert (dataset.grids.uniform == grid_2d_7x7).all() + assert (dataset.grids.lp == grid_2d_7x7).all() def test__vector_data__y_x():