[new] added origin information to the net_magnitude
This commit is contained in:
parent
d093349b50
commit
019a3ae0f3
@ -82,6 +82,10 @@ class Magnitude(object):
|
||||
def event(self):
|
||||
return self._event
|
||||
|
||||
@property
|
||||
def origin_id(self):
|
||||
return self._event.origins[0].resource_id
|
||||
|
||||
@property
|
||||
def arrivals(self):
|
||||
return self._event.origins[0].arrivals
|
||||
@ -107,7 +111,9 @@ class Magnitude(object):
|
||||
|
||||
def net_magnitude(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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user