Blame view

src/idl/dustem_create_functions.pro 1.78 KB
b5ccb706   Jean-Philippe Bernard   improved to fit p...
1
PRO dustem_create_functions,p_min,cont=cont,freefree=freefree,synchrotron=synchrotron,res=res
427f1205   Jean-Michel Glorian   version 4.2 merged
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

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
b5ccb706   Jean-Philippe Bernard   improved to fit p...
21
        IF ftn NE 'dustem_create_continuum' and ftn NE 'dustem_create_freefree' and ftn NE 'dustem_create_synchrotron' THEN BEGIN
427f1205   Jean-Michel Glorian   version 4.2 merged
22
23
24
25
           str='res='+ftn+'(key=index,val=value)'
           toto=execute(str)
           IF !dustem_verbose NE 0 THEN message,str,/info
        ENDIF ELSE BEGIN
b5ccb706   Jean-Philippe Bernard   improved to fit p...
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
          IF ftn EQ 'dustem_create_continuum' THEN BEGIN
            str='cont='+ftn+'(key=index,val=value)'
            toto=execute(str)
            IF !dustem_verbose NE 0 THEN message,str,/info
          ENDIF
          IF ftn EQ 'dustem_create_freefree' THEN BEGIN
            str='freefree='+ftn+'(key=index,val=value)'
            toto=execute(str)
            IF !dustem_verbose NE 0 THEN message,str,/info
          ENDIF
          IF ftn EQ 'dustem_create_synchrotron' THEN BEGIN
            str='synchrotron='+ftn+'(key=index,val=value)'
            toto=execute(str)
            IF !dustem_verbose NE 0 THEN message,str,/info
          ENDIF
427f1205   Jean-Michel Glorian   version 4.2 merged
41
42
43
44
45
46
        ENDELSE
        f=f+1 & i=i+count-1
  ENDIF
ENDFOR

END