PixelPlotter#
- class stixpy.visualisation.plotters.PixelPlotter(prod, time_indices=None, energy_indices=None)[source]#
Bases:
objectPlot 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 plotkind (
stringoptional) – This sets the visualization type of the subplots the supported options are: ‘pixel’, ‘errorbar’, ‘config’.time_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampletime_indices=[0, 2, 5]would return only the first, third and sixth times whiletime_indices=[[0, 2],[3, 5]]would sum the data between.energy_indices (
listornumpy.ndarray) – If an 1xN array will be treated as mask if 2XN array will sum data between given indices. For exampleenergy_indices=[0, 2, 5]would return only the first, third and sixth times whileenergy_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|colormapoptional) –If the kind is
pixelsa 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.