PixelPlotter#

class stixpy.visualisation.plotters.PixelPlotter(prod, time_indices=None, energy_indices=None)[source]#

Bases: object

Plot individual pixel data for each detector.

Support three kinds of plots:
  • ‘pixel’ which show counts as rectangular patches in the correct pixel locations using a color map

  • ‘errorbar’ which shows the counts and error as error bar plots one per detector

  • ‘config’ which display per sub-collimator configuration

Parameters:
  • prod (Product) – Pixel data product to plot

  • kind (string optional) – This sets the visualization type of the subplots the supported options are: ‘pixel’, ‘errorbar’, ‘config’.

  • time_indices (list or numpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For example time_indices=[0, 2, 5] would return only the first, third and sixth times while time_indices=[[0, 2],[3, 5]] would sum the data between.

  • energy_indices (list or numpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For example energy_indices=[0, 2, 5] would return only the first, third and sixth times while energy_indices=[[0, 2],[3, 5]] would sum the data between.

  • fig (optional matplotlib.figure) – The figure where to which the pixel plot will be added.

  • cmap (string | colormap optional) –

    If the kind is pixels a colormap will be shown.

    NOTE: If the color of the special detectors ‘cfl’, ‘bkg’ is way above the imaging detectors, the color will be automatically set to white.

Returns:

tuple[matplotlib.figure.Figure,matplotlib.axes.Axes]

Methods Summary

plot([kind, fig, cmap])

Generates and returns the main plot figure and axes

Methods Documentation

plot(kind='pixel', fig=None, cmap=None)[source]#

Generates and returns the main plot figure and axes

Parameters:
  • kind (str) – The visualization type: ‘pixels’, ‘errorbar’, or ‘config’.

  • fig (matplotlib.figure.Figure, optional) – An existing figure to draw on.

  • cmap (str or colormap, optional) – The colormap for the ‘pixels’ plot.