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

improved data consistency output

parent 6acb7b96
......@@ -24,30 +24,51 @@ class Detection(Object):
ifm = Float.T()
def check_data_consistency(p, receivers):
def check_data_consistency(p, config):
receivers = config.get_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 = []
to_be_blacklisted = []
for r in receivers:
if r.codes[:3] not in nsl_ids:
r_not_in_p.append(r.codes)
if '.'.join(r.codes[:3]) in config.blacklist:
to_be_blacklisted.append('.'.join(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:')
logger.warn('Following receivers have no traces in data set:')
for nsl_id in r_not_in_p:
logger.warn(nsl_id)
logger.warn(' %s' % '.'.join(nsl_id))
logger.warn('-' * 40)
if len(t_not_in_r) != 0.:
logger.warn('following traces have no associated receivers:')
logger.warn('Following traces have no associated receivers:')
for nsl_id in t_not_in_r:
logger.warn(nsl_id)
logger.warn(' %s' % '.'.join(nsl_id))
logger.warn('-' * 40)
if len(to_be_blacklisted):
logger.info('Blacklisted receivers:')
for code in to_be_blacklisted:
logger.info(' %s' % code)
logger.info('-' * 40)
if len(config.blacklist) and\
len(to_be_blacklisted) != len(config.blacklist):
logger.warn('Blacklist NSL codes that did not match any receiver:')
for code in config.blacklist:
if code not in to_be_blacklisted:
logger.warn(' %s' % code)
logger.info('-' * 40)
def zero_fill(trs, tmin, tmax):
......
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