Merge branch 'develop' of ariadne:/data/git/pylot into develop
This commit is contained in:
commit
5115705c4e
@ -365,10 +365,10 @@ def getSNR(X, TSNR, t1, tracenum=0):
|
|||||||
x = x - np.mean(x[inoise])
|
x = x - np.mean(x[inoise])
|
||||||
|
|
||||||
# calculate ratios
|
# calculate ratios
|
||||||
# noiselevel = np.sqrt(np.mean(np.square(x[inoise])))
|
noiselevel = np.sqrt(np.mean(np.square(x[inoise])))
|
||||||
# signallevel = np.sqrt(np.mean(np.square(x[isignal])))
|
#signallevel = np.sqrt(np.mean(np.square(x[isignal])))
|
||||||
|
|
||||||
noiselevel = np.abs(x[inoise]).max()
|
#noiselevel = np.abs(x[inoise]).max()
|
||||||
signallevel = np.abs(x[isignal]).max()
|
signallevel = np.abs(x[isignal]).max()
|
||||||
|
|
||||||
SNR = signallevel / noiselevel
|
SNR = signallevel / noiselevel
|
||||||
@ -480,18 +480,21 @@ def select_for_phase(st, phase):
|
|||||||
:type phase: str
|
:type phase: str
|
||||||
:return:
|
:return:
|
||||||
'''
|
'''
|
||||||
from pylot.core.util.defaults import COMPNAME_MAP
|
from pylot.core.util.defaults import SetChannelComponents
|
||||||
|
|
||||||
sel_st = Stream()
|
sel_st = Stream()
|
||||||
|
compclass = SetChannelComponents()
|
||||||
if phase.upper() == 'P':
|
if phase.upper() == 'P':
|
||||||
comp = 'Z'
|
comp = 'Z'
|
||||||
alter_comp = COMPNAME_MAP[comp]
|
alter_comp = compclass.getCompPosition(comp)
|
||||||
|
alter_comp = str(alter_comp[0])
|
||||||
sel_st += st.select(component=comp)
|
sel_st += st.select(component=comp)
|
||||||
sel_st += st.select(component=alter_comp)
|
sel_st += st.select(component=alter_comp)
|
||||||
elif phase.upper() == 'S':
|
elif phase.upper() == 'S':
|
||||||
comps = 'NE'
|
comps = 'NE'
|
||||||
for comp in comps:
|
for comp in comps:
|
||||||
alter_comp = COMPNAME_MAP[comp]
|
alter_comp = compclass.getCompPosition(comp)
|
||||||
|
alter_comp = str(alter_comp[0])
|
||||||
sel_st += st.select(component=comp)
|
sel_st += st.select(component=comp)
|
||||||
sel_st += st.select(component=alter_comp)
|
sel_st += st.select(component=alter_comp)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user