Skip to content

Commit

Permalink
Failover magnitude retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosT committed Jun 3, 2024
1 parent ecf703f commit bd08536
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ def getOrigin(cfg, evt, historical):

def getMagnitude(evt, org):
# retrieve associated magnitude
return [m for m in evt.magnitudes if m.origin_id==org.resource_id][0]
try:
return [m for m in evt.magnitudes if m.origin_id==org.resource_id][0]
except:
return evt.preferred_magnitude()

def getFocalMechanism(evt):
# retrieve "best" focal info (if any), else last found
Expand Down

0 comments on commit bd08536

Please sign in to comment.