1 Star 0 Fork 4

钟涛/Shack-Hartmann-Simulator_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
zernike.m 1010 Bytes
一键复制 编辑 原始数据 按行查看 历史
SergioBonaqueGonzalez 提交于 2017-03-01 14:04 . Update zernike.m
function zz = zernike(j, dim)
%Created by Sergio Bonaque-Gonzalez. Optical Engineer.
% This function creates Zernike Coefficients.
temp = zeros(dim, dim);
xx = zeros(dim, dim);
yy = zeros(dim, dim);
tdim = dim / 2.;
for i = 1:dim
for p = 1:dim
xx(i, p) = p - 1 - tdim;
yy(i, p) = i - 1 - tdim;
end
end
tdim = (dim / 2) - 1;
ro = realsqrt((xx .* xx) + (yy .* yy)) ./ tdim;
teta = atan2(yy, xx);
[n, m] = indice(j);
mask = mascaraCircular(1,dim);
if (m == 0)
temp = realsqrt(n + 1) .* zer_rad(ro, n, m) .* mask;
end
if (m ~= 0)
if (paridad(j) == true)
temp = realsqrt((2 * n) + 2) .* zer_rad(ro, n, m) .* cos(m .* teta) .* mask;
end
if (paridad(j) == false)
temp = realsqrt((2 * n) + 2) .* zer_rad(ro, n, m) .* sin(m .* teta) .* mask;
end
end
zz = temp;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/aaron_zhong/Shack-Hartmann-Simulator_1.git
[email protected]:aaron_zhong/Shack-Hartmann-Simulator_1.git
aaron_zhong
Shack-Hartmann-Simulator_1
Shack-Hartmann-Simulator_1
master

搜索帮助