📄 zern_wave.pro
字号:
; $Id: zern_wave.pro,v 1.1.1.1 2002/03/12 11:53:46 riccardi Exp $
;
; A. Riccardi, Dipartimento di Astronomia di Firenze (Italy).
; e-mail address: riccardi@arcetri.astro.it
; Please, send me a message if you modify this code.
function zern_wave, coefficients, indexes, r, theta, INFOS=infos, ASSOC_VAR=zvar
;+
; NAME:
; ZERN_WAVE
;
; PURPOSE:
; ZERN_WAVE constructs the wave front from Zernike components
; stored in coefficients.
;
; CATEGORY:
; Optics.
;
; CALLING SEQUENCE:
;
; Result = ZERN_WAVE(Coefficients, Indexes, R, Theta)
;
; INPUTS:
; Coefficients: vector of coefficients.
;
; Indexes: vector of Zernike polynomial index relative to
; the vector of coefficients
;
; R: matrix. Radius in polar coordinates, where to
; calculate the phase. R must be in pupil radius
; units.
;
; Theta: matrix. azimuth in polar coordinates.
;
; OPTIONAL INPUTS:
; R, Theta: are optional only if variable specified by
; ASSOC_VAR is defined.
; KEYWORDS:
; INFOS: infos structure vector (see ZERN_INFOS). If it is
; defined, info structure is used (faster method).
; ASSOC_VAR: structure variable. The variable, if defined, must be
; associated to a file generated form ZERN_SAVE. The name
; of the variable is usully returned by ZERN_ASSOC. If
; the variable is defined then the routine reads Zernike
; poynomial from the associeted file (fastest method).
; Only in this case R and Theta parameters are optional.
;
; OUTPUTS:
; ZERN_WAVE returns the wave distribution on the pupil with Zernike
; components from Coefficients. Wave distribution is in wave-length units.
;
; MODIFICATION HISTORY:
; Written by: A. Riccardi; April, 1995.
; July, 1995 ASSOC_VAR keyword added.
;-
; if assoc_var keyword is defined
if (n_elements(zvar) gt 0) then begin
wave = zern_symm(zvar(0))
wave(*) = 0.
for j = n_elements(coefficients)-1,0,-1 do begin
ztemp = zvar(indexes(j))
ztemp.poly = ztemp.poly * coefficients(j)
wave = wave + zern_symm(ztemp)
endfor
return, wave
endif
wave=r
wave(*)=0.
; if infos keyword is defined
if (n_elements(infos) gt 0) then begin
for j = n_elements(coefficients)-1,0,-1 do $
wave = wave + coefficients(j)*zern_ipolar(infos(indexes(j)-1), r, theta)
return, wave
endif
for j = n_elements(coefficients)-1,0,-1 do $
wave = wave + coefficients(j)*zern_polar(indexes(j), r, theta)
return, wave
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -