autocti.plot.FitImagingCIPlotter#

class autocti.plot.FitImagingCIPlotter(fit: ~autocti.charge_injection.fit.FitImagingCI, mat_plot_2d: ~autoarray.plot.mat_plot.two_d.MatPlot2D = <autoarray.plot.mat_plot.two_d.MatPlot2D object>, visuals_2d: ~autoarray.plot.visuals.two_d.Visuals2D = <autoarray.plot.visuals.two_d.Visuals2D object>, include_2d: ~autoarray.plot.include.two_d.Include2D = <autoarray.plot.include.two_d.Include2D object>, mat_plot_1d: ~autoarray.plot.mat_plot.one_d.MatPlot1D = <autoarray.plot.mat_plot.one_d.MatPlot1D object>, visuals_1d: ~autoarray.plot.visuals.one_d.Visuals1D = <autoarray.plot.visuals.one_d.Visuals1D object>, include_1d: ~autoarray.plot.include.one_d.Include1D = <autoarray.plot.include.one_d.Include1D object>, residuals_symmetric_cmap: bool = True)[source]#

Bases: Plotter

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

The mat_plot_1d and 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 MatPlot1D and MatPlot2D to customize the figure’s appearance.

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

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

  • get_visuals_2d – A function which extracts from the FitImaging the 2D visuals which are plotted on figures.

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

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

  • include_2d – Specifies which attributes of the Array2D are extracted and plotted as visuals.

  • mat_plot_1d – Contains objects which wrap the matplotlib function calls that make 1D plots.

  • visuals_1d – Contains 1D visuals that can be overlaid on 1D plots.

  • include_1d – Specifies which attributes of the ImagingCI are extracted and plotted as visuals for 1D plots.

  • residuals_symmetric_cmap – 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_1d

Plots the individual attributes of the plotter's FitImagingCI object in 1D.

figures_1d_data_binned

Plots the charge injection data and fit binned over the parallel and serial directions, with and without the FPR regions included.

figures_2d

Plots the individual attributes of the plotter's FitImagingCI object in 2D.

fpr_mask_from

Returns a mask for the FPR of the dataset, where the prescan and overscan regions are also masked.

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

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

should_plot_zero_from

subplot

Plots the individual attributes of the plotter's FitImagingCI object in 2D on a subplot.

subplot_1d

Plots the individual attributes of the plotter's FitImagingCI object in 1D on a subplot.

subplot_fit

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

subplot_noise_scaling_map_dict

Plots the noise-scaling maps of the plotter's FitImagingCI object in 2D on a subplot.

subplot_of_plotters_figure

text_manual_dict_from

text_manual_dict_y_from

title_str_2d_from

title_str_from

Attributes

extract_region_from

extract_region_noise_map_from

get_1d

get_2d

is_for_subplot

figures_2d(data: bool = False, noise_map: bool = False, signal_to_noise_map: bool = False, pre_cti_data: bool = False, post_cti_data: bool = False, residual_map: bool = False, normalized_residual_map: bool = False, chi_squared_map: bool = False)[source]#

Plots the individual attributes of the plotter’s FitImagingCI object in 2D.

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

Parameters:
  • data – Whether to make a 2D plot (via imshow) of the image data.

  • noise_map – Whether to make a 2D plot (via imshow) of the noise map.

  • signal_to_noise_map – Whether to make a 2D plot (via imshow) of the signal-to-noise map.

  • pre_cti_data – Whether to make a 2D plot (via imshow) of the pre-cti data.

  • post_cti_data – Whether to make a 2D plot (via imshow) of the post-cti data.

  • residual_map – Whether to make a 2D plot (via imshow) of the residual map.

  • normalized_residual_map – Whether to make a 2D plot (via imshow) of the normalized residual map.

  • chi_squared_map – Whether to make a 2D plot (via imshow) of the chi-squared map.

figures_1d(region, data: bool = False, data_logy: bool = False, noise_map: bool = False, signal_to_noise_map: bool = False, pre_cti_data: bool = False, post_cti_data: bool = False, residual_map: bool = False, residual_map_logy: bool = False, normalized_residual_map: bool = False, chi_squared_map: bool = False)[source]#

Plots the individual attributes of the plotter’s FitImagingCI object in 1D.

These 1D plots correspond to a region in 2D on the charge injection image, which is binned up over the parallel or serial direction to produce a 1D plot. For example, for the input region=parallel_fpr, this function extracts the FPR over each charge injection region and bins such that the 1D plot shows the FPR in the parallel direction.

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

