Commit 18b489e5 authored by Jan Becker's avatar Jan Becker
Browse files

[scautopick] Add configuration option whether to kill pending secondary processors or not

parent 52acea00
......@@ -56,6 +56,7 @@ Picker::Config::Config() {
initTime = 60.;
pickerType = "";
killPendingSecondaryProcessors = true;
sendDetections = false;
amplitudeList.insert("MLv");
......@@ -135,6 +136,9 @@ void Picker::Config::init(const Client::Application *app) {
try { secondaryPickerType = app->configGetString("spicker"); }
catch ( ... ) {}
try { killPendingSecondaryProcessors = app->configGetBool("killPendingSPickers"); }
catch ( ... ) {}
try { sendDetections = app->configGetBool("sendDetections"); }
catch ( ... ) {}
}
......@@ -189,9 +193,10 @@ void Picker::Config::dump() const {
printf("ringBufferSize %.0fs\n", ringBufferSize);
printf("leadTime %.0fs\n", leadTime);
printf("initTime %.0fs\n", initTime);
printf("pickerType %s\n", pickerType.c_str());
printf("secondaryPickerType %s\n", secondaryPickerType.c_str());
printf("sendDetections %s\n", sendDetections ? "true" : "false");
printf("pickerType %s\n", pickerType.c_str());
printf("secondaryPickerType %s\n", secondaryPickerType.c_str());
printf("killPendingSPickers %s\n", killPendingSecondaryProcessors ? "true" : "false");
printf("sendDetections %s\n", sendDetections ? "true" : "false");
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
......
......@@ -138,6 +138,10 @@ class Config {
// The secondary picker type to use
std::string secondaryPickerType;
// Whether kill previously started secondary pickers when a new
// primary pick has been declared
bool killPendingSecondaryProcessors;
// Send detections as well if a picker is configured?
bool sendDetections;
......
......@@ -72,6 +72,14 @@ spicker = ""
# the horizontal components.
useAllStreams = false
# If enabled the all secondary pickers that were triggered by a previous pick
# will be terminated when a new detection or pick has been found. This aims to
# avoid the case where an S phase is wrongly picked as P but would also be
# picked as S by the secondary picker. But suppressing the S pick can lead to
# undesired results. It might be better in some situations to have two picks
# (P and S) instead only a wrong P.
killPendingSPickers = true
# If enabled and a picker is configured then detections are sent as well.
# To distinguish between detections and picks the evaluation mode of the pick
# is set to manual. This is meant to be a debug option which can be used to
......
......@@ -64,6 +64,18 @@
will only receive the data it subscribed to.
</description>
</parameter>
<parameter name="killPendingSPickers" type="boolean" default="true">
<description>
If enabled the all secondary pickers that were triggered by
a previous pick will be terminated when a new detection or
pick has been found. This aims to avoid the case where an
S phase is wrongly picked as P but would also be picked as
S by the secondary picker. But suppressing the S pick can
lead to undesired results. It might be better in some
situations to have two picks (P and S) instead only a wrong
P.
</description>
</parameter>
<parameter name="sendDetections" type="boolean" default="false">
<description>
If enabled and a :confval:`picker` is configured then detections are sent as well.
......
......@@ -983,39 +983,41 @@ void App::addSecondaryPicker(const Core::Time &onset, const Record *rec, const s
}
ProcList &list = _runningStreamProcs[rec->streamID()];
SEISCOMP_DEBUG("check for expired procs (got %d in list)", (int)list.size());
if ( _config.killPendingSecondaryProcessors ) {
SEISCOMP_DEBUG("check for expired procs (got %d in list)", (int)list.size());
// Check for secondary procs that are still running but where the
// end time is before onset and remove them
// ...
for ( ProcList::iterator it = list.begin(); it != list.end(); ) {
if ( it->dataEndTime <= onset ) {
SEISCOMP_DEBUG("Remove expired proc 0x%lx", (long int)it->proc);
if ( /*it->proc != NULL*/true ) {
SEISCOMP_INFO("Remove expired running processor %s on %s",
it->proc->className(), rec->streamID().c_str());
if ( it->proc->status() == Processing::WaveformProcessor::LowSNR )
SEISCOMP_DEBUG(" -> status: SNR(%f) too low", it->proc->statusValue());
else if ( it->proc->status() > Processing::WaveformProcessor::Terminated )
SEISCOMP_DEBUG(" -> status: ERROR (%s, %f)",
it->proc->status().toString(), it->proc->statusValue());
else
SEISCOMP_DEBUG(" -> status: OK");
// Remove processor from application
removeProcessor(it->proc);
// Remove its reverse lookup
ProcReverseMap::iterator pit = _procLookup.find(it->proc);
if ( pit != _procLookup.end() ) _procLookup.erase(pit);
}
// Check for secondary procs that are still running but where the
// end time is before onset and remove them
// ...
for ( ProcList::iterator it = list.begin(); it != list.end(); ) {
if ( it->dataEndTime <= onset ) {
SEISCOMP_DEBUG("Remove expired proc 0x%lx", (long int)it->proc);
if ( /*it->proc != NULL*/true ) {
SEISCOMP_INFO("Remove expired running processor %s on %s",
it->proc->className(), rec->streamID().c_str());
if ( it->proc->status() == Processing::WaveformProcessor::LowSNR )
SEISCOMP_DEBUG(" -> status: SNR(%f) too low", it->proc->statusValue());
else if ( it->proc->status() > Processing::WaveformProcessor::Terminated )
SEISCOMP_DEBUG(" -> status: ERROR (%s, %f)",
it->proc->status().toString(), it->proc->statusValue());
else
SEISCOMP_DEBUG(" -> status: OK");
// Remove processor from application
removeProcessor(it->proc);
// Remove its reverse lookup
ProcReverseMap::iterator pit = _procLookup.find(it->proc);
if ( pit != _procLookup.end() ) _procLookup.erase(pit);
// Remove it from the run list
it = list.erase(it);
}
// Remove it from the run list
it = list.erase(it);
else
++it;
}
else
++it;
}
// addProcessor can feed the requested time window with cached records
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment