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

fix trim with return

上级 be581fa5
......@@ -231,12 +231,15 @@ class eq(object):
self.t_trigger = t1 + n_trigger/df
self.trigger_shift = n_trigger/df - time_before
def trim(self, time_before, time_after, phase='P'):
def trim(self, time_before, time_after, phase='P', isreturn=False):
"""
offset = sac.b - real o
"""
t1, t2 = self._get_time(time_before, time_after, phase)
self.st.trim(t1, t2)
if isreturn:
return self.st.copy().trim(t1, t2)
else:
self.st.trim(t1, t2)
def deconvolute(self, shift, time_after, f0=2, phase='P', method='iter', only_r=False, itmax=400, minderr=0.001, wlevel=0.05, target_dt=None):
self.rf = self.st.copy()
......
......@@ -320,13 +320,14 @@ class RF(object):
self.eqs.insert(1, 'data', eqs)
def channel_correct(self, switchEN=False, reverseE=False, reverseN=False):
self.logger.RFlog.info('Correct components with switchEN: {}, reverseE: {}, reverseN: {}'.format(switchEN, reverseE, reverseN))
self.para.switchEN = switchEN
self.para.reverseE = reverseE
self.para.reverseN = reverseN
for _, row in self.eqs.iterrows():
row['data'].channel_correct(switchEN, reverseE, reverseN)
if switchEN or reverseN or reverseE:
self.logger.RFlog.info('Correct components with switchEN: {}, reverseE: {}, reverseN: {}'.format(switchEN, reverseE, reverseN))
for _, row in self.eqs.iterrows():
row['data'].channel_correct(switchEN, reverseE, reverseN)
def detrend(self):
self.logger.RFlog.info('Detrend all data')
drop_idx = []
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册