-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextract_transform.pro
More file actions
78 lines (65 loc) · 2.82 KB
/
extract_transform.pro
File metadata and controls
78 lines (65 loc) · 2.82 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
function extract_transform,vertex,magt,maxlvar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Purpose: Called by harmonic_trypoint to copy the non-zero ;;
;; elements of a harmonic transform from a comp- ;;
;; ressed vector. The size of the transform and ;;
;; any elements of the transform not included in ;;
;; the vector are copied from the variable magt ;;
;; ;;
;; Inputs: vertex - compressed vector, a vertex from the simp-;;
;; lex created by harmonic amoeba ;;
;; magt - spherical transform on which vertex is based;;
;; maxlvar - largest l value for which vertex contains;;
;; values ;;
;; ;;
;; Returns: an array of the same size as magt, which the first;;
;; maxlvar columns comprised of values from vertex ;;
;; and the remainder (if any) of values from magt ;;
;; ;;
;; Keywords: none ;;
;; ;;
;; Dependencies: none ;;
;; ;;
;; Created: 03/20/15 ;;
;; ;;
;; Created by: Shaela Jones ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; initializations
;halfway=N_ELEMENTS(vertex)/2
szmagt=SIZE(magt)
lmax=szmagt[1]
; set equal to original transform
newmagt=magt
; replace altered values
numalteredreals=0.5*((maxlvar+1)^2.+maxlvar+1)-1 ; -1 is for [0,0] value, which is left out
realvert=vertex[0:numalteredreals-1]
imagvert=0D
realreadpt=0
imagreadpt=numalteredreals
for i=1,maxlvar do begin
imagvert=[0.,vertex[imagreadpt:imagreadpt+i-1]]
newmagt[i,0:i]=COMPLEX(vertex[realreadpt:realreadpt+i],imagvert)
realreadpt=realreadpt+i+1
imagreadpt=imagreadpt+i
endfor
;realreadpt=0
;imagreadpt=numalteredreals
;for i=1,maxlvar do begin
; realpart=vertex[realreadpt:realreadpt+1]
; imagpart=[0.,vertex[imagreadpt:imagreadpt+i-1]]
; newmagt[i,0:i]=COMPLEX(realpart,imagpart)
;endfor
; re-combine real and imaginary parts
;newmagvec=COMPLEX(vertex[0:halfway-1],vertex[halfway:*])
;; sort columns
;newmagt=magt
;readpt=0
;for i=1,maxlvar do begin
; newmagt[i,0:i]=newmagvec[readpt:readpt+i]
; readpt=readpt+i+1
;endfor
;if maxlvar ne lmax then newmagt[maxlvar:*,*]=magt[maxlvar:*,*]
return,newmagt
end