提交 3f0a62c1 编辑于 作者: Mijian Xu's avatar Mijian Xu 😷
浏览文件

fix bug in smooth

上级 7765a966
......@@ -372,7 +372,7 @@ class RF(object):
criterion = None
else:
pass
drop_lst = []
good_lst = []
self.logger.RFlog.info('Save RFs with criterion of {}'.format(criterion))
for i, row in self.eqs.iterrows():
......@@ -380,9 +380,8 @@ class RF(object):
row['data'].saverf(self.para.rfpath, evtstr=row['date'].strftime('%Y.%j.%H.%M.%S'), phase=self.para.phase, shift=shift,
evla=row['evla'], evlo=row['evlo'], evdp=row['evdp'], baz=row['bazi'],
mag=row['mag'], gcarc=row['dis'], gauss=self.para.gauss, only_r=self.para.only_r)
else:
drop_lst.append(i)
self.eqs.drop(drop_lst)
good_lst.append(i)
self.eqs = self.eqs.ix[good_lst]
def prf():
......
......@@ -52,7 +52,7 @@ def smooth(x, half_len=5, window='flat'):
if window == 'flat': #moving average
w = np.ones(window_len,'d')
else:
w = eval('numpy.'+window+'(window_len)')
w = eval('np.'+window+'(window_len)')
y = np.convolve(w/w.sum(), s, mode='valid')
return y[half_len:-half_len]
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册