Activated magnitude calculation, removed typo (WAscaling), still buggy in applyEvent!
This commit is contained in:
parent
b4eeef55a6
commit
929ddb0ab2
29
PyLoT.py
29
PyLoT.py
@ -2994,7 +2994,7 @@ class MainWindow(QMainWindow):
|
|||||||
# os.remove(phasefile)
|
# os.remove(phasefile)
|
||||||
|
|
||||||
self.get_data().applyEVTData(lt.read_location(locpath), typ='event')
|
self.get_data().applyEVTData(lt.read_location(locpath), typ='event')
|
||||||
#self.get_data().applyEVTData(self.calc_magnitude(), typ='event')
|
self.get_data().applyEVTData(self.calc_magnitude(), typ='event')
|
||||||
|
|
||||||
def init_array_tab(self):
|
def init_array_tab(self):
|
||||||
'''
|
'''
|
||||||
@ -3369,29 +3369,32 @@ class MainWindow(QMainWindow):
|
|||||||
for inventory in self.project.inventories:
|
for inventory in self.project.inventories:
|
||||||
self.metadata.add_inventory(inventory)
|
self.metadata.add_inventory(inventory)
|
||||||
|
|
||||||
def calc_magnitude(self, type='ML'):
|
def calc_magnitude(self):
|
||||||
self.init_metadata()
|
self.init_metadata()
|
||||||
if not self.metadata:
|
if not self.metadata:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
wf_copy = self.get_data().getWFData().copy()
|
wf_copy = self.get_data().getWFData().copy()
|
||||||
corr_wf, rest_flag = restitute_data(wf_copy, self.metadata)
|
corr_wf = restitute_data(wf_copy, self.metadata)
|
||||||
|
|
||||||
#if not rest_flag:
|
#if not rest_flag:
|
||||||
# # raise ProcessingError('Restitution of waveform data failed!')
|
# # raise ProcessingError('Restitution of waveform data failed!')
|
||||||
# print('Restitution of waveform data failed!')
|
# print('Restitution of waveform data failed!')
|
||||||
# return None
|
# return None
|
||||||
#else:
|
#else:
|
||||||
if type == 'ML':
|
#if type == 'ML':
|
||||||
local_mag = LocalMagnitude(corr_wf, self.get_data().get_evt_data(), self.inputs.get('sstop'),
|
# calculate local magnitude
|
||||||
self.inputs.get('WAScaling'), verbosity=True)
|
local_mag = LocalMagnitude(corr_wf, self.get_data().get_evt_data(), self.inputs.get('sstop'),
|
||||||
return local_mag.updated_event()
|
self.inputs.get('WAscaling'), verbosity=True)
|
||||||
elif type == 'Mw':
|
#return local_mag.updated_event()
|
||||||
moment_mag = MomentMagnitude(corr_wf, self.get_data().get_evt_data(), self.inputs.get('vp'),
|
#elif type == 'Mw':
|
||||||
self.inputs.get('Qp'), self.inputs.get('rho'), verbosity=True)
|
#if type == 'Mw':
|
||||||
return moment_mag.updated_event()
|
# calculate moment magnitude
|
||||||
else:
|
moment_mag = MomentMagnitude(corr_wf, self.get_data().get_evt_data(), self.inputs.get('vp'),
|
||||||
return None
|
self.inputs.get('Qp'), self.inputs.get('rho'), verbosity=True)
|
||||||
|
return local_mag.updated_event(), moment_mag.updated_event()
|
||||||
|
# else:
|
||||||
|
# return None
|
||||||
|
|
||||||
def check4Loc(self):
|
def check4Loc(self):
|
||||||
return self.picksNum() >= 4
|
return self.picksNum() >= 4
|
||||||
|
Loading…
Reference in New Issue
Block a user