Save only picks for NLLoc, VELEST, etc. that not exceed adjusted uncertainties.
This commit is contained in:
parent
e3a4a2861d
commit
49092a928e
@ -1079,6 +1079,10 @@ class MainWindow(QMainWindow):
|
|||||||
settings = QSettings()
|
settings = QSettings()
|
||||||
fbasename = self.getEventFileName()
|
fbasename = self.getEventFileName()
|
||||||
exform = settings.value('data/exportFormat', 'QUAKEML')
|
exform = settings.value('data/exportFormat', 'QUAKEML')
|
||||||
|
|
||||||
|
uppererrorP = self._inputs['timeerrorsP']
|
||||||
|
uppererrorS = self._inputs['timeerrorsS']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.get_data().applyEVTData(self.get_current_event(), typ='event')#getPicks())
|
self.get_data().applyEVTData(self.get_current_event(), typ='event')#getPicks())
|
||||||
except OverwriteError:
|
except OverwriteError:
|
||||||
@ -1097,7 +1101,7 @@ class MainWindow(QMainWindow):
|
|||||||
# return False
|
# return False
|
||||||
# MP MP changed to suppress unnecessary user prompt
|
# MP MP changed to suppress unnecessary user prompt
|
||||||
try:
|
try:
|
||||||
self.get_data().exportEvent(fbasename, exform)
|
self.get_data().exportEvent(fbasename, exform, upperErrors=[uppererrorP[3], uppererrorS[3]])
|
||||||
except FormatError as e:
|
except FormatError as e:
|
||||||
fbasename, exform = getSavePath(e, directory, outformat)
|
fbasename, exform = getSavePath(e, directory, outformat)
|
||||||
except AttributeError as e:
|
except AttributeError as e:
|
||||||
@ -1119,7 +1123,7 @@ class MainWindow(QMainWindow):
|
|||||||
# return False
|
# return False
|
||||||
|
|
||||||
# export to given path
|
# export to given path
|
||||||
self.get_data().exportEvent(fbasename, exform)
|
self.get_data().exportEvent(fbasename, exform, upperErrors=[uppererrorP[3], uppererrorS[3]])
|
||||||
# all files save (ui clean)
|
# all files save (ui clean)
|
||||||
self.update_status('Picks saved as %s' % (fbasename + exform))
|
self.update_status('Picks saved as %s' % (fbasename + exform))
|
||||||
self.disableSaveManualPicksAction()
|
self.disableSaveManualPicksAction()
|
||||||
|
@ -147,10 +147,9 @@ class Data(object):
|
|||||||
# handle forbidden filenames especially on windows systems
|
# handle forbidden filenames especially on windows systems
|
||||||
return fnConstructor(str(ID))
|
return fnConstructor(str(ID))
|
||||||
|
|
||||||
def exportEvent(self, fnout, fnext='.xml', fcheck='auto'):
|
def exportEvent(self, fnout, fnext='.xml', fcheck='auto', upperErrors=None):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
:param fnout:
|
:param fnout:
|
||||||
:param fnext:
|
:param fnext:
|
||||||
:param fcheck:
|
:param fcheck:
|
||||||
@ -188,10 +187,32 @@ class Data(object):
|
|||||||
|
|
||||||
# try exporting event via ObsPy
|
# try exporting event via ObsPy
|
||||||
else:
|
else:
|
||||||
# check for stations picked automatically as well as manually
|
|
||||||
# Prefer manual picks!
|
|
||||||
evtdata_copy = self.get_evt_data().copy()
|
evtdata_copy = self.get_evt_data().copy()
|
||||||
evtdata_org = self.get_evt_data()
|
evtdata_org = self.get_evt_data()
|
||||||
|
if upperErrors:
|
||||||
|
# check for pick uncertainties exceeding adjusted upper errors
|
||||||
|
# Picks with larger uncertainties will not be saved in output file!
|
||||||
|
for j in range(len(evtdata_org.picks)):
|
||||||
|
for i in range(len(evtdata_copy.picks)):
|
||||||
|
if evtdata_copy.picks[i].phase_hint[0] == 'P':
|
||||||
|
if evtdata_copy.picks[i].time_errors['lower_uncertainty'] >= upperErrors[0] or \
|
||||||
|
evtdata_copy.picks[i].time_errors['upper_uncertainty'] >= upperErrors[0]:
|
||||||
|
print("Uncertainty exceeds adjusted upper time error!")
|
||||||
|
print("P-Pick of station {} will not be saved in outputfile".format(
|
||||||
|
evtdata_copy.picks[i].waveform_id.station_code))
|
||||||
|
del evtdata_copy.picks[i]
|
||||||
|
break
|
||||||
|
if evtdata_copy.picks[i].phase_hint[0] == 'S':
|
||||||
|
if evtdata_copy.picks[i].time_errors['lower_uncertainty'] >= upperErrors[1] or \
|
||||||
|
evtdata_copy.picks[i].time_errors['upper_uncertainty'] >= upperErrors[1]:
|
||||||
|
print("Uncertainty exceeds adjusted upper time error!")
|
||||||
|
print("S-Pick of station {} will not be saved in outputfile".format(
|
||||||
|
evtdata_copy.picks[i].waveform_id.station_code))
|
||||||
|
del evtdata_copy.picks[i]
|
||||||
|
break
|
||||||
|
|
||||||
|
# check for stations picked automatically as well as manually
|
||||||
|
# Prefer manual picks!
|
||||||
for i in range(len(evtdata_org.picks)):
|
for i in range(len(evtdata_org.picks)):
|
||||||
if evtdata_org.picks[i].method_id == 'manual':
|
if evtdata_org.picks[i].method_id == 'manual':
|
||||||
mstation = evtdata_org.picks[i].waveform_id.station_code
|
mstation = evtdata_org.picks[i].waveform_id.station_code
|
||||||
|
Loading…
Reference in New Issue
Block a user