polar.py 文件源码

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

项目:Dragonfly 作者: duaneloh 项目源码 文件源码
def compute_ang_corr(self, input_frame, normed=True, ang_max=10):
        """Compute the angular correlation from the polar representation of given pattern

        Arguments:
            polar_arr (array) - Polar data array (usually output of convert())
            normed (bool, optional) - Whether to normalize Fourier transform in each radial bin
            ang_max (float, optional) - How many Fourier components to keep

        Returns:
            ang_corr (array) - Angular correlations for each input bin
        """
        polar_arr = self.compute_polar(input_frame)
        ang_corr = np.array([a - a.mean() for a in polar_arr])
        temp = []
        for a in ang_corr:
            if normed:
                la = np.linalg.norm(a)
                if la > 0.:
                    temp.append(np.absolute(np.fft.fft(a/la))[1:ang_max])
                else:
                    temp.append(np.zeros(ang_max-1))
            else:
                temp.append(np.absolute(np.fft.fft(a))[1:ang_max])
        return np.array(temp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号