def __init__(self, masked_imaging, hyper_model_image, hyper_galaxy_image,
                 image_path):
        """
        An analysis to fit the noise for a single galaxy image.
        Parameters
        ----------
        masked_imaging: LensData
            lens dataset, including an image and noise
        hyper_model_image: ndarray
            An image produce of the overall system by a model
        hyper_galaxy_image: ndarray
            The contribution of one galaxy to the model image
        """

        self.masked_imaging = masked_imaging

        self.visualizer = visualizer.HyperGalaxyVisualizer(
            image_path=image_path)

        self.hyper_model_image = hyper_model_image
        self.hyper_galaxy_image = hyper_galaxy_image
Esempio n. 2
0
    def test__hyper_fit__images_for_phase__source_and_lens__depedent_on_input(
        self,
        masked_imaging_fit_x2_plane_7x7,
        hyper_galaxy_image_0_7x7,
        include_all,
        plot_path,
        plot_patch,
    ):

        visualizer = vis.HyperGalaxyVisualizer(image_path=plot_path)

        visualizer = visualizer.new_visualizer_with_preloaded_critical_curves_and_caustics(
            preloaded_critical_curves=include_all.preloaded_critical_curves,
            preloaded_caustics=include_all.preloaded_caustics,
        )

        visualizer.visualize_hyper_galaxy(
            fit=masked_imaging_fit_x2_plane_7x7,
            hyper_fit=masked_imaging_fit_x2_plane_7x7,
            galaxy_image=hyper_galaxy_image_0_7x7,
            contribution_map_in=hyper_galaxy_image_0_7x7,
        )

        assert plot_path + "subplots/subplot_fit_hyper_galaxy.png" in plot_patch.paths