nsb_image_cleaning#
- ctapipe.image.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:
Get pixelwise picture thresholds for
tailcuts_cleanin step 2) from interleaved pedestal events ifpedestal_stdis not None.Apply
tailcuts_cleanalgorithm.Apply
apply_time_delta_cleaningalgorithm iftime_limitis not None.Apply
bright_cleaningifbright_cleaning_thresholdis not None.Get only
ctapipe.image.largest_islandiflargest_island_onlyis set to true.
- Parameters:
 - geom
ctapipe.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 ifpedestal_stdandpedestal_factorare set.- boundary_threshfloat | np.ndarray
 Threshold above which pixels are retained if they have a neighbor already above the
picture_thresh_min. Used fortailcuts_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_pixelsis True. Used fortailcuts_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 noapply_time_delta_cleaningshould 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 giventime_limitto 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_pixelsbrightest pixels) will be removed from the cleaned image. Setbright_cleaning_thresholdto None if nobright_cleaningshould be applied.- bright_cleaning_fractionfloat
 Fraction parameter for
bright_cleaning. Pixels below fraction * (mean charge in thebright_cleaning_n_pixelsbrightest pixels) will be removed from the cleaned image. Setbright_cleaning_thresholdto None if nobright_cleaningshould be applied.- bright_cleaning_thresholdfloat
 Threshold parameter for
bright_cleaning. Minimum mean charge in thebright_cleaning_n_pixelsbrightest pixels to apply the cleaning. Set to None if nobright_cleaningshould 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_cleanconsidering the current background. Has no effect ifpedestal_stdis set to None.- pedestal_stdnp.ndarray | None
 Pedestal standard deviation for each pixel. Used to calculate pixelwise picture threshold parameters for
tailcuts_cleanby multiplying it withpedestal_factorand clip (limit) the product withpicture_thresh_min. If set to None, onlypicture_thresh_minis used to set the picture threshold fortailcuts_clean.
- geom
 - Returns:
 - A boolean mask of selected pixels.