Additional screen output, temporarily comment amplitude info for
obs-file.
This commit is contained in:
parent
5289be55dd
commit
67e2ba3ad7
@ -282,12 +282,13 @@ class LocalMagnitude(Magnitude):
|
|||||||
for a in self.arrivals:
|
for a in self.arrivals:
|
||||||
if a.phase not in 'sS':
|
if a.phase not in 'sS':
|
||||||
continue
|
continue
|
||||||
|
pick = a.pick_id.get_referred_object()
|
||||||
|
station = pick.waveform_id.station_code
|
||||||
# make sure calculating Ml only from reliable onsets
|
# make sure calculating Ml only from reliable onsets
|
||||||
# NLLoc: time_weight = 0 => do not use onset!
|
# NLLoc: time_weight = 0 => do not use onset!
|
||||||
if a.time_weight == 0:
|
if a.time_weight == 0:
|
||||||
|
print("Uncertain pick at Station {}, do not use it!".format(station))
|
||||||
continue
|
continue
|
||||||
pick = a.pick_id.get_referred_object()
|
|
||||||
station = pick.waveform_id.station_code
|
|
||||||
wf = select_for_phase(self.stream.select(
|
wf = select_for_phase(self.stream.select(
|
||||||
station=station), a.phase)
|
station=station), a.phase)
|
||||||
if not wf:
|
if not wf:
|
||||||
@ -399,7 +400,13 @@ class MomentMagnitude(Magnitude):
|
|||||||
print("WARNING: No instrument corrected data available,"
|
print("WARNING: No instrument corrected data available,"
|
||||||
" no magnitude calculation possible! Go on.")
|
" no magnitude calculation possible! Go on.")
|
||||||
continue
|
continue
|
||||||
|
try:
|
||||||
scopy = self.stream.copy()
|
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)
|
wf = scopy.select(station=station)
|
||||||
if not wf:
|
if not wf:
|
||||||
continue
|
continue
|
||||||
|
@ -354,13 +354,13 @@ class Data(object):
|
|||||||
nllocfile = open(fnout + fnext)
|
nllocfile = open(fnout + fnext)
|
||||||
l = nllocfile.readlines()
|
l = nllocfile.readlines()
|
||||||
# Adding A0/Generic Amplitude to .obs file
|
# Adding A0/Generic Amplitude to .obs file
|
||||||
l2 = []
|
#l2 = []
|
||||||
for li in l:
|
#for li in l:
|
||||||
for amp in evtdata_org.amplitudes:
|
# for amp in evtdata_org.amplitudes:
|
||||||
if amp.waveform_id.station_code == li[0:5].strip():
|
# if amp.waveform_id.station_code == li[0:5].strip():
|
||||||
li = li[0:64] + '{:0.2e}'.format(amp.generic_amplitude) + li[73:-1] + '\n'
|
# li = li[0:64] + '{:0.2e}'.format(amp.generic_amplitude) + li[73:-1] + '\n'
|
||||||
l2.append(li)
|
# l2.append(li)
|
||||||
l = l2
|
#l = l2
|
||||||
nllocfile.close()
|
nllocfile.close()
|
||||||
l.insert(0, header)
|
l.insert(0, header)
|
||||||
nllocfile = open(fnout + fnext, 'w')
|
nllocfile = open(fnout + fnext, 'w')
|
||||||
|
@ -543,6 +543,7 @@ def writephases(arrivals, fformat, filename, parameter=None, eventinfo=None):
|
|||||||
try:
|
try:
|
||||||
if arrivals[key]['P']['weight'] >= 4:
|
if arrivals[key]['P']['weight'] >= 4:
|
||||||
pweight = 0 # do not use pick
|
pweight = 0 # do not use pick
|
||||||
|
print("Station {}: Uncertain pick, do not use it!".format(key))
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
print(e.message + '; no weight set during processing')
|
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,
|
fid.write('%s ? ? ? P %s %d%02d%02d %02d%02d %7.4f GAU 0 0 0 0 %d \n' % (key,
|
||||||
|
Loading…
Reference in New Issue
Block a user