Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plot picks that don't have the location code specified (in the QuakeML file) #51

Merged
merged 1 commit into from
Mar 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions obspyck/obspyck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
"""
Expand All @@ -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

Expand Down