Blame view

src/idl/dustem_set_params.pro 1.53 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
15
16
17
18
19

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

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

;SET THE PARAMETER VALUES IN DUSTEM INPUT FILES
FOR i=0L,Nparams-1 DO BEGIN
   IF (*(*!dustem_fit).param_func)(i) EQ 0 THEN BEGIN
     str=(*(*!dustem_fit).param_descs)(i)+'=params(i)'
     toto=execute(str)
68d2f391   Jean-Philippe Bernard   modified to cope ...
20
     ;print,params[i]
427f1205   Jean-Michel Glorian   version 4.2 merged
21
22
23
24
25
     IF !dustem_verbose NE 0 THEN message,str,/info
   ENDIF ELSE BEGIN
     length=strlen((*(*!dustem_fit).param_descs)(i))
     strr=strmid((*(*!dustem_fit).param_descs)(i),14,length-16)
;     stop
b5ccb706   Jean-Philippe Bernard   improved to fit p...
26
     IF strr NE 'continuum' AND strr NE 'freefree' AND strr NE 'synchrotron' THEN BEGIN   ;This is not very clean programming ....
427f1205   Jean-Michel Glorian   version 4.2 merged
27
       IF strr eq 'isrf2' then strr = 'isrf'
427f1205   Jean-Michel Glorian   version 4.2 merged
28
       IF !dustem_which EQ 'VERSTRAETE' THEN BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
29
30
         ddir=!dustem_dat+'les_DAT/'
       ENDIF ELSE BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
31
32
33
34
35
36
37
38
39
40
41
42
         ddir=!dustem_dat
       ENDELSE
;      JPB: Caution this line reads ISRF.DAT through an execute statement
       str='(*!dustem_params).'+strr+'=dustem_read_'+strr+'('+"'"+ddir+strupcase(strr)+'.DAT'+"'"+',/silent)'
       toto=execute(str)
       IF toto NE 1 then BEGIN
         message,'Could not execute ',str
       ENDIF
       IF !dustem_verbose NE 0 THEN message,str,/info
     ENDIF
  ENDELSE
ENDFOR
68d2f391   Jean-Philippe Bernard   modified to cope ...
43

427f1205   Jean-Michel Glorian   version 4.2 merged
44
45
46
47
48
dustem_write_all,*!dustem_params,!dustem_dat

the_end:

END