geco_slow_channel_plot.py 文件源码

python
阅读 61 收藏 0 点赞 0 评论 0

项目:geco_data 作者: stefco 项目源码 文件源码
def trend(self):
        """Subtract the trend specified in
        ``Plotter.plot_properties['detrend']`` from each plot. Trend can be 
        the 'mean' value of the plot, the 'linear' least squares best fit, a
        custom-specified number, or simply 'none' if no trend should be
        removed."""
        if self.plot_properties['detrend'] == 'mean':
            # delete bad indices before calculating the trend, since they
            # can skew the trend.
            cleandata = np.delete(self.plot_vars.means, self.bad_indices.means)
            if len(cleandata) != 0:
                trend = cleandata.mean()
            else:
                trend = 0
        elif self.plot_properties['detrend'] == 'none':
            trend = 0
        elif self.plot_properties['detrend'] == 'linear':
            trend, driftcoeff, linregress = self.linregress
        else:
            trend = self.plot_properties['detrend']
        return trend
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号