CameraDisplay#
- class ctapipe.visualization.bokeh.CameraDisplay(geometry: CameraGeometry | None = None, image=None, cmap='inferno', norm='lin', autoscale=True, title=None, use_notebook=None, **figure_kwargs)[source]#
Bases:
BokehPlot
CameraDisplay implementation in Bokeh
- Parameters:
- geometry: CameraGeometry
CameraGeometry for the display
- image: array
Values to display for each pixel
- cmap: str or bokeh.palette.Palette
matplotlib colormap name or bokeh palette for color mapping values
- norm: str or bokeh.
lin, log, symlog or a bokeh.models.ColorMapper instance
- autoscale: bool
Whether to automatically adjust color range after updating image
- use_notebook: bool or None
Whether to use bokehs notebook output. If None, tries to autodetect running in a notebook.
- **figure_kwargs are passed to bokeh.plots.figure
Attributes Summary
Methods Summary
add_ellipse
(centroid, length, width, angle)plot an ellipse on top of the camera
enable_pixel_picker
(callback)Call
callback
when a pixel is clickedhighlight_pixels
(pixels[, color, linewidth, ...])Highlight the given pixels with a colored line around them
overlay_moments
(hillas_parameters[, ...])helper to overlay ellipse from a
HillasParametersContainer
structureAttributes Documentation
- geometry#
Get the current geometry
- image#
Get the current image
Methods Documentation
- add_ellipse(centroid, length, width, angle, asymmetry=0.0, **kwargs)[source]#
plot an ellipse on top of the camera
- Parameters:
- centroid: (float, float)
position of centroid
- length: float
major axis
- width: float
minor axis
- angle: float
rotation angle wrt x-axis about the centroid, anticlockwise, in radians
- asymmetry: float
3rd-order moment for directionality if known
- kwargs:
any MatPlotLib style arguments to pass to the Ellipse patch
- highlight_pixels(pixels, color='green', linewidth=1, alpha=0.75)[source]#
Highlight the given pixels with a colored line around them
- Parameters:
- pixelsindex-like
The pixels to highlight. Can either be a list or array of integers or a boolean mask of length number of pixels
- color: a matplotlib conform color
the color for the pixel highlighting
- linewidth: float
linewidth of the highlighting in points
- alpha: 0 <= alpha <= 1
The transparency
- overlay_moments(hillas_parameters, with_label=True, keep_old=False, n_sigma=1, **kwargs)[source]#
helper to overlay ellipse from a
HillasParametersContainer
structure- Parameters:
- hillas_parameters: `HillasParametersContainer`
structuring containing Hillas-style parameterization
- with_label: bool
If True, show coordinates of centroid and width and length
- keep_old: bool
If True, to not remove old overlays
- kwargs: key=value
any style keywords to pass to matplotlib (e.g. color=’red’ or linewidth=6)