From 4a9c02e1d1e3c6ae10af9bb1968f22260afc3395 Mon Sep 17 00:00:00 2001 From: Sebastianw Wehling-Benatelli Date: Tue, 12 Apr 2016 04:55:04 +0200 Subject: [PATCH] [closes 195] in principle comparing automatic and manual picks works --- pylot/core/pick/compare.py | 16 +++++++++++----- pylot/core/util/pdf.py | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pylot/core/pick/compare.py b/pylot/core/pick/compare.py index 9498683e..c3384b50 100644 --- a/pylot/core/pick/compare.py +++ b/pylot/core/pick/compare.py @@ -134,7 +134,12 @@ class Comparison(object): pdf_dict = self.comparison exp_array = list() for station, phases in pdf_dict.items(): - exp_array.append(phases[phase].expectation()) + try: + exp_array.append(phases[phase].expectation()) + except KeyError as e: + print('{err_msg}; station = {station}, phase = {phase}'.format( + err_msg=str(e), station=station, phase=phase)) + continue return exp_array def get_std_array(self, phase): @@ -242,7 +247,8 @@ class PDFDictionary(object): return pdf_picks -comp_obj = Comparison(manual='/home/sebastianp/Data/Insheim/e0057.026.13.xml', auto='/home/sebastianp/Data/Insheim/e0057.026.13.xml') -comp_obj.plot() -comp_obj.hist_expectation() -comp_obj.hist_standard_deviation() \ No newline at end of file +#comp_obj = Comparison(manual='/home/sebastianp/Data/Insheim/e0019.048.13.xml', +# auto='/data/Geothermie/Insheim/EVENT_DATA/LOCAL/RefDB/e0019.048.13/autoPyLoT.xml') +#comp_obj.plot() +#comp_obj.hist_expectation() +#comp_obj.hist_standard_deviation() diff --git a/pylot/core/util/pdf.py b/pylot/core/util/pdf.py index 05104ee1..dddb260f 100644 --- a/pylot/core/util/pdf.py +++ b/pylot/core/util/pdf.py @@ -181,7 +181,7 @@ class ProbabilityDensityFunction(object): self._x = np.array(x) @classmethod - def fromPick(self, lbound, barycentre, rbound, incr=0.0001, decfact=0.01, + def fromPick(self, lbound, barycentre, rbound, incr=0.001, decfact=0.01, type='gauss'): ''' Initialize a new ProbabilityDensityFunction object.