Manualy adding generic Amplitude to .obs files
Due to the obspy write function not including the generic Amplitude/A0 in the .obs file (NonLinLoc) even when the Event holds this Data. Obspy Team has been informed by opening an issue on Github
This commit is contained in:
parent
f11ffc67ff
commit
27c9bbb96a
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env pyth n
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
@ -353,6 +353,14 @@ class Data(object):
|
|||||||
header = '# EQEVENT: Label: EQ%s Loc: X 0.00 Y 0.00 Z 10.00 OT 0.00 \n' % evid
|
header = '# EQEVENT: Label: EQ%s Loc: X 0.00 Y 0.00 Z 10.00 OT 0.00 \n' % evid
|
||||||
nllocfile = open(fnout + fnext)
|
nllocfile = open(fnout + fnext)
|
||||||
l = nllocfile.readlines()
|
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
|
||||||
nllocfile.close()
|
nllocfile.close()
|
||||||
l.insert(0, header)
|
l.insert(0, header)
|
||||||
nllocfile = open(fnout + fnext, 'w')
|
nllocfile = open(fnout + fnext, 'w')
|
||||||
|
Loading…
Reference in New Issue
Block a user