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:
Get pixelwise picture thresholds for
tailcuts_clean
in step 2) from interleaved pedestal events ifpedestal_std
is not None.Apply
tailcuts_clean
algorithm.Apply
apply_time_delta_cleaning
algorithm iftime_limit
is not None.Apply
bright_cleaning
ifbright_cleaning_threshold
is not None.Get only
ctapipe.image.largest_island
iflargest_island_only
is 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_std
andpedestal_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 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_pixels
is 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_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 giventime_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. Setbright_cleaning_threshold
to None if nobright_cleaning
should be applied.- bright_cleaning_fractionfloat
Fraction parameter for
bright_cleaning
. Pixels below fraction * (mean charge in thebright_cleaning_n_pixels
brightest pixels) will be removed from the cleaned image. Setbright_cleaning_threshold
to None if nobright_cleaning
should be applied.- bright_cleaning_thresholdfloat
Threshold parameter for
bright_cleaning
. Minimum mean charge in thebright_cleaning_n_pixels
brightest pixels to apply the cleaning. Set to None if nobright_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 ifpedestal_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 fortailcuts_clean
by multiplying it withpedestal_factor
and clip (limit) the product withpicture_thresh_min
. If set to None, onlypicture_thresh_min
is used to set the picture threshold fortailcuts_clean
.
- geom
- Returns:
- A boolean mask of selected pixels.