From 125b72a5826d87edec50c524e8b166d49505f642 Mon Sep 17 00:00:00 2001 From: marcel Date: Thu, 3 Aug 2017 12:05:19 +0200 Subject: [PATCH] [bugfix] autoPyLoT crashed when getSlope() method of AICPicker returned None (comparing None to float), workaround: if not slope: slope=0 --- pylot/core/pick/autopick.py | 16 +++++++++++----- pylot/core/util/widgets.py | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pylot/core/pick/autopick.py b/pylot/core/pick/autopick.py index 2f396dee..6030c121 100644 --- a/pylot/core/pick/autopick.py +++ b/pylot/core/pick/autopick.py @@ -306,8 +306,11 @@ def autopickstation(wfstream, pickparam, verbose=False, iplot=0, fig_dict=None): Pweight = 9 ############################################################## # go on with processing if AIC onset passes quality control - if (aicpick.getSlope() >= minAICPslope and - aicpick.getSNR() >= minAICPSNR and Pflag == 1): + slope = aicpick.getSlope() + if not slope: + slope = 0 + if (slope >= minAICPslope and + aicpick.getSNR() >= minAICPSNR and Pflag == 1): aicPflag = 1 msg = 'AIC P-pick passes quality control: Slope: {0} counts/s, ' \ 'SNR: {1}\nGo on with refined picking ...\n' \ @@ -499,9 +502,12 @@ def autopickstation(wfstream, pickparam, verbose=False, iplot=0, fig_dict=None): aictsmoothS, fig=fig) ############################################################### # go on with processing if AIC onset passes quality control - if (aicarhpick.getSlope() >= minAICSslope and - aicarhpick.getSNR() >= minAICSSNR and - aicarhpick.getpick() is not None): + slope = aicpick.getSlope() + if not slope: + slope = 0 + if (slope >= minAICSslope and + aicarhpick.getSNR() >= minAICSSNR and + aicarhpick.getpick() is not None): aicSflag = 1 msg = 'AIC S-pick passes quality control: Slope: {0} counts/s, ' \ 'SNR: {1}\nGo on with refined picking ...\n' \ diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 0a8e5805..3b56b95d 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -2969,7 +2969,7 @@ class SubmitLocal(QWidget): self.execute_command(pp_export, ncores) def execute_command(self, pp_export, ncores): - command = self.script_fn + command = self.script_fn[:] command.append(pp_export) command.append('--ncores') command.append(str(ncores))