owperiodogram.py 文件源码

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

项目:orange3-timeseries 作者: biolab 项目源码 文件源码
def periodogram(self, attr):
        is_equispaced = self.data.time_delta is not None
        if is_equispaced:
            x = np.ravel(self.data.interp(attr))
            periods, pgram = periodogram_equispaced(x)
            # TODO: convert periods into time_values-relative values, i.e.
            # periods *= self.data.time_delta; like lombscargle already does
            # periods *= self.data.time_delta
        else:
            times = np.asanyarray(self.data.time_values, dtype=float)
            x = np.ravel(self.data[:, attr])
            # Since lombscargle works with explicit times,
            # we can skip any nan values
            nonnan = ~np.isnan(x)
            if not nonnan.all():
                x, times = x[nonnan], times[nonnan]

            periods, pgram = periodogram_nonequispaced(times, x)
        return periods, pgram
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号