MAGICClean#
- class magicctapipe.image.MAGICClean(camera, configuration)[source]#
Bases:
objectImplement the cleaning used by MAGIC.
- Parameters:
- camera
ctapipe.instrument.CameraGeometry Camera geometry.
- configuration
dict Dictionary for the configuration.
- camera
Methods Summary
GetListOfNN([NN_size, bad_pixels])Get the list of next neighbor pixels.
clean_image(event_image, event_pulse_time[, ...])Clean the input image.
group_calculation(mask, NN, clipNN, ...)Calculate pixel groups.
Perform the 1st step of the cleaning.
Perform the 1st step of the Sum cleaning.
magic_clean_step2(mask)Perform the 2nd step of the cleaning.
magic_clean_step2b(mask)Perform the 2nd step of the cleaning (b version).
magic_clean_step3(mask)Perform the 3rd step of the cleaning.
magic_clean_step3b(mask)Perform the 3rd step of the cleaning (b version).
single_island(neighbors, mask)Find single islands in the image.
Methods Documentation
- GetListOfNN(NN_size=2, bad_pixels=None)[source]#
Get the list of next neighbor pixels.
- Parameters:
- NN_size
int, optional Order of next neighbors to find, by default 2.
- bad_pixels
np.ndarray, optional Array of bad pixels, by default None.
- NN_size
- Returns:
np.ndarrayArray of neighbor pixels.
- clean_image(event_image, event_pulse_time, unsuitable_mask=None)[source]#
Clean the input image.
- Parameters:
- event_image
np.ndarray Input array with event image (charge per each pixel).
- event_pulse_time
np.ndarray Input array with event times (time per each pixel).
- unsuitable_mask
np.ndarray, optional Array of unsuitable pixels, by default None.
- event_image
- Returns:
- clean_mask
np.ndarray Mask with pixels surviving the cleaning.
- self.event_image
np.ndarray Image (charges) with only surviving pixels.
- self.event_pulse_time
np.ndarray Image (times) with only surviving pixels.
- clean_mask
- Raises:
ValueErrorRaised if no unsuitable mask is provided but find_hotpixles is True.
- group_calculation(mask, NN, clipNN, windowNN, thresholdNN)[source]#
Calculate pixel groups.
- Parameters:
- mask
np.ndarray Mask aray.
- NN
np.ndarray Neighbor pixels array.
- clipNN
float Charge clipping value.
- windowNN
float Time window cut.
- thresholdNN
float Group charge threshold.
- mask
- Returns:
np.ndarrayUpdated mask array.
- magic_clean_step1()[source]#
Perform the 1st step of the cleaning.
- Returns:
np.ndarrayMask array with excluded pixels.
- magic_clean_step1Sum()[source]#
Perform the 1st step of the Sum cleaning.
- Returns:
np.ndarrayMask array with excluded pixels.
- magic_clean_step2(mask)[source]#
Perform the 2nd step of the cleaning.
- Parameters:
- mask
np.ndarray Input mask.
- mask
- Returns:
np.ndarrayMask array with excluded pixels.
- magic_clean_step2b(mask)[source]#
Perform the 2nd step of the cleaning (b version).
- Parameters:
- mask
np.ndarray Input mask.
- mask
- Returns:
np.ndarrayMask array with excluded pixels.
- magic_clean_step3(mask)[source]#
Perform the 3rd step of the cleaning.
- Parameters:
- mask
np.ndarray Input mask.
- mask
- Returns:
np.ndarrayMask array with excluded pixels.
- magic_clean_step3b(mask)[source]#
Perform the 3rd step of the cleaning (b version).
- Parameters:
- mask
np.ndarray Input mask.
- mask
- Returns:
np.ndarrayMask array with excluded pixels.
- single_island(neighbors, mask)[source]#
Find single islands in the image.
- Parameters:
- neighbors
np.ndarray Array with neighbor pixels.
- mask
np.ndarray Input mask array.
- neighbors
- Returns:
np.ndarrayMask of pixels with single islands.