[add] jackknife safety factor no longer hardcoded, GUI parameter added

This commit is contained in:
Darius Arnold 2017-08-26 17:22:28 +02:00 committed by Marcel
parent 71973a5348
commit bac6d6f5ec
3 changed files with 12 additions and 5 deletions

View File

@ -348,6 +348,11 @@ defaults = {'rootpath': {'type': str,
'value': 1.0,
'namestring': 'Wadati tolerance'},
'jackfactor': {'type': float,
'tooltip': 'pick is removed if the variance of the subgroup with the pick removed is larger than the mean variance of all subgroups times safety factor',
'value': 5.0,
'namestring': 'Jackknife safety factor'},
'WAscaling': {'type': (float, float, float),
'tooltip': 'Scaling relation (log(Ao)+Alog(r)+Br+C) of Wood-Anderson amplitude Ao [nm] \
If zeros are set, original Richter magnitude is calculated!',
@ -481,5 +486,6 @@ settings_special_pick = {
'minpercent',
'zfac',
'mdttolerance',
'wdttolerance']
'wdttolerance',
'jackfactor'],
}

View File

@ -41,6 +41,7 @@ def autopickevent(data, param, iplot=0, fig_dict=None, fig_dict_wadatijack=None,
# parameter input file (usually autoPyLoT.in).
wdttolerance = param.get('wdttolerance')
mdttolerance = param.get('mdttolerance')
jackfactor = param.get('jackfactor')
apverbose = param.get('apverbose')
for n in range(len(data)):
station = data[n].stats.station
@ -80,7 +81,7 @@ def autopickevent(data, param, iplot=0, fig_dict=None, fig_dict_wadatijack=None,
# quality control
# median check and jackknife on P-onset times
jk_checked_onsets = checkPonsets(all_onsets, mdttolerance, 1, fig_dict_wadatijack)
jk_checked_onsets = checkPonsets(all_onsets, mdttolerance, jackfactor, 1, fig_dict_wadatijack)
#return jk_checked_onsets
# check S-P times (Wadati)
wadationsets = wadaticheck(jk_checked_onsets, wdttolerance, 1, fig_dict_wadatijack)

View File

@ -803,7 +803,7 @@ def checksignallength(X, pick, TSNR, minsiglength, nfac, minpercent, iplot=0, fi
return returnflag
def checkPonsets(pickdic, dttolerance, iplot=0, fig_dict=None):
def checkPonsets(pickdic, dttolerance, jackfactor, iplot=0, fig_dict=None):
'''
Function to check statistics of P-onset times: Control deviation from
median (maximum adjusted deviation = dttolerance) and apply pseudo-
@ -840,9 +840,9 @@ def checkPonsets(pickdic, dttolerance, iplot=0, fig_dict=None):
return
# get pseudo variances smaller than average variances
# (times safety factor), these picks passed jackknife test
ij = np.where(PHI_pseudo <= 5 * xjack)
ij = np.where(PHI_pseudo <= jackfactor * xjack)
# these picks did not pass jackknife test
badjk = np.where(PHI_pseudo > 5 * xjack)
badjk = np.where(PHI_pseudo > jackfactor * xjack)
badjkstations = np.array(stations)[badjk]
print("checkPonsets: %d pick(s) did not pass jackknife test!" % len(badjkstations))
print(badjkstations)