Additional screen output, temporarily comment amplitude info for

obs-file.
This commit is contained in:
Ludger Küperkoch 2021-06-15 11:18:24 +02:00
parent 5289be55dd
commit 67e2ba3ad7
3 changed files with 18 additions and 10 deletions

View File

@ -282,12 +282,13 @@ class LocalMagnitude(Magnitude):
for a in self.arrivals:
if a.phase not in 'sS':
continue
pick = a.pick_id.get_referred_object()
station = pick.waveform_id.station_code
# make sure calculating Ml only from reliable onsets
# NLLoc: time_weight = 0 => do not use onset!
if a.time_weight == 0:
print("Uncertain pick at Station {}, do not use it!".format(station))
continue
pick = a.pick_id.get_referred_object()
station = pick.waveform_id.station_code
wf = select_for_phase(self.stream.select(
station=station), a.phase)
if not wf:
@ -399,7 +400,13 @@ class MomentMagnitude(Magnitude):
print("WARNING: No instrument corrected data available,"
" no magnitude calculation possible! Go on.")
continue
scopy = self.stream.copy()
try:
scopy = self.stream.copy()
except AssertionError:
print("WARNING: Something's wrong with the data,"
"station {},"
"no calculation of moment magnitude possible! Go on.".format(station))
continue
wf = scopy.select(station=station)
if not wf:
continue

View File

@ -354,13 +354,13 @@ class Data(object):
nllocfile = open(fnout + fnext)
l = nllocfile.readlines()
# Adding A0/Generic Amplitude to .obs file
l2 = []
for li in l:
for amp in evtdata_org.amplitudes:
if amp.waveform_id.station_code == li[0:5].strip():
li = li[0:64] + '{:0.2e}'.format(amp.generic_amplitude) + li[73:-1] + '\n'
l2.append(li)
l = l2
#l2 = []
#for li in l:
# for amp in evtdata_org.amplitudes:
# if amp.waveform_id.station_code == li[0:5].strip():
# li = li[0:64] + '{:0.2e}'.format(amp.generic_amplitude) + li[73:-1] + '\n'
# l2.append(li)
#l = l2
nllocfile.close()
l.insert(0, header)
nllocfile = open(fnout + fnext, 'w')

View File

@ -543,6 +543,7 @@ def writephases(arrivals, fformat, filename, parameter=None, eventinfo=None):
try:
if arrivals[key]['P']['weight'] >= 4:
pweight = 0 # do not use pick
print("Station {}: Uncertain pick, do not use it!".format(key))
except KeyError as e:
print(e.message + '; no weight set during processing')
fid.write('%s ? ? ? P %s %d%02d%02d %02d%02d %7.4f GAU 0 0 0 0 %d \n' % (key,