-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eewamp bug (work done with @luca-s): the horizontal channel clip mask…
… is not long enough for checking all samples, happens only with combining horizontal channels from faulty sensor continuously close to clipping level.
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,13 @@ void EnvelopeProcessor::process(const Record *rec, const DoubleArray &data) { | |
Core::Time ts = rec->startTime(); | ||
const BitSet *clipMask = rec->clipMask(); | ||
|
||
if ( clipMask != NULL && ((unsigned int)data.size()) != clipMask->size() ) { | ||
SEISCOMP_WARNING("%s: data.size() != clipMask->size() (%d != %zu)", | ||
rec->streamID().c_str(), | ||
data.size(), | ||
clipMask->size()); | ||
} | ||
|
||
// Process all samples | ||
if ( clipMask == NULL ) { | ||
for ( int i = 0; i < data.size(); ++i ) { | ||
|
@@ -135,9 +142,14 @@ void EnvelopeProcessor::process(const Record *rec, const DoubleArray &data) { | |
} | ||
|
||
_samplePool.push(data[i]); | ||
if ( clipMask->test(i) ) | ||
if ( ((unsigned int)i) < clipMask->size() && clipMask->test(i) ) | ||
_samplePool.clipped = true; | ||
|
||
if ( ((unsigned int)i) >= clipMask->size() ){ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gempa-jabe
Contributor
|
||
SEISCOMP_WARNING("%s: cannot check if data[%d] is clipped (clip mask too short) unreliable data.", | ||
rec->streamID().c_str(), | ||
i); | ||
} | ||
ts += _dt; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dear @gempa-jabe (cc @luca-s)
This sanity check responds to a bug(?) in eewamp: the horizontal channel clip mask is sometimes not long enough for checking all samples, it happens only with combining horizontal channels from faulty sensors continuously close to the clipping level.
Any help?