From 01fea084d5c1a873fc4e782f8927ba585684869c Mon Sep 17 00:00:00 2001 From: Ludger Kueperkoch Date: Thu, 15 Oct 2020 09:43:25 +0200 Subject: [PATCH] [Bugfix] Avoid printing * in focmec-input file. --- pylot/core/io/phases.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pylot/core/io/phases.py b/pylot/core/io/phases.py index 900a3329..73445bbe 100644 --- a/pylot/core/io/phases.py +++ b/pylot/core/io/phases.py @@ -840,8 +840,15 @@ def writephases(arrivals, fformat, filename, parameter=None, eventinfo=None): print("No source origin calculated yet, thus no FOCMEC-infile creation possible!") return stime = eventsource['time'] + + # avoid printing '*' in focmec-input file + if parameter.get('eventid') == '*' or parameter.get('eventid') is None: + evID = 'e0000' + else: + evID = parameter.get('eventid') + # write header line including event information - fid.write('%s %d%02d%02d%02d%02d%02.0f %7.4f %6.4f %3.1f %3.1f\n' % (parameter.get('eventID'), + fid.write('%s %d%02d%02d%02d%02d%02.0f %7.4f %6.4f %3.1f %3.1f\n' % (evID, stime.year, stime.month, stime.day, stime.hour, stime.minute, stime.second, eventsource['latitude'],