Skip to content

Instantly share code, notes, and snippets.

@calum-chamberlain
Created December 24, 2018 04:04
Show Gist options
  • Save calum-chamberlain/a7cc11ae8dd0f5387d627e5c5de94a7d to your computer and use it in GitHub Desktop.
Save calum-chamberlain/a7cc11ae8dd0f5387d627e5c5de94a7d to your computer and use it in GitHub Desktop.
class SparseEvent:
"""
Sparse event class with only picks and origins to mimic
obspy events.
"""
def __init__(self, resource_id, origins, picks):
self.resource_id = resource_id
self.origins = origins
self.picks = picks
def preferred_origin(self):
return self.origins[0]
class SparsePick:
def __init__(self, time, phase_hint, waveform_id, evaluation_mode):
self.time = time
self.phase_hint = phase_hint
self.waveform_id = waveform_id
self.evaluation_mode = evaluation_mode
class SparseOrigin:
def __init__(self, latitude, longitude, time, depth):
self.latitude = latitude
self.longitude = longitude
self.depth = depth
self.time = time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment