Periodicity.py 文件源码

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

项目:PyPeVoc 作者: goiosunsw 项目源码 文件源码
def plot_candidates(self):
        """Plot a representation of candidate periodicity

        Size gives the periodicity strength, 
        color the order of preference
        """

        fig, ax = pl.subplots(2, sharex=True)

        hues = np.arange(self.ncand)/float(self.ncand)
        hsv = np.swapaxes(np.atleast_3d([[hues, np.ones(len(hues)),
                                          np.ones(len(hues))]]), 1, 2)
        cols = hsv_to_rgb(hsv).squeeze()

        for per in self.periods:
            nc = len(per.cand_period)

            ax[0].scatter(per.time*np.ones(nc), per.cand_period,
                          s=per.cand_strength*100,
                          c=cols[0:nc], alpha=.5)

        ax[0].plot(*zip(*[[per.time, float(per.get_preferred_period())]
                        for per in self.periods]), color='k')

        ax[1].plot(self.get_times(), self.get_strength())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号