dustem_init_plugins.pro
2.55 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
PRO dustem_init_plugins, pd
;DEFINING THE SCOPES--------------------
varvar=create_struct('varvar',ptr_new())
for i=0L,n_elements(pd)-1 do begin
fi=strtrim(strmid(pd(i),0,6),2)
test=(n_tags(varvar) eq 1 && tag_exist(varvar,'varvar'))
if fi eq 'dustem' then begin
fii=strtrim(strmid(pd(i),14,4),2)
j=0L
if i eq 0 then j+=2
trl=fii eq strtrim(strmid(pd(i+j-1),14,4),2)
case fii of ;TESTING ON THE 4 FIRST LETTERS OF THE PLUGIN'S NAME
;starting a fresh structure or appending to a pre-existing one
'cont': begin
plugin_name='CONTINUUM' ; THIS STRING SHOULD MATCH THE NAME OF THE PLUGIN IN THE SCOPE LINE OF THE PLUGIN FUNCTION
if test && (~trl) then varvar=create_struct(plugin_name,'ADD_SED')
if (~test) && (~trl) then varvar=create_struct(varvar,plugin_name,'ADD_SED')
print, varvar
end
'sync': begin
plugin_name='SYNCHROTRON'
if test && (~trl) then varvar=create_struct(plugin_name,'ADD_SED+ADD_POLSED')
if (~test) && (~trl) then varvar=create_struct(varvar,plugin_name,'ADD_SED+ADD_POLSED')
end
'free': begin
plugin_name='FREE_FREE'
if test && (~trl) then varvar=create_struct(plugin_name,'ADD_SED')
if (~test) && (~trl) then varvar=create_struct(varvar,plugin_name,'ADD_SED')
end
'stok': begin
plugin_name='STOKES'
if test && (~trl) then varvar=create_struct(plugin_name,'MODIFY'); plugin that allows the computation of Q_sed and U_sed and fitting of PSI_dust and PSI_synch
if (~test) && (~trl) then varvar=create_struct(varvar,plugin_name,'MODIFY')
end
'stex':begin
print,'found'
plugin_name='STEXT' ;'stokes'+extinction
if test && (~trl) then varvar=create_struct(plugin_name,'MODIFY') ; plugin that allows the computation of Q_ext = sigext_q and U_ext=sigext_u and fitting of PSI_ext
if (~test) && (~trl) then varvar=create_struct(varvar,plugin_name,'MODIFY')
print, varvar
end
;NEW PLUGIN TO BE ADDED HERE
endcase
endif
endfor
test=(n_tags(varvar) eq 1 && tag_exist(varvar,'varvar'))
if test then varvar=create_struct('varvar','NULL')
defsysv, '!dustem_scope', ptr_new(varvar)
;---------------------------------------------
;INITIALIZING THE PLUGIN DATA ARRAYS----------
tgnms=tag_names(varvar)
for i=0L, n_tags(varvar)-1 do begin
if i eq 0 then strct= create_struct(tgnms(i),ptr_new())
if i ge 1 then strct= create_struct(strct, tgnms(i),ptr_new())
endfor
defsysv, '!dustem_plugin', ptr_new(strct) ; structure that will contain the spectra associated to each plugin
;---------------------------------------------
end