Blame view

src/idl/dustem_set_params.pro 2.17 KB
041ca6b6   Annie Hughes   updated help
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
PRO dustem_set_params,params,help=help

;+
; NAME:
;    dustem_set_params
;
; PURPOSE:
;    Initialise the *!dustem_fit system variable with the free
;    parameters used in the fit and their general handling by DustEMWrap.
;
; CATEGORY:
;    DustEMWrap, Mid-Level, Distributed, Initialization
;
; CALLING SEQUENCE:
;    dustem_set_params,params[,/help]
;
; INPUTS:
;    params -- free parameters to be used in the fit
;
; OPTIONAL INPUT PARAMETERS:
;
; OUTPUTS:
;    None
;
; OPTIONAL OUTPUT PARAMETERS:
;    None
;
; ACCEPTED KEY-WORDS:
;    help      = If set print this help
;
; COMMON BLOCKS:
;    None
;
; SIDE EFFECTS:
;    initializes information in !dustem_fit
;
; RESTRICTIONS:
;    The DustEMWrap IDL code must be installed
; 
; PROCEDURE:
;    None
;
; EXAMPLES
;
; MODIFICATION HISTORY:
;    Written by J.-Ph. Bernard 2007
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  
;-

IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_set_params'
  goto,the_end
ENDIF
427f1205   Jean-Michel Glorian   version 4.2 merged
55
56

;if empty description, do nothing
68d2f391   Jean-Philippe Bernard   modified to cope ...
57
58
59
60
61
62
ind=where(*(*!dustem_fit).param_descs EQ '',count)
IF count EQ n_elements(*(*!dustem_fit).param_descs) THEN BEGIN
  message,'param_descs not set. Doing nothing',/continue
  stop
  goto,the_end
ENDIF
427f1205   Jean-Michel Glorian   version 4.2 merged
63
64
65
66
67

Nparams=n_elements(*(*!dustem_fit).param_descs)

dustem_set_func_ind,*(*!dustem_fit).param_descs,params

427f1205   Jean-Michel Glorian   version 4.2 merged
68
69
;SET THE PARAMETER VALUES IN DUSTEM INPUT FILES
FOR i=0L,Nparams-1 DO BEGIN
5f04fa07   Ilyes Choubani   general update
70
    
0e608856   Jean-Philippe Bernard   improved
71
72
   status=dustem_parameter_description2type((*(*!dustem_fit).param_descs)[i],string_name=string_name)
   IF !dustem_verbose THEN message,(*(*!dustem_fit).param_descs)[i]+' is '+status,/continue
5f04fa07   Ilyes Choubani   general update
73
   
0e608856   Jean-Philippe Bernard   improved
74
75
76
77
78
79
80
   CASE status OF
    'WRAPPER': BEGIN
        str=(*(*!dustem_fit).param_descs)(i)+'=params[i]'
        toto=execute(str)
        IF !dustem_verbose NE 0 THEN message,str,/info
    END
    'FORTRAN': BEGIN
4fd64cbb   Ilyes Choubani   dustem_fit_sed_po...
81
        str=(*(*!dustem_fit).param_descs)(i)+'=params[i]';'=params['+strtrim(string(i),2)+']'
0e608856   Jean-Philippe Bernard   improved
82
83
84
        toto=execute(str)
        IF !dustem_verbose NE 0 THEN message,str,/info
    END
0068116a   Ilyes Choubani   General update + ...
85
86
87
88
89
    'PLUGIN': BEGIN 
    
    ;Not to be used for the moment.
    
          
4750086c   Ilyes Choubani   nouvelle philosph...
90
        
0e608856   Jean-Philippe Bernard   improved
91
92
    END
   ENDCASE
4fd64cbb   Ilyes Choubani   dustem_fit_sed_po...
93
94
95



427f1205   Jean-Michel Glorian   version 4.2 merged
96
ENDFOR
68d2f391   Jean-Philippe Bernard   modified to cope ...
97

427f1205   Jean-Michel Glorian   version 4.2 merged
98
dustem_write_all,*!dustem_params,!dustem_dat
25a9c7a2   Ilyes Choubani   removing stops
99

427f1205   Jean-Michel Glorian   version 4.2 merged
100
101
102
the_end:

END