autogalaxy.plot.FitImagingPlotter#

class FitImagingPlotter[source]#

Bases: Plotter

Plots the attributes of FitImaging objects using the matplotlib method imshow() and many other matplotlib functions which customize the plot’s appearance.

The mat_plot_2d attribute wraps matplotlib function calls to make the figure. By default, the settings passed to every matplotlib function called are those specified in the config/visualize/mat_wrap/*.ini files, but a user can manually input values into MatPlot2d to customize the figure’s appearance.

Overlaid on the figure are visuals, contained in the Visuals2D object. Attributes may be extracted from the FitImaging and plotted via the visuals object, if the corresponding entry is True in the Include2D object or the config/visualize/include.ini file.

Parameters:
  • fit (FitImaging) – The fit to an imaging dataset the plotter plots.

  • mat_plot_2d (MatPlot2D) – Contains objects which wrap the matplotlib function calls that make the plot.

  • visuals_2d (Visuals2D) – Contains visuals that can be overlaid on the plot.

  • include_2d (Include2D) – Specifies which attributes of the FitImaging are extracted and plotted as visuals.

  • residuals_symmetric_cmap (bool) – If true, the residual_map and normalized_residual_map are plotted with a symmetric color map such that abs(vmin) = abs(vmax).

Methods

close_subplot_figure

figures_2d_of_galaxies

Plots images representing each individual Galaxy in the plotter's list of galaxies in 2D, which are computed via the plotter's 2D grid object.

get_subplot_figsize

Get the size of a sub plotter in (total_y_pixels, total_x_pixels), based on the number of subplots that are going to be plotted.

get_visuals_2d

rtype:

Visuals2D

open_subplot_figure

Setup a figure for plotting an image.

set_filename

set_format

set_mat_plot_1d_for_multi_plot

set_mat_plots_for_subplot

set_title

subplot_fit

Standard subplot of the attributes of the plotter's FitImaging object.

subplot_of_galaxies

Plots images representing each individual Galaxy in the plotter's list of galaxies in 2D on a subplot, which are computed via the plotter's 2D grid object.

subplot_of_plotters_figure

Attributes

galaxies

rtype:

List[Galaxy]

galaxy_indices

Returns a list of all indexes of the galaxies in the fit, which is iterated over in figures that plot individual figures of each galaxy.

get_1d

get_2d

inversion_plotter

Returns an InversionPlotter corresponding to the Inversion of the fit.

is_for_subplot

property inversion_plotter: InversionPlotter#

Returns an InversionPlotter corresponding to the Inversion of the fit.

Returns:

An object that plots inversions which is used for plotting attributes of the inversion.

Return type:

InversionPlotter

property galaxy_indices: List[int]#

Returns a list of all indexes of the galaxies in the fit, which is iterated over in figures that plot individual figures of each galaxy.

Parameters:

galaxy_index – A specific galaxy index such that only a single galaxy index is returned.

Returns:

A list of galaxy indexes corresponding to the galaxies.

Return type:

list

figures_2d_of_galaxies(galaxy_index=None, subtracted_image=False, model_image=False)[source]#

Plots images representing each individual Galaxy in the plotter’s list of galaxies in 2D, which are computed via the plotter’s 2D grid object.

These images subtract or omit the contribution of other galaxies, such that plots showing each individual galaxy are made.

The API is such that every plottable attribute of the Galaxy object is an input parameter of type bool of the function, which if switched to True means that it is plotted.

Parameters:
  • subtracted_image (bool) – Whether to make a 2D plot (via imshow) of the subtracted image of a galaxy, where this image is the fit’s data minus the model images of all other galaxies, thereby showing an individual galaxy in the data.

  • model_image (bool) – Whether to make a 2D plot (via imshow) of the model image of a galaxy, where this image is the model image of one galaxy, thereby showing how much it contributes to the overall model image.

  • galaxy_index (Optional[int]) – If input, plots for only a single galaxy based on its index are created.

subplot_fit()[source]#

Standard subplot of the attributes of the plotter’s FitImaging object.

subplot_of_galaxies(galaxy_index=None)[source]#

Plots images representing each individual Galaxy in the plotter’s list of galaxies in 2D on a subplot, which are computed via the plotter’s 2D grid object.

These images subtract or omit the contribution of other galaxies, such that plots showing each individual galaxy are made.

The subplot plots the subtracted image and model image of each galaxy, where are described in the figures_2d_of_galaxies function.

Parameters:

galaxy_index (Optional[int]) – If input, plots for only a single galaxy based on its index are created.