diff --git a/QtPyLoT.py b/QtPyLoT.py index cc4416c2..1ff21462 100755 --- a/QtPyLoT.py +++ b/QtPyLoT.py @@ -998,9 +998,16 @@ class MainWindow(QMainWindow): w0, fc = calcsourcespec(wf, onset, fninv, self.inputs.get('vp'), dist, a.azimuth, a.takeoff_angle, self.inputs.get('Qp'), 0) - stat_mags = calcMoMw(wf, w0, 2700., 3000., dist, fninv) - mags[station] = stat_mags + if w0 is None or fc is None: + continue + station_mag = calcMoMw(wf, w0, 2700., 3000., dist, fninv) + mags[station] = station_mag mag = np.median([M[1] for M in mags.values()]) + # give some information on the processing + print('number of stations used: {0}\n'.format(len(mags.values()))) + print('stations used:\n') + for s in mags.keys(): print('\t{0}'.format(s)) + return Magnitude(mag=mag, magnitude_type='Mw') else: return None