Blame view

src/idl/dustem_activate_plugins.pro 2.88 KB
01612ee4   Ilyes Choubani   General update: I...
1
PRO dustem_activate_plugins,p_min,help=help,st
4750086c   Ilyes Choubani   nouvelle philosph...
2
3
4
5
6

;+
; NAME:
;    dustem_activate_plugins
; PURPOSE:
01612ee4   Ilyes Choubani   General update: I...
7
;    activates the plugins present in the parameter description vector (pd)
4750086c   Ilyes Choubani   nouvelle philosph...
8
; CATEGORY:
50bb5343   Annie Hughes   minor changes to ...
9
;    DUSTEM Wrapper, Distributed, Mid-Level, Plugins
4750086c   Ilyes Choubani   nouvelle philosph...
10
; CALLING SEQUENCE:
01612ee4   Ilyes Choubani   General update: I...
11
;    dustem_activate_plugins,pd 
4750086c   Ilyes Choubani   nouvelle philosph...
12
; INPUTS:
01612ee4   Ilyes Choubani   General update: I...
13
;    parameter desription vector 
4750086c   Ilyes Choubani   nouvelle philosph...
14
; OPTIONAL INPUT PARAMETERS:
01612ee4   Ilyes Choubani   General update: I...
15
16
;    key  = input parameter number
;    val  = input parameter value
4750086c   Ilyes Choubani   nouvelle philosph...
17
; OUTPUTS:
01612ee4   Ilyes Choubani   General update: I...
18
;    None
4750086c   Ilyes Choubani   nouvelle philosph...
19
20
21
22
23
24
25
26
27
; OPTIONAL OUTPUT PARAMETERS:
;    None
; ACCEPTED KEY-WORDS:
;    help                  = if set, print this help
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; RESTRICTIONS:
50bb5343   Annie Hughes   minor changes to ...
28
29
30
;    The DustEM fortran code must be installed
;    The DustEMWrap idl code must be installed
; PROCEDURES AND SUBROUTINES USED:
01612ee4   Ilyes Choubani   General update: I...
31
32
;    *** COMMENT AH --> is this really NONE? ****
;
50bb5343   Annie Hughes   minor changes to ...
33
; EXAMPLES
01612ee4   Ilyes Choubani   General update: I...
34
;    dustem_activate_plugins, pd
50bb5343   Annie Hughes   minor changes to ...
35
36
37
38
39
;
; MODIFICATION HISTORY:
;    Written by IC Apr-2022
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  
4750086c   Ilyes Choubani   nouvelle philosph...
40
41
42
43
44
45
46
47
48
;-


IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_activate_plugins'
  goto,the_end
  output=0.
ENDIF

e7938fa3   Ilyes Choubani   Corrected02: Impl...
49
p_dim = p_min * (*(*!dustem_fit).param_init_values)
e7938fa3   Ilyes Choubani   Corrected02: Impl...
50

01612ee4   Ilyes Choubani   General update: I...
51
52
53
54



;THISIS USED TO ACCOUNT FOR THE FREEZING OF PLUGIN PARAMETERS
3c479f24   Ilyes Choubani   Allowing to fix p...
55
56
57
58
if isa((*!dustem_fit).fixed_param_descs) then begin

    ;concatenating the parameter vectors
    param_descs =  [(*(*!dustem_fit).param_descs),(*(*!dustem_fit).fixed_param_descs)]  
3c479f24   Ilyes Choubani   Allowing to fix p...
59
60
    param_values = [p_dim,(*(*!dustem_fit).fixed_param_init_values)]
    param_values = param_values(sort(param_descs)) ;should we put it back to the way it was?
1bc09467   Ilyes Choubani   fixed issue with ...
61
    param_descs = param_descs(sort(param_descs))
3c479f24   Ilyes Choubani   Allowing to fix p...
62
63
64
65
66
67
68
69
70
71
72
73
74
75
        ;Taking care of the param_func vector
    dustem_set_func_ind, param_descs, param_values ; this sets  (*(*!dustem_fit).param_func)
    param_func = (*(*!dustem_fit).param_func)
    dustem_set_func_ind, (*(*!dustem_fit).param_descs), p_dim ;setting the pointers back to their original valyes 
    
endif else begin
    
    param_descs = (*(*!dustem_fit).param_descs)
    param_values = p_dim
    param_func = (*(*!dustem_fit).param_func)

endelse


0068116a   Ilyes Choubani   General update + ...
76

01612ee4   Ilyes Choubani   General update: I...
77
;PART WHERE THE PLUGINS RUN ACCORDING TO THEIR SCOPES. 
0068116a   Ilyes Choubani   General update + ...
78

01612ee4   Ilyes Choubani   General update: I...
79
;help section on the way 
0068116a   Ilyes Choubani   General update + ...
80

01612ee4   Ilyes Choubani   General update: I...
81
82
83
;normal (additive) plugins come first as they can be used by other plugins 
;The ISRF plugin is next - we can always change its scope however we please to. DustEm runs here. This is with the /dustem_run keyword. 
;The plugins that use the DustEM output come next - we can always change their 'common' scope 
0068116a   Ilyes Choubani   General update + ...
84

01612ee4   Ilyes Choubani   General update: I...
85
86
87
88
89
;IF /avoid is used the specified scopes are avoided. They're considered when /avoid is missing.
dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['*STELLAR*','*REPLACE*'], /avoid ;/dustem_run
dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['*STELLAR*'] ,/dustem_run;, avoid=avoid
dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['*REPLACE*'] ;,/dustem_run;, avoid=avoid
stop
0068116a   Ilyes Choubani   General update + ...
90
91


4750086c   Ilyes Choubani   nouvelle philosph...
92
the_end:
e7938fa3   Ilyes Choubani   Corrected02: Impl...
93

4750086c   Ilyes Choubani   nouvelle philosph...
94
END