swiss-seismological-service / scdetect

A computationally efficient earthquake detection module for SeisComP
https://scdetect.readthedocs.io
GNU Affero General Public License v3.0
15 stars 6 forks source link

Allow to configure how to behave if detector initialization partially fails #102

Closed damb closed 1 year ago

damb commented 2 years ago

Detector initialization may fail due to several reasons, e.g.:

At the time being, scdetect-cc implements the best-effort approach, i.e. the detector is initialized based on the information available. If information required is missing the corresponding stream is skipped, and the corresponding reason is logged. In order to skip initializing the detector entirely provide a module configuration parameter as an alternative approach.

Supersedes #101.

luca-s commented 1 year ago

I don't believe scdetect should start for all the aforementioned cases. At least the template data and metadata must be fully available to start the processing. Then scdetect can be flexible with regard to real-time data, but allowing it to work without a proper initialization feels dangerous because a user would look at the logs only when something wrong happens (e.g. scdetect doesn't start), but if scdetect starts then a user would never realize that the template data is missing.

mmesim commented 1 year ago

I agree @luca-s.

luca-s commented 1 year ago

It looks like @damb made a beautiful job as usual and the behaviour is totally configurable via code already.

Currently it is set to be very flexible and for the reason explained above I would make scdetect strict and fails if the templates cannot be properly loaded. It's just a matter of chaning few variables in the code, thanks a lot @damb!

I believe @damb wanted to make this configuration visible at user level, but unless someone shows a valid use case for this, I would keep the configuration hidden.

luca-s commented 1 year ago

Closed by this