From e6d5dccb742664dce77f36e984f0d36fdf101486 Mon Sep 17 00:00:00 2001 From: Darius Arnold Date: Thu, 31 Aug 2017 21:58:13 +0200 Subject: [PATCH 1/3] [bugfix] add default values when wadaticheck fails Else plotting crashes due to unset variables --- pylot/core/pick/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pylot/core/pick/utils.py b/pylot/core/pick/utils.py index 006f9837..534df924 100644 --- a/pylot/core/pick/utils.py +++ b/pylot/core/pick/utils.py @@ -652,8 +652,10 @@ def wadaticheck(pickdic, dttolerance, iplot=0, fig_dict=None): print("wadatacheck: Skipped %d S pick(s)" % ibad) else: print("###############################################") - print("wadatacheck: Not enough checked S-P times available!") + print("wadaticheck: Not enough checked S-P times available!") print("Skip Wadati check!") + wfitflag = 1 + wdfit2 = None checkedonsets = pickdic From 91340b66e9d0437da59c78158eb2076988af842d Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 7 Sep 2017 16:57:10 +0200 Subject: [PATCH 2/3] [minor] add window title to pickDlg --- pylot/core/util/widgets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index e038bb3c..fb88823e 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -1208,6 +1208,7 @@ class PickDlg(QDialog): # init pick delete (with right click) self.connect_pick_delete() + self.setWindowTitle('Pickwindow on station: {}'.format(self.getStation())) def setupUi(self): menuBar = QtGui.QMenuBar(self) From 38a071ac5b0705c01394b2d342d44ae2a69ce6a5 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 8 Sep 2017 09:36:34 +0200 Subject: [PATCH 3/3] [minor] suppress rotation warning in GUI --- QtPyLoT.py | 2 +- pylot/core/util/utils.py | 12 +++++++----- pylot/core/util/widgets.py | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/QtPyLoT.py b/QtPyLoT.py index c02599e0..c9460697 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -1461,7 +1461,7 @@ class MainWindow(QMainWindow): check4gaps(wfdat) check4doubled(wfdat) # check for stations with rotated components - wfdat = check4rotated(wfdat, self.metadata) + wfdat = check4rotated(wfdat, self.metadata, verbosity=0) # trim station components to same start value trim_station_components(wfdat, trim_start=True, trim_end=False) self._stime = full_range(self.get_data().getWFData())[0] diff --git a/pylot/core/util/utils.py b/pylot/core/util/utils.py index 28dad3bb..76718605 100644 --- a/pylot/core/util/utils.py +++ b/pylot/core/util/utils.py @@ -702,7 +702,7 @@ def get_stations(data): return stations -def check4rotated(data, metadata=None): +def check4rotated(data, metadata=None, verbosity=1): def rotate_components(wfstream, metadata=None): """rotates components if orientation code is numeric. @@ -711,13 +711,15 @@ def check4rotated(data, metadata=None): # indexing fails if metadata is None metadata[0] except: - msg = 'Warning: could not rotate traces since no metadata was given\nset Inventory file!' - print(msg) + if verbosity: + msg = 'Warning: could not rotate traces since no metadata was given\nset Inventory file!' + print(msg) return wfstream if metadata[0] is None: # sometimes metadata is (None, (None,)) - msg = 'Warning: could not rotate traces since no metadata was given\nCheck inventory directory!' - print(msg) + if verbosity: + msg = 'Warning: could not rotate traces since no metadata was given\nCheck inventory directory!' + print(msg) return wfstream else: parser = metadata[1] diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index fb88823e..6a78926d 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -2497,7 +2497,7 @@ class TuneAutopicker(QWidget): # trim station components to same start value trim_station_components(wfdat, trim_start=True, trim_end=False) # rotate misaligned stations to ZNE - wfdat = check4rotated(wfdat, self.parent.metadata) + wfdat = check4rotated(wfdat, self.parent.metadata, verbosity=0) self.stationBox.clear() stations = [] for trace in self.data.getWFData():