cta-observatory/protopipe

Remove dangerous fall-back to MARS cuts if there is a typo in the config file

Opened this issue · 2 comments

This is a dangerous try/catch here: if anyone mistypes a keyword in the configuration file, all parameters fall back to the MARS defaults silently! There isn't even a warning raised.

except KeyError:
# defaults for a CTAMARS-like analysis
self.image_selection_source = "extended"
charge_bounds = [50.0, 1.0e10]
npix_bounds = [3, 1e10]
ellipticity_bounds = [0.1, 0.6]
nominal_distance_bounds = [0.0, 0.8]

The expected behavior should be that the analysis simply fails, so the try/catch should be removed.

In fact this seems to be true for all configuration keys.

OK for me: the script could exit with a logging.exception