[refactor] rename getQualityFromUncertainty function to be more pythonic
This commit is contained in:
@@ -141,7 +141,7 @@ def excludeQualityClasses(picks, qClasses, timeerrorsP, timeerrorsS):
|
||||
:return: dictionary containing only picks above the excluded quality class(es)
|
||||
:rtype: dict
|
||||
"""
|
||||
from pylot.core.pick.utils import getQualityFromUncertainty
|
||||
from pylot.core.pick.utils import get_quality_class
|
||||
|
||||
if type(qClasses) in [int, float]:
|
||||
qClasses = [qClasses]
|
||||
@@ -156,7 +156,7 @@ def excludeQualityClasses(picks, qClasses, timeerrorsP, timeerrorsS):
|
||||
if not type(pick) in [AttribDict, dict]:
|
||||
continue
|
||||
pickerror = phaseError[identifyPhaseID(phase)]
|
||||
quality = getQualityFromUncertainty(pick['spe'], pickerror)
|
||||
quality = get_quality_class(pick['spe'], pickerror)
|
||||
if not quality in qClasses:
|
||||
if not station in picksdict_new:
|
||||
picksdict_new[station] = {}
|
||||
|
||||
@@ -42,7 +42,7 @@ from obspy.taup.utils import get_phase_names
|
||||
from pylot.core.io.data import Data
|
||||
from pylot.core.io.inputs import FilterOptions, PylotParameter
|
||||
from pylot.core.pick.utils import getSNR, earllatepicker, getnoisewin, \
|
||||
getResolutionWindow, getQualityFromUncertainty
|
||||
getResolutionWindow, get_quality_class
|
||||
from pylot.core.pick.compare import Comparison
|
||||
from pylot.core.util.defaults import OUTPUTFORMATS, FILTERDEFAULTS, \
|
||||
SetChannelComponents
|
||||
@@ -2259,10 +2259,10 @@ class PickDlg(QDialog):
|
||||
|
||||
# get quality classes
|
||||
if self.getPhaseID(phase) == 'P':
|
||||
quality = getQualityFromUncertainty(picks['spe'], self.parameter['timeerrorsP'])
|
||||
quality = get_quality_class(picks['spe'], self.parameter['timeerrorsP'])
|
||||
phaseID = 'P'
|
||||
elif self.getPhaseID(phase) == 'S':
|
||||
quality = getQualityFromUncertainty(picks['spe'], self.parameter['timeerrorsS'])
|
||||
quality = get_quality_class(picks['spe'], self.parameter['timeerrorsS'])
|
||||
phaseID = 'S'
|
||||
|
||||
mpp = picks['mpp'] - self.getStartTime()
|
||||
@@ -3180,8 +3180,8 @@ class TuneAutopicker(QWidget):
|
||||
('refSpick', 0),
|
||||
('el_S1pick', 0),
|
||||
('el_S2pick', 0)]
|
||||
qualityPpick = getQualityFromUncertainty(picks['P']['spe'], self.parameter['timeerrorsP'])
|
||||
qualitySpick = getQualityFromUncertainty(picks['S']['spe'], self.parameter['timeerrorsS'])
|
||||
qualityPpick = get_quality_class(picks['P']['spe'], self.parameter['timeerrorsP'])
|
||||
qualitySpick = get_quality_class(picks['S']['spe'], self.parameter['timeerrorsS'])
|
||||
for p_ax in p_axes:
|
||||
axes = self.parent().fig_dict[p_ax[0]].axes
|
||||
if not axes:
|
||||
|
||||
Reference in New Issue
Block a user