[bugfix] comparison should not through an KeyError due to missing picks

This commit is contained in:
Sebastian Wehling-Benatelli 2016-04-12 14:50:21 +02:00
parent 416f4c7aa7
commit c489fad6ba

View File

@ -146,7 +146,12 @@ class Comparison(object):
pdf_dict = self.comparison pdf_dict = self.comparison
std_array = list() std_array = list()
for station, phases in pdf_dict.items(): for station, phases in pdf_dict.items():
try:
std_array.append(phases[phase].standard_deviation()) std_array.append(phases[phase].standard_deviation())
except KeyError as e:
print('{err_msg}; station = {station}, phase = {phase}'.format(
err_msg=str(e), station=station, phase=phase))
continue
return std_array return std_array
def hist_expectation(self, phases='all', bins=20, normed=False): def hist_expectation(self, phases='all', bins=20, normed=False):