Blame view

src/idl/dustem_create_functions.pro 1.16 KB
427f1205   Jean-Michel Glorian   version 4.2 merged
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
PRO dustem_create_functions,p_min,cont=cont,res=res

p_dim = p_min * (*(*!dustem_fit).param_init_values)

f=1
FOR i=0L,n_elements(p_min)-1 DO BEGIN
   IF ((*(*!dustem_fit).param_func)(i) NE 0.) THEN BEGIN
        ftn = strmid((*(*!dustem_fit).param_descs)(i), 0, strlen((*(*!dustem_fit).param_descs)(i))-2)
        tmp = (where(*(*!dustem_fit).param_func eq f, count))
        PDO_tmp = (*(*!dustem_fit).param_descs)(tmp)
        p_dim_tmp = p_dim(tmp)
        index = fltarr(count) & value = fltarr(count)
        FOR k=0, count-1 DO BEGIN
           index(k) = strmid(PDO_tmp(k),0,1,/REV )
           value(k) = p_dim_tmp(k)
        ENDFOR
        IF ftn EQ 'dustem_create_ionfrac' THEN BEGIN
           key_ionfrac=index
           val_ionfrac=value
        ENDIF
        IF ftn NE 'dustem_create_continuum' THEN BEGIN
           str='res='+ftn+'(key=index,val=value)'
           toto=execute(str)
           IF !dustem_verbose NE 0 THEN message,str,/info
        ENDIF ELSE BEGIN
           str='cont='+ftn+'(key=index,val=value)'
           toto=execute(str)
           IF !dustem_verbose NE 0 THEN message,str,/info
        ENDELSE
        f=f+1 & i=i+count-1
  ENDIF
ENDFOR

END