Parameters:
  • region – The region on the charge injection image where data is extracted and binned over the parallel or serial direction {“parallel_fpr”, “parallel_eper”, “serial_fpr”, “serial_eper”}.

  • data – Whether to make a 1D plot (via plot) of the image data extracted and binned over the region, with the noise-map values included as error bars and the model-fit overlaid.

  • data_logy – Whether to make a 1D plot (via plot) of the image data extracted and binned over the region, with the noise-map values included as error bars and the y-axis on a log10 scale and the model-fit overlaid.

  • data – Whether to make a 1D plot (via plot) of the image data extracted and binned over the region.

  • noise_map – Whether to make a 1D plot (via plot) of the noise-map extracted and binned over the region.

  • signal_to_noise_map – Whether to make a 1D plot (via plot) of the signal-to-noise map data extracted and binned over the region.

  • pre_cti_data – Whether to make a 1D plot (via plot) of the pre-cti data extracted and binned over the region.

  • post_cti_data – Whether to make a 1D plot (via plot) of the post-cti data extracted and binned over the region.

  • residual_map – Whether to make a 1D plot (via plot) of the residual map extracted and binned over the region, with the noise-map values included as error bars and the model-fit overlaid.

  • residual_map_logy – Whether to make a 1D plot (via plot) of the residual map extracted and binned over the region, with the noise-map values included as error bars and the y-axis on a log10 scale and the model-fit overlaid.

  • normalized_residual_map – Whether to make a 1D plot (via plot) of the normalized residual map extracted and binned over the region.

  • chi_squared_map – Whether to make a 1D plot (via plot) of the chi-squared map extracted and binned over the region.

figures_1d_data_binned(rows_fpr: bool = False, rows_no_fpr: bool = False, columns_fpr: bool = False, columns_no_fpr: bool = False)[source]#

Plots the charge injection data and fit binned over the parallel and serial directions, with and without the FPR regions included.

Plots binned over rows show the FPR of each injection, so that the FPR can be compared between injections. When the FPR is masked it allows comparison of the parallel EPER of each injection.

Plots binned over columns shown the charge injection non-uniformity.

Inaccurate bias subtraction / stray light subtraction and other systematics can produce a gradient over a full image, which these plots often show.

Parameters:

columns_fpr – Whether to plot the data binned over columns with the FPR regions included.

subplot(data: bool = False, noise_map: bool = False, signal_to_noise_map: bool = False, pre_cti_data: bool = False, post_cti_data: bool = False, residual_map: bool = False, normalized_residual_map: bool = False, chi_squared_map: bool = False, auto_filename: str = 'subplot_fit')[source]#

Plots the individual attributes of the plotter’s FitImagingCI object in 2D on a subplot.

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

Parameters:
  • data – Whether to include a 2D plot (via imshow) of the image data.

  • noise_map – Whether to include a 2D plot (via imshow) noise map.

  • signal_to_noise_map – Whether to include a 2D plot (via imshow) signal-to-noise map.

  • pre_cti_data – Whether to include a 2D plot (via imshow) of the pre-cti data.

  • post_cti_data – Whether to include a 2D plot (via imshow) of the post-cti data.

  • residual_map – Whether to include a 2D plot (via imshow) residual map.

  • normalized_residual_map – Whether to include a 2D plot (via imshow) normalized residual map.

  • chi_squared_map – Whether to include a 2D plot (via imshow) chi-squared map.

  • auto_filename – The default filename of the output subplot if written to hard-disk.

subplot_fit()[source]#

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

subplot_1d(region: str)[source]#

Plots the individual attributes of the plotter’s FitImagingCI object in 1D on a subplot.

These 1D plots correspond to a region in 2D on the charge injection image, which is binned up over the parallel or serial direction to produce a 1D plot. For example, for the input region=parallel_fpr, this function extracts the FPR over each charge injection region and bins such that the 1D plot shows the FPR in the parallel direction.

The function plots the image, noise map, pre-cti data and signal to noise map in 1D on the subplot.

Parameters:

region – The region on the charge injection image where data is extracted and binned over the parallel or serial direction {“parallel_fpr”, “parallel_eper”, “serial_fpr”, “serial_eper”}

subplot_noise_scaling_map_dict()[source]#

Plots the noise-scaling maps of the plotter’s FitImagingCI object in 2D on a subplot.