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 6258cf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def getFDSNWSCatalog(cfg, log, minMag=None, starttime=None, endtime=None, eventi
endtime=UTCDateTime(endtime) if endtime else None,
minmagnitude=minMag or None if not eventid else None,
magnitudetype=cfg['Watcher']['Magnitudetype'] or None if not eventid else None,
includeallorigins=True, includeallmagnitudes=True, includearrivals=True,
includeallorigins=True, includeallmagnitudes=True,
orderby='time-asc' if not eventid else None)

except Exception as e:
Expand Down 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
2 changes: 1 addition & 1 deletion src/gisola.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
__credits__ = ["Nikolaos Triantafyllis ([email protected]), Ioannis Venetis ([email protected]), Ioannis Fountoulakis ([email protected]), Erion-Vasilis Pikoulis ([email protected]), Efthimios Sokos ([email protected]), Christos Evangelidis ([email protected])"]
__author__= 'Nikolaos Triantafyllis ([email protected])'
__license__ = "GPLv3"
__version__ = "1.2.1"
__version__ = "1.2.2"
__maintainer__ = "Nikolaos Triantafyllis"
__email__ = "[email protected]"
__status__ = "Production"
Expand Down

0 comments on commit 6258cf9

Please sign in to comment.