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)
评论列表
文章目录