nsb_image_cleaning#

ctapipe.image.cleaning.nsb_image_cleaning(geom, image, arrival_times, picture_thresh_min=8, boundary_thresh=4, min_number_picture_neighbors=2, keep_isolated_pixels=False, time_limit=None, time_num_neighbors=1, bright_cleaning_n_pixels=3, bright_cleaning_fraction=0.03, bright_cleaning_threshold=None, largest_island_only=False, pedestal_factor=2.5, pedestal_std=None)[source]#

Clean an image in 5 Steps:

  1. Get pixelwise picture thresholds for tailcuts_clean in step 2) from interleaved pedestal events if pedestal_std is not None.

  2. Apply tailcuts_clean algorithm.

  3. Apply apply_time_delta_cleaning algorithm if time_limit is not None.

  4. Apply bright_cleaning if bright_cleaning_threshold is not None.

  5. Get only ctapipe.image.largest_island if largest_island_only is set to true.

Parameters:
geomctapipe.instrument.CameraGeometry

Camera geometry information

imagenp.ndarray

Pixel charges

arrival_timesnp.ndarray

Pixel timing information

picture_thresh_minfloat | np.ndarray

Defines the minimum value used for the picture threshold for tailcuts_clean. The threshold used will be at least this value, or higher if pedestal_std and pedestal_factor are set.

boundary_threshfloat | np.ndarray

Threshold above which pixels are retained if they have a neighbor already above the picture_thresh_min. Used for tailcuts_clean.

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. Used for tailcuts_clean.

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. Used for tailcuts_clean.

time_limitfloat

Time limit for the apply_time_delta_cleaning. Set to None if no apply_time_delta_cleaning should be applied.

time_num_neighborsint

Used for apply_time_delta_cleaning. A selected pixel needs at least this number of (already selected) neighbors that arrived within a given time_limit to itself to survive this cleaning.

bright_cleaning_n_pixelsint

Consider this number of the brightest pixels for calculating the mean charge. Pixels below fraction * (mean charge in the bright_cleaning_n_pixels brightest pixels) will be removed from the cleaned image. Set bright_cleaning_threshold to None if no bright_cleaning should be applied.

bright_cleaning_fractionfloat

Fraction parameter for bright_cleaning. Pixels below fraction * (mean charge in the bright_cleaning_n_pixels brightest pixels) will be removed from the cleaned image. Set bright_cleaning_threshold to None if no bright_cleaning should be applied.

bright_cleaning_thresholdfloat

Threshold parameter for bright_cleaning. Minimum mean charge in the bright_cleaning_n_pixels brightest pixels to apply the cleaning. Set to None if no bright_cleaning should be applied.

largest_island_onlybool

Set to true to get only largest island.

pedestal_factorfloat

Factor for interleaved pedestal cleaning. It is multiplied by the pedestal standard deviation for each pixel to calculate pixelwise picture threshold parameters for tailcuts_clean considering the current background. Has no effect if pedestal_std is set to None.

pedestal_stdnp.ndarray | None

Pedestal standard deviation for each pixel. See ctapipe.containers.PedestalContainer. Used to calculate pixelwise picture threshold parameters for tailcuts_clean by multiplying it with pedestal_factor and clip (limit) the product with picture_thresh_min. If set to None, only picture_thresh_min is used to set the picture threshold for tailcuts_clean.

Returns:
A boolean mask of selected pixels.