def rnm(n,m,rho):
"""
Return an array with the zernike Rnm polynomial calculated at rho points.
"""
Rnm=zeros(rho.shape)
S=(n-abs(m))/2
for s in range (0,S+1):
CR=pow(-1,s)*factorial(n-s)/ \
(factorial(s)*factorial(-s+(n+abs(m))/2)* \
factorial(-s+(n-abs(m))/2))
p=CR*pow(rho,n-2*s)
Rnm=Rnm+p
Rnm[rho>1.0] = 0
return Rnm
评论列表
文章目录