From 0a571d99998581342e5e643e561c5dc96aaacce7 Mon Sep 17 00:00:00 2001 From: nikosT Date: Mon, 3 Jun 2024 13:34:36 +0300 Subject: [PATCH] Failover magnitude retrieval --- src/event.py | 5 ++++- src/gisola.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/event.py b/src/event.py index a6a3745..6e80c3d 100644 --- a/src/event.py +++ b/src/event.py @@ -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 diff --git a/src/gisola.py b/src/gisola.py index 63c5231..3b518ce 100644 --- a/src/gisola.py +++ b/src/gisola.py @@ -32,7 +32,7 @@ __credits__ = ["Nikolaos Triantafyllis (triantafyl@noa.gr), Ioannis Venetis (venetis@unipi.gr), Ioannis Fountoulakis (ifountoul@noa.gr), Erion-Vasilis Pikoulis (pikoulis@ceid.upatras.gr), Efthimios Sokos (esokos@upatras.gr), Christos Evangelidis (cevan@noa.gr)"] __author__= 'Nikolaos Triantafyllis (triantafyl@noa.gr)' __license__ = "GPLv3" -__version__ = "1.2.1" +__version__ = "1.2.2" __maintainer__ = "Nikolaos Triantafyllis" __email__ = "triantafyl@noa.gr" __status__ = "Production"