diff --git a/apps/python/scalert.py b/apps/python/scalert.py index a249767b9..de10df48f 100644 --- a/apps/python/scalert.py +++ b/apps/python/scalert.py @@ -755,7 +755,16 @@ def notifyEvent(self, evt, newEvent=True, dtmax=3600): except Exception: evType = "earthquake" - dep = org.depth().value() + if org.depth().value() <1: + dep = round(org.depth().value(), 2) * 1000 + else: + dep = round(org.depth().value(), 2) + + if org.depth().value() <1: + depth_measure = "Meters" + else: + depth_measure = "Kilometers" + now = seiscomp.core.Time.GMT() otm = org.time().value() @@ -774,7 +783,7 @@ def notifyEvent(self, evt, newEvent=True, dtmax=3600): if preliminary: message = f"{evType}, XXL, preliminary, {dt}, {dsc}" else: - message = f"{evType}, {dt}, {dsc}, {mag}, depth {int(dep + 0.5)} kilometers" + message = f"{evType}, {dt}, {dsc}, {mag}, depth {dep} {depth_measure}" seiscomp.logging.info(message)