diff --git a/autogalaxy/analysis/plotter.py b/autogalaxy/analysis/plotter.py index d8733aaa..6f9bbb87 100644 --- a/autogalaxy/analysis/plotter.py +++ b/autogalaxy/analysis/plotter.py @@ -114,7 +114,7 @@ def should_plot(name): ) if should_plot("fits_galaxy_images"): - galaxies_plots.save_galaxy_images_fits( + galaxies_plots.fits_galaxy_images( galaxies=galaxies, grid=grid, output_path=self.image_path ) @@ -181,6 +181,6 @@ def should_plot(name): ) if should_plot("fits_adapt_images"): - adapt_plots.save_adapt_images_fits( + adapt_plots.fits_adapt_images( adapt_images=adapt_images, output_path=self.image_path ) diff --git a/autogalaxy/ellipse/plot/fit_ellipse_plots.py b/autogalaxy/ellipse/plot/fit_ellipse_plots.py index 501c12ae..eb4e3197 100644 --- a/autogalaxy/ellipse/plot/fit_ellipse_plots.py +++ b/autogalaxy/ellipse/plot/fit_ellipse_plots.py @@ -160,7 +160,7 @@ def subplot_fit_ellipse( _plot_ellipse_residuals(fit_list=fit_list, for_subplot=True, ax=axes[1]) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_fit_ellipse", output_format) + _save_subplot(fig, output_path, "fit_ellipse", output_format) def subplot_ellipse_errors( @@ -243,4 +243,4 @@ def subplot_ellipse_errors( ) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_ellipse_errors", output_format) + _save_subplot(fig, output_path, "ellipse_errors", output_format) diff --git a/autogalaxy/galaxy/plot/adapt_plots.py b/autogalaxy/galaxy/plot/adapt_plots.py index 30f2b3ad..e2991282 100644 --- a/autogalaxy/galaxy/plot/adapt_plots.py +++ b/autogalaxy/galaxy/plot/adapt_plots.py @@ -59,10 +59,10 @@ def subplot_adapt_images( ) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_adapt_images", output_format) + _save_subplot(fig, output_path, "adapt_images", output_format) -def save_adapt_images_fits(adapt_images, output_path) -> None: +def fits_adapt_images(adapt_images, output_path) -> None: """Write FITS files for the adapt images and image-plane mesh grids. Writes up to two FITS files into *output_path*: diff --git a/autogalaxy/galaxy/plot/galaxies_plots.py b/autogalaxy/galaxy/plot/galaxies_plots.py index 227c4767..7a5a6a12 100644 --- a/autogalaxy/galaxy/plot/galaxies_plots.py +++ b/autogalaxy/galaxy/plot/galaxies_plots.py @@ -214,10 +214,10 @@ def subplot_galaxy_images( ) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_galaxy_images", output_format) + _save_subplot(fig, output_path, "galaxy_images", output_format) -def save_galaxy_images_fits( +def fits_galaxy_images( galaxies, grid: aa.type.Grid1D2DLike, output_path, diff --git a/autogalaxy/galaxy/plot/galaxy_plots.py b/autogalaxy/galaxy/plot/galaxy_plots.py index ffcd72ae..35f9b32d 100644 --- a/autogalaxy/galaxy/plot/galaxy_plots.py +++ b/autogalaxy/galaxy/plot/galaxy_plots.py @@ -61,7 +61,7 @@ def subplot_of_light_profiles( ) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_image", output_format) + _save_subplot(fig, output_path, "image", output_format) def subplot_of_mass_profiles( diff --git a/autogalaxy/imaging/model/plotter.py b/autogalaxy/imaging/model/plotter.py index aba09e0c..92f002e7 100644 --- a/autogalaxy/imaging/model/plotter.py +++ b/autogalaxy/imaging/model/plotter.py @@ -1,4 +1,3 @@ -from pathlib import Path from typing import List from autoconf.fitsable import hdu_list_for_output_from @@ -9,69 +8,15 @@ from autogalaxy.imaging.fit_imaging import FitImaging from autogalaxy.imaging.plot import fit_imaging_plots -from autogalaxy.imaging.plot.fit_imaging_plots import subplot_fit_imaging_list +from autogalaxy.imaging.plot.fit_imaging_plots import ( + subplot_fit_imaging_list, + fits_fit, + fits_galaxy_images, + fits_model_galaxy_images, +) from autogalaxy.analysis.plotter import Plotter, plot_setting -def fits_to_fits(should_plot, image_path: Path, fit: FitImaging): - """ - Write fit residuals and galaxy images from a ``FitImaging`` to FITS files. - - Controlled by the ``fits_fit``, ``fits_galaxy_images``, and - ``fits_model_galaxy_images`` toggles in ``config/visualize/plots.yaml``. - - Parameters - ---------- - should_plot - A callable that accepts a plot-name string and returns ``True`` when - that plot is enabled in the config. - image_path - Directory where the FITS files are written. - fit - The imaging fit whose arrays are saved to FITS. - """ - if should_plot("fits_fit"): - image_list = [ - fit.model_data.native_for_fits, - fit.residual_map.native_for_fits, - fit.normalized_residual_map.native_for_fits, - fit.chi_squared_map.native_for_fits, - ] - - hdu_list = hdu_list_for_output_from( - values_list=[image_list[0].mask.astype("float")] + image_list, - ext_name_list=[ - "mask", - "model_data", - "residual_map", - "normalized_residual_map", - "chi_squared_map", - ], - header_dict=fit.mask.header_dict, - ) - hdu_list.writeto(image_path / "fit.fits", overwrite=True) - - if should_plot("fits_galaxy_images"): - number_plots = len(fit.galaxy_image_dict.keys()) + 1 - image_list = [image.native_for_fits for image in fit.galaxy_image_dict.values()] - hdu_list = hdu_list_for_output_from( - values_list=[image_list[0].mask.astype("float")] + image_list, - ext_name_list=["mask"] + [f"galaxy_{i}" for i in range(number_plots)], - header_dict=fit.mask.header_dict, - ) - hdu_list.writeto(image_path / "galaxy_images.fits", overwrite=True) - - if should_plot("fits_model_galaxy_images"): - number_plots = len(fit.galaxy_model_image_dict.keys()) + 1 - image_list = [image.native_for_fits for image in fit.galaxy_model_image_dict.values()] - hdu_list = hdu_list_for_output_from( - values_list=[image_list[0].mask.astype("float")] + image_list, - ext_name_list=["mask"] + [f"galaxy_{i}" for i in range(number_plots)], - header_dict=fit.mask.header_dict, - ) - hdu_list.writeto(image_path / "model_galaxy_images.fits", overwrite=True) - - class PlotterImaging(Plotter): def imaging(self, dataset: aa.Imaging): """ @@ -153,7 +98,14 @@ def should_plot(name): output_format=self.fmt, ) - fits_to_fits(should_plot=should_plot, image_path=self.image_path, fit=fit) + if should_plot("fits_fit"): + fits_fit(fit=fit, output_path=self.image_path) + + if should_plot("fits_galaxy_images"): + fits_galaxy_images(fit=fit, output_path=self.image_path) + + if should_plot("fits_model_galaxy_images"): + fits_model_galaxy_images(fit=fit, output_path=self.image_path) def imaging_combined(self, dataset_list: List[aa.Imaging]): """ diff --git a/autogalaxy/imaging/plot/fit_imaging_plots.py b/autogalaxy/imaging/plot/fit_imaging_plots.py index 4268c6b5..bbd28cf9 100644 --- a/autogalaxy/imaging/plot/fit_imaging_plots.py +++ b/autogalaxy/imaging/plot/fit_imaging_plots.py @@ -1,6 +1,8 @@ import matplotlib.pyplot as plt +from pathlib import Path import autoarray as aa +from autoconf.fitsable import hdu_list_for_output_from from autoarray.plot.utils import conf_subplot_figsize from autogalaxy.imaging.fit_imaging import FitImaging @@ -165,3 +167,78 @@ def subplot_fit_imaging_list( plot_array(array=fit.chi_squared_map, title="Chi-Squared Map", cb_unit=r"$\chi^2$", ax=axes[i][4]) plt.tight_layout() _save_subplot(fig, output_path, output_filename, output_format) + + +def fits_fit(fit: FitImaging, output_path) -> None: + """Write fit residual maps from a ``FitImaging`` to ``fit.fits``. + + Extensions: ``mask``, ``model_data``, ``residual_map``, + ``normalized_residual_map``, ``chi_squared_map``. + + Parameters + ---------- + fit + The imaging fit whose residual arrays are saved. + output_path + Directory in which to write ``fit.fits``. + """ + image_list = [ + fit.model_data.native_for_fits, + fit.residual_map.native_for_fits, + fit.normalized_residual_map.native_for_fits, + fit.chi_squared_map.native_for_fits, + ] + hdu_list = hdu_list_for_output_from( + values_list=[image_list[0].mask.astype("float")] + image_list, + ext_name_list=[ + "mask", + "model_data", + "residual_map", + "normalized_residual_map", + "chi_squared_map", + ], + header_dict=fit.mask.header_dict, + ) + hdu_list.writeto(Path(output_path) / "fit.fits", overwrite=True) + + +def fits_galaxy_images(fit: FitImaging, output_path) -> None: + """Write per-galaxy images from a ``FitImaging`` to ``galaxy_images.fits``. + + Extensions: ``mask``, ``galaxy_0``, ``galaxy_1``, … + + Parameters + ---------- + fit + The imaging fit whose per-galaxy images are saved. + output_path + Directory in which to write ``galaxy_images.fits``. + """ + image_list = [image.native_for_fits for image in fit.galaxy_image_dict.values()] + hdu_list = hdu_list_for_output_from( + values_list=[image_list[0].mask.astype("float")] + image_list, + ext_name_list=["mask"] + [f"galaxy_{i}" for i in range(len(image_list))], + header_dict=fit.mask.header_dict, + ) + hdu_list.writeto(Path(output_path) / "galaxy_images.fits", overwrite=True) + + +def fits_model_galaxy_images(fit: FitImaging, output_path) -> None: + """Write per-galaxy model images from a ``FitImaging`` to ``model_galaxy_images.fits``. + + Extensions: ``mask``, ``galaxy_0``, ``galaxy_1``, … + + Parameters + ---------- + fit + The imaging fit whose per-galaxy model images are saved. + output_path + Directory in which to write ``model_galaxy_images.fits``. + """ + image_list = [image.native_for_fits for image in fit.galaxy_model_image_dict.values()] + hdu_list = hdu_list_for_output_from( + values_list=[image_list[0].mask.astype("float")] + image_list, + ext_name_list=["mask"] + [f"galaxy_{i}" for i in range(len(image_list))], + header_dict=fit.mask.header_dict, + ) + hdu_list.writeto(Path(output_path) / "model_galaxy_images.fits", overwrite=True) diff --git a/autogalaxy/interferometer/model/plotter.py b/autogalaxy/interferometer/model/plotter.py index 8b0a1e51..e464fcb3 100644 --- a/autogalaxy/interferometer/model/plotter.py +++ b/autogalaxy/interferometer/model/plotter.py @@ -1,78 +1,18 @@ -from pathlib import Path - -from autoconf.fitsable import hdu_list_for_output_from - import autoarray as aa from autoarray.dataset.plot.interferometer_plots import subplot_interferometer_dirty_images +from autoconf.fitsable import hdu_list_for_output_from + from autogalaxy.interferometer.fit_interferometer import FitInterferometer from autogalaxy.interferometer.plot import fit_interferometer_plots +from autogalaxy.interferometer.plot.fit_interferometer_plots import ( + fits_galaxy_images, + fits_dirty_images, +) from autogalaxy.analysis.plotter import Plotter, plot_setting -def fits_to_fits( - should_plot: bool, - image_path: Path, - fit: FitInterferometer, -): - """ - Write galaxy images and dirty-image residuals from a ``FitInterferometer`` to FITS files. - - Controlled by the ``fits_galaxy_images`` and ``fits_dirty_images`` toggles in - ``config/visualize/plots.yaml``. - - Parameters - ---------- - should_plot - A callable that accepts a plot-name string and returns ``True`` when - that plot is enabled in the config. - image_path - Directory where the FITS files are written. - fit - The interferometer fit whose arrays are saved to FITS. - """ - if should_plot("fits_galaxy_images"): - - image_list = [image.native_for_fits for image in fit.galaxy_image_dict.values()] - - hdu_list = hdu_list_for_output_from( - values_list=[image_list[0].mask.astype("float")] + image_list, - ext_name_list=["mask"] - + [f"galaxy_{i}" for i in range(len(fit.galaxy_image_dict.values()))], - header_dict=fit.dataset.real_space_mask.header_dict, - ) - - hdu_list.writeto(image_path / "galaxy_images.fits", overwrite=True) - - if should_plot("fits_dirty_images"): - - image_list = [ - fit.dirty_image.native_for_fits, - fit.dirty_noise_map.native_for_fits, - fit.dirty_model_image.native_for_fits, - fit.dirty_residual_map.native_for_fits, - fit.dirty_normalized_residual_map.native_for_fits, - fit.dirty_chi_squared_map.native_for_fits, - ] - - hdu_list = hdu_list_for_output_from( - values_list=[image_list[0].mask.astype("float")] + image_list, - ext_name_list=["mask"] - + [ - "dirty_image", - "dirty_noise_map", - "dirty_model_image", - "dirty_residual_map", - "dirty_normalized_residual_map", - "dirty_chi_squared_map", - ], - header_dict=fit.dataset.real_space_mask.header_dict, - ) - - hdu_list.writeto(image_path / "fit_dirty_images.fits", overwrite=True) - - class PlotterInterferometer(Plotter): def interferometer(self, dataset: aa.Interferometer): """ @@ -162,8 +102,8 @@ def should_plot(name): output_format=self.fmt, ) - fits_to_fits( - should_plot=should_plot, - image_path=self.image_path, - fit=fit, - ) + if should_plot("fits_galaxy_images"): + fits_galaxy_images(fit=fit, output_path=self.image_path) + + if should_plot("fits_dirty_images"): + fits_dirty_images(fit=fit, output_path=self.image_path) diff --git a/autogalaxy/interferometer/plot/fit_interferometer_plots.py b/autogalaxy/interferometer/plot/fit_interferometer_plots.py index b3faff63..f8aaba73 100644 --- a/autogalaxy/interferometer/plot/fit_interferometer_plots.py +++ b/autogalaxy/interferometer/plot/fit_interferometer_plots.py @@ -1,7 +1,9 @@ import matplotlib.pyplot as plt import numpy as np +from pathlib import Path import autoarray as aa +from autoconf.fitsable import hdu_list_for_output_from from autoarray.plot import plot_visibilities_1d from autoarray.plot.utils import conf_subplot_figsize @@ -53,7 +55,7 @@ def subplot_fit( plot_visibilities_1d(vis, axes_flat[i], title) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_fit", output_format) + _save_subplot(fig, output_path, "fit", output_format) def subplot_fit_dirty_images( @@ -109,7 +111,7 @@ def subplot_fit_dirty_images( ) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_fit_dirty_images", output_format) + _save_subplot(fig, output_path, "fit_dirty_images", output_format) def subplot_fit_real_space( @@ -174,4 +176,62 @@ def subplot_fit_real_space( ax=axes_flat[i], ) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_fit_real_space", output_format) + _save_subplot(fig, output_path, "fit_real_space", output_format) + + +def fits_galaxy_images(fit: FitInterferometer, output_path) -> None: + """Write per-galaxy images from a ``FitInterferometer`` to ``galaxy_images.fits``. + + Extensions: ``mask``, ``galaxy_0``, ``galaxy_1``, … + + Parameters + ---------- + fit + The interferometer fit whose per-galaxy images are saved. + output_path + Directory in which to write ``galaxy_images.fits``. + """ + image_list = [image.native_for_fits for image in fit.galaxy_image_dict.values()] + hdu_list = hdu_list_for_output_from( + values_list=[image_list[0].mask.astype("float")] + image_list, + ext_name_list=["mask"] + [f"galaxy_{i}" for i in range(len(image_list))], + header_dict=fit.dataset.real_space_mask.header_dict, + ) + hdu_list.writeto(Path(output_path) / "galaxy_images.fits", overwrite=True) + + +def fits_dirty_images(fit: FitInterferometer, output_path) -> None: + """Write dirty-image residual maps from a ``FitInterferometer`` to ``fit_dirty_images.fits``. + + Extensions: ``mask``, ``dirty_image``, ``dirty_noise_map``, ``dirty_model_image``, + ``dirty_residual_map``, ``dirty_normalized_residual_map``, ``dirty_chi_squared_map``. + + Parameters + ---------- + fit + The interferometer fit whose dirty-image arrays are saved. + output_path + Directory in which to write ``fit_dirty_images.fits``. + """ + image_list = [ + fit.dirty_image.native_for_fits, + fit.dirty_noise_map.native_for_fits, + fit.dirty_model_image.native_for_fits, + fit.dirty_residual_map.native_for_fits, + fit.dirty_normalized_residual_map.native_for_fits, + fit.dirty_chi_squared_map.native_for_fits, + ] + hdu_list = hdu_list_for_output_from( + values_list=[image_list[0].mask.astype("float")] + image_list, + ext_name_list=[ + "mask", + "dirty_image", + "dirty_noise_map", + "dirty_model_image", + "dirty_residual_map", + "dirty_normalized_residual_map", + "dirty_chi_squared_map", + ], + header_dict=fit.dataset.real_space_mask.header_dict, + ) + hdu_list.writeto(Path(output_path) / "fit_dirty_images.fits", overwrite=True) diff --git a/autogalaxy/plot/plot_utils.py b/autogalaxy/plot/plot_utils.py index ab684a19..1c4a0083 100644 --- a/autogalaxy/plot/plot_utils.py +++ b/autogalaxy/plot/plot_utils.py @@ -134,6 +134,7 @@ def plot_array( positions=None, lines=None, grid=None, + cb_unit=None, ax=None, ): """Plot an autoarray ``Array2D`` to file or onto an existing ``Axes``. @@ -215,6 +216,7 @@ def plot_array( use_log10=use_log10, vmin=vmin, vmax=vmax, + cb_unit=cb_unit, output_path=_output_path, output_filename=output_filename, output_format=output_format, diff --git a/autogalaxy/profiles/plot/basis_plots.py b/autogalaxy/profiles/plot/basis_plots.py index 20d191b7..25134cb4 100644 --- a/autogalaxy/profiles/plot/basis_plots.py +++ b/autogalaxy/profiles/plot/basis_plots.py @@ -77,4 +77,4 @@ def subplot_image( ) plt.tight_layout() - _save_subplot(fig, output_path, "subplot_basis_image", output_format) + _save_subplot(fig, output_path, "basis_image", output_format) diff --git a/test_autogalaxy/analysis/test_plotter.py b/test_autogalaxy/analysis/test_plotter.py index f2131f71..fec2e451 100644 --- a/test_autogalaxy/analysis/test_plotter.py +++ b/test_autogalaxy/analysis/test_plotter.py @@ -27,8 +27,8 @@ def test__galaxies(masked_imaging_7x7, galaxies_7x7, plot_path, plot_patch): grid=masked_imaging_7x7.grids.lp, ) - assert path.join(plot_path, "subplot_galaxies.png") in plot_patch.paths - assert path.join(plot_path, "subplot_galaxy_images.png") in plot_patch.paths + assert path.join(plot_path, "galaxies.png") in plot_patch.paths + assert path.join(plot_path, "galaxy_images.png") in plot_patch.paths image = ag.ndarray_via_fits_from( file_path=path.join(plot_path, "galaxy_images.fits"), hdu=1 @@ -51,7 +51,7 @@ def test__inversion( inversion=rectangular_inversion_7x7_3x3, ) - assert path.join(plot_path, "subplot_inversion_0.png") in plot_patch.paths + assert path.join(plot_path, "inversion_0_0.png") in plot_patch.paths with open( path.join(plot_path, "source_plane_reconstruction_0.csv"), mode="r" @@ -92,7 +92,7 @@ def test__adapt_images( plot_path = path.join(plot_path) - assert path.join(plot_path, "subplot_adapt_images.png") in plot_patch.paths + assert path.join(plot_path, "adapt_images.png") in plot_patch.paths image = ag.ndarray_via_fits_from( file_path=path.join(plot_path, "adapt_images.fits"), hdu=1 diff --git a/test_autogalaxy/galaxy/plot/test_adapt_plotters.py b/test_autogalaxy/galaxy/plot/test_adapt_plotters.py index 2b9c7a8f..b95bd10b 100644 --- a/test_autogalaxy/galaxy/plot/test_adapt_plotters.py +++ b/test_autogalaxy/galaxy/plot/test_adapt_plotters.py @@ -22,4 +22,4 @@ def test__plot_adapt_adapt_images( output_path=plot_path, output_format="png", ) - assert path.join(plot_path, "subplot_adapt_images.png") in plot_patch.paths + assert path.join(plot_path, "adapt_images.png") in plot_patch.paths diff --git a/test_autogalaxy/galaxy/plot/test_galaxies_plotter.py b/test_autogalaxy/galaxy/plot/test_galaxies_plotter.py index 19ee06d6..17037ff1 100644 --- a/test_autogalaxy/galaxy/plot/test_galaxies_plotter.py +++ b/test_autogalaxy/galaxy/plot/test_galaxies_plotter.py @@ -20,7 +20,7 @@ def test__galaxies_sub_plot_output(galaxies_x2_7x7, grid_2d_7x7, plot_path, plot output_path=plot_path, output_format="png", ) - assert path.join(plot_path, "subplot_galaxies.png") in plot_patch.paths + assert path.join(plot_path, "galaxies.png") in plot_patch.paths aplt.subplot_galaxy_images( galaxies=galaxies_x2_7x7, @@ -28,4 +28,4 @@ def test__galaxies_sub_plot_output(galaxies_x2_7x7, grid_2d_7x7, plot_path, plot output_path=plot_path, output_format="png", ) - assert path.join(plot_path, "subplot_galaxy_images.png") in plot_patch.paths + assert path.join(plot_path, "galaxy_images.png") in plot_patch.paths diff --git a/test_autogalaxy/galaxy/plot/test_galaxy_plotters.py b/test_autogalaxy/galaxy/plot/test_galaxy_plotters.py index e7f60020..6164be16 100644 --- a/test_autogalaxy/galaxy/plot/test_galaxy_plotters.py +++ b/test_autogalaxy/galaxy/plot/test_galaxy_plotters.py @@ -26,7 +26,7 @@ def test__subplots_galaxy_quantities__all_are_output( output_format="png", ) - assert path.join(plot_path, "subplot_image.png") in plot_patch.paths + assert path.join(plot_path, "image.png") in plot_patch.paths aplt.subplot_galaxy_mass_profiles( galaxy=gal_x1_lp_x1_mp, @@ -39,7 +39,7 @@ def test__subplots_galaxy_quantities__all_are_output( output_format="png", ) - assert path.join(plot_path, "subplot_convergence.png") in plot_patch.paths - assert path.join(plot_path, "subplot_potential.png") in plot_patch.paths - assert path.join(plot_path, "subplot_deflections_y.png") in plot_patch.paths - assert path.join(plot_path, "subplot_deflections_x.png") in plot_patch.paths + assert path.join(plot_path, "convergence.png") in plot_patch.paths + assert path.join(plot_path, "potential.png") in plot_patch.paths + assert path.join(plot_path, "deflections_y.png") in plot_patch.paths + assert path.join(plot_path, "deflections_x.png") in plot_patch.paths diff --git a/test_autogalaxy/imaging/model/test_plotter_imaging.py b/test_autogalaxy/imaging/model/test_plotter_imaging.py index a6dcc958..386d237e 100644 --- a/test_autogalaxy/imaging/model/test_plotter_imaging.py +++ b/test_autogalaxy/imaging/model/test_plotter_imaging.py @@ -21,7 +21,7 @@ def test__imaging(imaging_7x7, plot_path, plot_patch): plotter.imaging(dataset=imaging_7x7) - assert path.join(plot_path, "subplot_dataset.png") in plot_patch.paths + assert path.join(plot_path, "dataset.png") in plot_patch.paths image = ag.ndarray_via_fits_from( file_path=path.join(plot_path, "dataset.fits"), hdu=1 @@ -38,7 +38,7 @@ def test__imaging_combined(imaging_7x7, plot_path, plot_patch): visualizer.imaging_combined(dataset_list=[imaging_7x7, imaging_7x7]) - assert path.join(plot_path, "subplot_dataset_combined.png") in plot_patch.paths + assert path.join(plot_path, "dataset_combined.png") in plot_patch.paths def test__fit_imaging( @@ -56,7 +56,7 @@ def test__fit_imaging( fit=fit_imaging_x2_galaxy_inversion_7x7, ) - assert path.join(plot_path, "subplot_fit.png") in plot_patch.paths + assert path.join(plot_path, "fit.png") in plot_patch.paths image = ag.ndarray_via_fits_from(file_path=path.join(plot_path, "fit.fits"), hdu=1) @@ -79,4 +79,4 @@ def test__fit_imaging_combined( visualizer.fit_imaging_combined(fit_list=2 * [fit_imaging_x2_galaxy_inversion_7x7]) - assert path.join(plot_path, "subplot_fit_combined.png") in plot_patch.paths + assert path.join(plot_path, "fit_combined.png") in plot_patch.paths diff --git a/test_autogalaxy/imaging/plot/test_fit_imaging_plotters.py b/test_autogalaxy/imaging/plot/test_fit_imaging_plotters.py index ce07d8f0..e45a626f 100644 --- a/test_autogalaxy/imaging/plot/test_fit_imaging_plotters.py +++ b/test_autogalaxy/imaging/plot/test_fit_imaging_plotters.py @@ -27,8 +27,8 @@ def test__subplot_of_galaxy(fit_imaging_x2_galaxy_7x7, plot_path, plot_patch): output_path=plot_path, output_format="png", ) - assert path.join(plot_path, "subplot_of_galaxy_0.png") in plot_patch.paths - assert path.join(plot_path, "subplot_of_galaxy_1.png") in plot_patch.paths + assert path.join(plot_path, "of_galaxy_0.png") in plot_patch.paths + assert path.join(plot_path, "of_galaxy_1.png") in plot_patch.paths plot_patch.paths = [] @@ -39,5 +39,5 @@ def test__subplot_of_galaxy(fit_imaging_x2_galaxy_7x7, plot_path, plot_patch): output_format="png", ) - assert path.join(plot_path, "subplot_of_galaxy_0.png") in plot_patch.paths - assert path.join(plot_path, "subplot_of_galaxy_1.png") not in plot_patch.paths + assert path.join(plot_path, "of_galaxy_0.png") in plot_patch.paths + assert path.join(plot_path, "of_galaxy_1.png") not in plot_patch.paths diff --git a/test_autogalaxy/interferometer/model/test_plotter_interferometer.py b/test_autogalaxy/interferometer/model/test_plotter_interferometer.py index 04ed039b..303bd839 100644 --- a/test_autogalaxy/interferometer/model/test_plotter_interferometer.py +++ b/test_autogalaxy/interferometer/model/test_plotter_interferometer.py @@ -20,7 +20,7 @@ def test__interferometer(interferometer_7, plot_path, plot_patch): plotter.interferometer(dataset=interferometer_7) - assert path.join(plot_path, "subplot_dataset.png") in plot_patch.paths + assert path.join(plot_path, "dataset.png") in plot_patch.paths image = ag.ndarray_via_fits_from( file_path=path.join(plot_path, "dataset.fits"), hdu=1 @@ -41,7 +41,7 @@ def test__fit_interferometer( fit=fit_interferometer_x2_galaxy_inversion_7x7, ) - assert path.join(plot_path, "subplot_fit.png") in plot_patch.paths + assert path.join(plot_path, "fit.png") in plot_patch.paths image = ag.ndarray_via_fits_from( file_path=path.join(plot_path, "galaxy_images.fits"), hdu=1 diff --git a/test_autogalaxy/interferometer/plot/test_fit_interferometer_plotters.py b/test_autogalaxy/interferometer/plot/test_fit_interferometer_plotters.py index 09b3e0ef..6fa23d6d 100644 --- a/test_autogalaxy/interferometer/plot/test_fit_interferometer_plotters.py +++ b/test_autogalaxy/interferometer/plot/test_fit_interferometer_plotters.py @@ -23,7 +23,7 @@ def test__fit_sub_plot_real_space( output_format="png", ) - assert path.join(plot_path, "subplot_fit_real_space.png") in plot_patch.paths + assert path.join(plot_path, "fit_real_space.png") in plot_patch.paths plot_patch.paths = [] @@ -33,4 +33,4 @@ def test__fit_sub_plot_real_space( output_format="png", ) - assert path.join(plot_path, "subplot_fit_real_space.png") in plot_patch.paths + assert path.join(plot_path, "fit_real_space.png") in plot_patch.paths diff --git a/test_autogalaxy/profiles/plot/test_basis_plotters.py b/test_autogalaxy/profiles/plot/test_basis_plotters.py index b8b4beee..a4f9bd81 100644 --- a/test_autogalaxy/profiles/plot/test_basis_plotters.py +++ b/test_autogalaxy/profiles/plot/test_basis_plotters.py @@ -30,4 +30,4 @@ def test__subplot_image( output_format="png", ) - assert path.join(plot_path, "subplot_basis_image.png") in plot_patch.paths + assert path.join(plot_path, "basis_image.png") in plot_patch.paths diff --git a/test_autogalaxy/quantity/model/test_plotter_quantity.py b/test_autogalaxy/quantity/model/test_plotter_quantity.py index 39a9d17f..6e9fae27 100644 --- a/test_autogalaxy/quantity/model/test_plotter_quantity.py +++ b/test_autogalaxy/quantity/model/test_plotter_quantity.py @@ -46,4 +46,4 @@ def test__fit_quantity( plotter.fit_quantity(fit=fit_quantity_7x7_array_2d) - assert path.join(plot_path, "subplot_fit.png") not in plot_patch.paths + assert path.join(plot_path, "fit.png") not in plot_patch.paths diff --git a/test_autogalaxy/quantity/plot/test_fit_quantity_plotters.py b/test_autogalaxy/quantity/plot/test_fit_quantity_plotters.py index bd56aa32..94d3fc75 100644 --- a/test_autogalaxy/quantity/plot/test_fit_quantity_plotters.py +++ b/test_autogalaxy/quantity/plot/test_fit_quantity_plotters.py @@ -28,4 +28,4 @@ def test__fit_sub_plot__all_types_of_fit( output_path=plot_path, output_format="png", ) - assert path.join(plot_path, "subplot_fit.png") in plot_patch.paths + assert path.join(plot_path, "fit.png") in plot_patch.paths