reformatting code to avoid mixing up whitespace and tabulator characters
This commit is contained in:
parent
76f04bec6f
commit
29de650b4e
@ -14,6 +14,7 @@ import numpy as np
|
||||
from pylot.core.pick.Picker import *
|
||||
from pylot.core.pick.CharFuns import *
|
||||
|
||||
|
||||
def run_autopicking(wfstream, pickparam):
|
||||
"""
|
||||
:param: wfstream
|
||||
@ -163,7 +164,8 @@ def run_autopicking(wfstream, pickparam):
|
||||
if aicpick.getpick() is not None:
|
||||
# check signal length to detect spuriously picked noise peaks
|
||||
z_copy[0].data = tr_filt.data
|
||||
Pflag = checksignallength(z_copy, aicpick.getpick(), tsnrz, minsiglength, \
|
||||
Pflag = checksignallength(z_copy, aicpick.getpick(), tsnrz,
|
||||
minsiglength, \
|
||||
nfacsl, minpercent, iplot)
|
||||
if Pflag == 1:
|
||||
# check for spuriously picked S onset
|
||||
@ -175,9 +177,11 @@ def run_autopicking(wfstream, pickparam):
|
||||
# filter and taper horizontal traces
|
||||
trH1_filt = edat.copy()
|
||||
trH2_filt = ndat.copy()
|
||||
trH1_filt.filter('bandpass', freqmin=bph1[0], freqmax=bph1[1], \
|
||||
trH1_filt.filter('bandpass', freqmin=bph1[0],
|
||||
freqmax=bph1[1], \
|
||||
zerophase=False)
|
||||
trH2_filt.filter('bandpass', freqmin=bph1[0], freqmax=bph1[1], \
|
||||
trH2_filt.filter('bandpass', freqmin=bph1[0],
|
||||
freqmax=bph1[1], \
|
||||
zerophase=False)
|
||||
trH1_filt.taper(max_percentage=0.05, type='hann')
|
||||
trH2_filt.taper(max_percentage=0.05, type='hann')
|
||||
@ -234,7 +238,8 @@ def run_autopicking(wfstream, pickparam):
|
||||
if mpickP is not None:
|
||||
# quality assessment
|
||||
# get earliest and latest possible pick and symmetrized uncertainty
|
||||
[lpickP, epickP, Perror] = earllatepicker(z_copy, nfacP, tsnrz, mpickP, iplot)
|
||||
[lpickP, epickP, Perror] = earllatepicker(z_copy, nfacP, tsnrz,
|
||||
mpickP, iplot)
|
||||
|
||||
# get SNR
|
||||
[SNRP, SNRPdB, Pnoiselevel] = getSNR(z_copy, tsnrz, mpickP)
|
||||
@ -408,10 +413,12 @@ def run_autopicking(wfstream, pickparam):
|
||||
# quality assessment
|
||||
# get earliest and latest possible pick and symmetrized uncertainty
|
||||
h_copy[0].data = trH1_filt.data
|
||||
[lpickS1, epickS1, Serror1] = earllatepicker(h_copy, nfacS, tsnrh,
|
||||
[lpickS1, epickS1, Serror1] = earllatepicker(h_copy, nfacS,
|
||||
tsnrh,
|
||||
mpickS, iplot)
|
||||
h_copy[0].data = trH2_filt.data
|
||||
[lpickS2, epickS2, Serror2] = earllatepicker(h_copy, nfacS, tsnrh,
|
||||
[lpickS2, epickS2, Serror2] = earllatepicker(h_copy, nfacS,
|
||||
tsnrh,
|
||||
mpickS, iplot)
|
||||
if algoS == 'ARH':
|
||||
# get earliest pick of both earliest possible picks
|
||||
@ -544,19 +551,24 @@ def run_autopicking(wfstream, pickparam):
|
||||
if aicSflag == 1:
|
||||
p23, = plt.plot(arhcf2.getTimeArray(),
|
||||
arhcf2.getCF() / max(arhcf2.getCF()), 'm')
|
||||
p24, = plt.plot([aicarhpick.getpick(), aicarhpick.getpick()],
|
||||
p24, = plt.plot(
|
||||
[aicarhpick.getpick(), aicarhpick.getpick()],
|
||||
[-1, 1], 'g')
|
||||
plt.plot(
|
||||
[aicarhpick.getpick() - 0.5, aicarhpick.getpick() + 0.5],
|
||||
[aicarhpick.getpick() - 0.5,
|
||||
aicarhpick.getpick() + 0.5],
|
||||
[1, 1], 'g')
|
||||
plt.plot(
|
||||
[aicarhpick.getpick() - 0.5, aicarhpick.getpick() + 0.5],
|
||||
[aicarhpick.getpick() - 0.5,
|
||||
aicarhpick.getpick() + 0.5],
|
||||
[-1, -1], 'g')
|
||||
p25, = plt.plot([refSpick.getpick(), refSpick.getpick()],
|
||||
[-1.3, 1.3], 'g', linewidth=2)
|
||||
plt.plot([refSpick.getpick() - 0.5, refSpick.getpick() + 0.5],
|
||||
plt.plot(
|
||||
[refSpick.getpick() - 0.5, refSpick.getpick() + 0.5],
|
||||
[1.3, 1.3], 'g', linewidth=2)
|
||||
plt.plot([refSpick.getpick() - 0.5, refSpick.getpick() + 0.5],
|
||||
plt.plot(
|
||||
[refSpick.getpick() - 0.5, refSpick.getpick() + 0.5],
|
||||
[-1.3, -1.3], 'g', linewidth=2)
|
||||
plt.plot([lpickS, lpickS], [-1.1, 1.1], 'g--')
|
||||
plt.plot([epickS, epickS], [-1.1, 1.1], 'g--')
|
||||
@ -591,19 +603,24 @@ def run_autopicking(wfstream, pickparam):
|
||||
if aicSflag == 1:
|
||||
p23, = plt.plot(arhcf2.getTimeArray(),
|
||||
arhcf2.getCF() / max(arhcf2.getCF()), 'm')
|
||||
p24, = plt.plot([aicarhpick.getpick(), aicarhpick.getpick()],
|
||||
p24, = plt.plot(
|
||||
[aicarhpick.getpick(), aicarhpick.getpick()],
|
||||
[-1, 1], 'g')
|
||||
plt.plot(
|
||||
[aicarhpick.getpick() - 0.5, aicarhpick.getpick() + 0.5],
|
||||
[aicarhpick.getpick() - 0.5,
|
||||
aicarhpick.getpick() + 0.5],
|
||||
[1, 1], 'g')
|
||||
plt.plot(
|
||||
[aicarhpick.getpick() - 0.5, aicarhpick.getpick() + 0.5],
|
||||
[aicarhpick.getpick() - 0.5,
|
||||
aicarhpick.getpick() + 0.5],
|
||||
[-1, -1], 'g')
|
||||
p25, = plt.plot([refSpick.getpick(), refSpick.getpick()],
|
||||
[-1.3, 1.3], 'g', linewidth=2)
|
||||
plt.plot([refSpick.getpick() - 0.5, refSpick.getpick() + 0.5],
|
||||
plt.plot(
|
||||
[refSpick.getpick() - 0.5, refSpick.getpick() + 0.5],
|
||||
[1.3, 1.3], 'g', linewidth=2)
|
||||
plt.plot([refSpick.getpick() - 0.5, refSpick.getpick() + 0.5],
|
||||
plt.plot(
|
||||
[refSpick.getpick() - 0.5, refSpick.getpick() + 0.5],
|
||||
[-1.3, -1.3], 'g', linewidth=2)
|
||||
plt.plot([lpickS, lpickS], [-1.1, 1.1], 'g--')
|
||||
plt.plot([epickS, epickS], [-1.1, 1.1], 'g--')
|
||||
|
Loading…
x
Reference in New Issue
Block a user