Commit 8b56a371 authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

cross-check receivers and pile content

parent 59c4ebe6
......@@ -13,6 +13,33 @@ from lassie import common, plot, grid as gridmod
logger = logging.getLogger('lassie.core')
def check_data_consistency(p, receivers):
nslc_ids = p.nslc_ids.keys()
nsl_ids = [nslc_id[:3] for nslc_id in nslc_ids]
r_ids = [r.codes for r in receivers]
r_not_in_p = []
t_not_in_r = []
for r in receivers:
if r.codes[:3] not in nsl_ids:
r_not_in_p.append(r.codes)
for nsl_id in nsl_ids:
if nsl_id not in r_ids:
t_not_in_r.append(nsl_id)
if len(r_not_in_p) != 0.:
logger.warn('following receivers have no traces in data set:')
for nsl_id in r_not_in_p:
logger.warn(nsl_id)
if len(t_not_in_r) != 0.:
logger.warn('following traces have no associated receivers:')
for nsl_id in t_not_in_r:
logger.warn(nsl_id)
def scan(
config,
override_tmin=None,
......@@ -68,6 +95,8 @@ def scan(
if p.is_empty():
raise common.LassieError('no usable waveforms found')
check_data_consistency(p, receivers)
ngridpoints = grid.size()
idetection = 0
......
Markdown is supported
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