Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Issue #15 it has been reported that the new ctapipe-based cleaning for the biggest cluster (or island) was crashing in case of no islands surviving the cleaning algorithm.
This has been now fixed by checking beforehand the number of surviving islands and calling the function
largest island
only in case of more than 1 island left in the image.In the case of only 1 island left, the cleaning mask is the original one.
In the case of no islands, the original (empty) cleaned image is used.
A similar check is applied in the case of extended cleaning, which would take into account all the surviving islands but which for the moment is set to be the same as the biggest cleaning.
The new code has been tested successfully on 500 events from file
gamma_20deg_180deg_run100___cta-prod3-demo-2147m-LaPalma-baseline.simtel.gz
using both DL1 and DL2 scripts (the latter without model estimation, so the result is the same as for DL1):After this PR the new bugfix version 0.2.1 will be released.