Modified writephases for NLLoc: writes dummy onset times (start of seismic trace) into phase file in order to derive theoretical onset times later needed for iterative picking.

This commit is contained in:
Ludger Küperkoch 2015-11-18 11:11:10 +01:00
parent 8592557613
commit e1c2629f97

View File

@ -961,46 +961,58 @@ def writephases(arrivals, fformat, filename):
# write header # write header
fid.write('# EQEVENT: Label: EQ001 Loc: X 0.00 Y 0.00 Z 10.00 OT 0.00 \n') fid.write('# EQEVENT: Label: EQ001 Loc: X 0.00 Y 0.00 Z 10.00 OT 0.00 \n')
for key in arrivals: for key in arrivals:
if arrivals[key]['P']['weight'] < 4: # P onsets
fm = arrivals[key]['P']['fm'] if arrivals[key]['P']:
if fm == None: fm = arrivals[key]['P']['fm']
fm = '?' if fm == None:
onset = arrivals[key]['P']['mpp'] fm = '?'
year = onset.year onset = arrivals[key]['P']['mpp']
month = onset.month year = onset.year
day = onset.day month = onset.month
hh = onset.hour day = onset.day
mm = onset.minute hh = onset.hour
ss = onset.second mm = onset.minute
ms = onset.microsecond ss = onset.second
ss_ms = ss + ms / 1000000.0 ms = onset.microsecond
fid.write('%s ? ? ? P %s %d%02d%02d %02d%02d %7.4f GAU 0 0 0 0 1 \n' % (key, ss_ms = ss + ms / 1000000.0
fm, if arrivals[key]['P']['weight'] < 4:
year, pweight = 1 # use pick
month, else:
day, pweight = 0 # do not use pick
hh, fid.write('%s ? ? ? P %s %d%02d%02d %02d%02d %7.4f GAU 0 0 0 0 %d \n' % (key,
mm, fm,
ss_ms)) year,
if arrivals[key]['S']['weight'] < 4: month,
fm = '?' day,
onset = arrivals[key]['S']['mpp'] hh,
year = onset.year mm,
month = onset.month ss_ms,
day = onset.day pweight))
hh = onset.hour # S onsets
mm = onset.minute if arrivals[key]['S']:
ss = onset.second fm = '?'
ms = onset.microsecond onset = arrivals[key]['S']['mpp']
ss_ms = ss + ms / 1000000.0 year = onset.year
fid.write('%s ? ? ? S %s %d%02d%02d %02d%02d %7.4f GAU 0 0 0 0 1 \n' % (key, month = onset.month
fm, day = onset.day
year, hh = onset.hour
month, mm = onset.minute
day, ss = onset.second
hh, ms = onset.microsecond
mm, ss_ms = ss + ms / 1000000.0
ss_ms)) if arrivals[key]['S']['weight'] < 4:
sweight = 1 # use pick
else:
sweight = 0 # do not use pick
fid.write('%s ? ? ? S %s %d%02d%02d %02d%02d %7.4f GAU 0 0 0 0 %d \n' % (key,
fm,
year,
month,
day,
hh,
mm,
ss_ms,
sweight))
fid.close() fid.close()