-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlegpcrt.pro
40 lines (32 loc) · 974 Bytes
/
legpcrt.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
; Copyright (C) 1998-2017 University of Oxford
;
; This source code is licensed under the GNU General Public License (GPL),
; Version 3. See the file COPYING for more details.
pro legpcrt, Inlc, lc, Inp, qv, phase
; Inlc = Number of Legendre coefficient
; lc = Legendre coefficients
; Inp = Number of quadrature value=number of angles
; qv = cos(angles)
; phase = Recomputed phase function
; Imaxnp = 1100
Imaxnp = 20000
phase = dblarr(Inp)
lpn = dblarr(Imaxnp)
lpmn1 = dblarr(Imaxnp)
lpmn2 = dblarr(Imaxnp)
for i = 0, Inp - 1 do begin
N = 0
lpmn2(i) = 1d0
phase(i) = lc(N)
N = 1
lpmn1(i) = qv(i)
phase(i) = phase(i)+lc(N)*lpmn1(i)
for N = 2, Inlc - 1 do begin
lpn(i) = ((2*N-1)*qv(i)*lpmn1(i)-(N-1)*lpmn2(i))/N
phase(i) = phase(i)+lc(N)*lpn(i)
lpmn2(i) = lpmn1(i)
lpmn1(i) = lpn(i)
endfor
endfor
return
end