tailcuts_clean#

ctapipe.image.cleaning.tailcuts_clean(geom, image, picture_thresh=7, boundary_thresh=5, keep_isolated_pixels=False, min_number_picture_neighbors=0)[source]#

Clean an image by selection pixels that pass a two-threshold tail-cuts procedure. The picture and boundary thresholds are defined with respect to the pedestal dispersion. All pixels that have a signal higher than the picture threshold will be retained, along with all those above the boundary threshold that are neighbors of a picture pixel.

To include extra neighbor rows of pixels beyond what are accepted, use the ctapipe.image.dilate function.

Parameters:
geomctapipe.instrument.CameraGeometry

Camera geometry information

imagenp.ndarray

pixel charges

picture_threshfloat | np.ndarray

threshold above which all pixels are retained

boundary_threshfloat | np.ndarray

threshold above which pixels are retained if they have a neighbor already above the picture_thresh

keep_isolated_pixelsbool

If True, pixels above the picture threshold will be included always, if not they are only included if a neighbor is in the picture or boundary

min_number_picture_neighborsint

A picture pixel survives cleaning only if it has at least this number of picture neighbors. This has no effect in case keep_isolated_pixels is True

Returns:
A boolean mask of clean pixels.