geco_slow_channel_plot.py 文件源码

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

项目:geco_data 作者: stefco 项目源码 文件源码
def linregress(self):
        """Get the linear regression of the mean values in this plot. Returns
        a tuple containing the best-fit line y-values for this plotter's
        t_axis, the drift coefficient, and the ``linregress`` named tuple from
        scipy.stats.linregress."""
        cleandata  = np.delete(self.plot_vars.means, self.bad_indices.means)
        cleantimes = np.delete(self.t_axis, self.bad_indices.means)
        if len(cleandata) != 0:
            r = scipy.stats.linregress(cleantimes, cleandata)
            bestfit = r.slope * self.t_axis + r.intercept
            driftcoeff = r.slope / SEC_PER[self.t_units]
        else:
            bestfit = 0
            driftcoeff = 0
            r = None
        return self.LinRegress(bestfit=bestfit, driftcoeff=driftcoeff,
                               linregress=r)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号