[new] added origin information to the net_magnitude

This commit is contained in:
Sebastian Wehling-Benatelli 2016-09-28 14:53:57 +02:00
parent d093349b50
commit 019a3ae0f3

View File

@ -82,6 +82,10 @@ class Magnitude(object):
def event(self): def event(self):
return self._event return self._event
@property
def origin_id(self):
return self._event.origins[0].resource_id
@property @property
def arrivals(self): def arrivals(self):
return self._event.origins[0].arrivals return self._event.origins[0].arrivals
@ -107,7 +111,9 @@ class Magnitude(object):
def net_magnitude(self): def net_magnitude(self):
if self: if self:
return ObspyMagnitude(mag=np.median([M["mag"] for M in self.magnitudes.values()]), type=self.type) return ObspyMagnitude(mag=np.median([M["mag"] for M in
self.magnitudes.values()]),
type=self.type, origin_id=self.origin_id)
return None return None