From c176fc6ffefdc6a51cd6885784c2ce8bf2494ef3 Mon Sep 17 00:00:00 2001 From: Tobias Megies Date: Mon, 27 Mar 2017 12:59:58 +0200 Subject: [PATCH] plot picks that don't have the location code specified (in the QuakeML file) these will plot as "foreign channel" picks in the normal Stream plot, i.e. they will not be associated to any axes, as the axes/Traces/waveforms will always have a location code set. This implies that these picks won't ever be modifiable/deletable through the GUI.. --- CHANGELOG.txt | 4 ++++ obspyck/obspyck.py | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dd1b030..348349e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,6 +13,10 @@ master routines most internals are very likely still using hard coded "P" and "S" values, but for picking and saving to QuakeML only this reportedly works (see #36). + - also show picks in the GUI that lack location code in the corresponding + QuakeML file (but such picks will not be associated to any one of the + Stream's axes, so it will not be possible to modify or delete them via the + GUI, see #49 and #51) 0.4.1 - fix minor bug that prevents 0.4.0 from running diff --git a/obspyck/obspyck.py b/obspyck/obspyck.py index 95e38db..1d18976 100755 --- a/obspyck/obspyck.py +++ b/obspyck/obspyck.py @@ -3024,7 +3024,7 @@ def drawStreamOverview(self): # match any location code in that case.. if str(event.get("creation_info", {}).get("author", "")).startswith("scevent"): loc = None - picks = self.getPicks(network=net, station=sta, location=loc) + picks = self.getPicks(network=net, station=sta) try: arrivals = event.origins[0].arrivals except: @@ -3815,7 +3815,7 @@ def updateAllItems(self): # match any location code in that case.. if event.get("creation_info", {}).get("author", "").startswith("scevent"): loc = None - picks = self.getPicks(network=net, station=sta, location=loc) + picks = self.getPicks(network=net, station=sta) try: arrivals = event.origins[0].arrivals except: @@ -4002,7 +4002,7 @@ def getPick(self, network=None, station=None, phase_hint=None, waveform_id=None, else: return None - def getPicks(self, network, station, location): + def getPicks(self, network, station, location=None): """ returns all matching picks as list. """ @@ -4013,8 +4013,9 @@ def getPicks(self, network, station, location): continue if station != p.waveform_id.station_code: continue - if location != p.waveform_id.location_code: - continue + if location is not None: + if location != p.waveform_id.location_code: + continue ret.append(p) return ret