Blame view

src/idl/dustem_set_params.pro 1.19 KB
427f1205   Jean-Michel Glorian   version 4.2 merged
1
2
3
PRO dustem_set_params,params

;if empty description, do nothing
68d2f391   Jean-Philippe Bernard   modified to cope ...
4
5
6
7
8
9
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
10
11
12
13
14

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

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

427f1205   Jean-Michel Glorian   version 4.2 merged
15
16
;SET THE PARAMETER VALUES IN DUSTEM INPUT FILES
FOR i=0L,Nparams-1 DO BEGIN
5f04fa07   Ilyes Choubani   general update
17
    
0e608856   Jean-Philippe Bernard   improved
18
19
   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
20
   
0e608856   Jean-Philippe Bernard   improved
21
22
23
24
25
26
27
   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...
28
        str=(*(*!dustem_fit).param_descs)(i)+'=params[i]';'=params['+strtrim(string(i),2)+']'
0e608856   Jean-Philippe Bernard   improved
29
30
31
        toto=execute(str)
        IF !dustem_verbose NE 0 THEN message,str,/info
    END
0068116a   Ilyes Choubani   General update + ...
32
33
34
35
36
    'PLUGIN': BEGIN 
    
    ;Not to be used for the moment.
    
          
4750086c   Ilyes Choubani   nouvelle philosph...
37
        
0e608856   Jean-Philippe Bernard   improved
38
39
    END
   ENDCASE
4fd64cbb   Ilyes Choubani   dustem_fit_sed_po...
40
41
42



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

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

427f1205   Jean-Michel Glorian   version 4.2 merged
47
48
49
the_end:

END