dustem_print_params.pro
4.47 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
PRO dustem_print_params,bidon,verbose=verbose
;help,!dustem_params,/str
;** Structure <5f85ea08>, 14 tags, length=5672, data length=5652, refs=1:
; NGRAINS LONG 3
; G0 FLOAT 1.00000e+07
; KEYWORDS STRING 'quiet sdist zdistf tempf'
; GRAINS STRUCT -> <Anonymous> Array[3]
; ISRF STRUCT -> <Anonymous> Array[200]
; QABS POINTER Array[3]
; CALOR POINTER Array[3]
; LAMBDA STRUCT -> <Anonymous> Array[800]
; SIZE POINTER Array[3]
; MIX POINTER Array[3]
; CHRG POINTER Array[3]
; GAS STRUCT -> <Anonymous> Array[1]
; SPIN POINTER Array[3]
; TLS STRUCT -> <Anonymous> Array[3]
;help,*!dustem_fit,/str
;** Structure <689050c8>, 13 tags, length=80, data length=76, refs=1:
; DATA POINTER <NullPointer>
; PARAM_DESCS POINTER <PtrHeapVar4567>
; PARAM_INIT_VALUES
; POINTER <PtrHeapVar4568>
; FIXED_PARAM_DESCS
; POINTER <PtrHeapVar4547>
; FIXED_PARAM_INIT_VALUES
; POINTER <PtrHeapVar4548>
; CHI2 DOUBLE 0.0000000
; RCHI2 DOUBLE 0.0000000
; QCHI2 DOUBLE 0.0000000
; QRCHI2 DOUBLE 0.0000000
; UCHI2 DOUBLE 0.0000000
; URCHI2 DOUBLE 0.0000000
; CURRENT_PARAM_VALUES
; POINTER <PtrHeapVar4569>
; CURRENT_PARAM_ERRORS
; POINTER <NullPointer>
;help,*!dustem_parinfo,/str
;** Structure <6890d878>, 9 tags, length=80, data length=72, refs=1:
; VALUE DOUBLE 1.0000000
; FIXED INT 0
; LIMITED INT Array[2]
; LIMITS DOUBLE Array[2]
; PARNAME STRING '(*!dustem_params).G0'
; RELSTEP FLOAT 0.00000
; STEP FLOAT 0.00000
; MPSIDE INT 0
; TIED STRING ' 0'
message,'=================================================',/info
;stop
message,'======= content of !dustem_fit:',/continue
;=== make a structure for a noce display
N_variable_par=n_elements(*(*!dustem_fit).param_descs)
IF ptr_valid((*!dustem_fit).fixed_param_descs) THEN BEGIN
N_fixed_par=n_elements(*(*!dustem_fit).fixed_param_descs)
ENDIF ELSE BEGIN
N_fixed_par=0
ENDELSE
Npar=N_variable_par+N_fixed_par
one_st={Parameter_name:'',Parameter_init_value:0.D0,Parameter_fixed:0L,status:'',Parameter_fortran_value:la_undef(5)}
st=replicate(one_st,Npar)
status_params=strarr(N_variable_par)
IF N_fixed_par NE 0 THEN BEGIN
status_fixed_params=strarr(N_fixed_par)
fortran_fixed_values=dblarr(N_fixed_par)+la_undef(5)
ENDIF
fortran_values=dblarr(N_variable_par)+la_undef(5)
FOR i=0L,N_variable_par-1 DO BEGIN
status_params[i]=dustem_parameter_description2type((*(*!dustem_fit).param_descs)[i],string_name=string_name)
IF status_params[i] EQ 'FORTRAN' THEN BEGIN
str='fortran_values[i]='+(*(*!dustem_fit).param_descs)[i]
IF keyword_set(verbose) THEN message,'executing '+str,/continue
toto=execute(str)
ENDIF
ENDFOR
FOR i=0L,N_fixed_par-1 DO BEGIN
status_fixed_params[i]=dustem_parameter_description2type((*(*!dustem_fit).fixed_param_descs)[i],string_name=string_name)
IF status_fixed_params[i] EQ 'FORTRAN' THEN BEGIN
str='fortran_fixed_values[i]='+(*(*!dustem_fit).fixed_param_descs)[i]
IF keyword_set(verbose) THEN message,'executing '+str,/continue
toto=execute(str)
ENDIF
ENDFOR
;stop
st[0:N_variable_par-1].Parameter_name=*(*!dustem_fit).param_descs
st[0:N_variable_par-1].Parameter_init_value=*(*!dustem_fit).param_init_values
st[0:N_variable_par-1].Parameter_fixed=0
st[0:N_variable_par-1].status=status_params
st[0:N_variable_par-1].Parameter_fortran_value=fortran_values
IF N_fixed_par NE 0 THEN BEGIN
st[N_variable_par:Npar-1].Parameter_name=*(*!dustem_fit).fixed_param_descs
st[N_variable_par:Npar-1].Parameter_init_value=*(*!dustem_fit).fixed_param_init_values
st[N_variable_par:Npar-1].Parameter_fixed=1
st[N_variable_par:Npar-1].status=status_fixed_params
st[N_variable_par:Npar-1].Parameter_fortran_value=fortran_fixed_values
ENDIF
write_xcat,st,'/tmp/bidon.xcat'
;message,'======= content of !dustem_parinfo:',/continue
;Npar=n_elements(*!dustem_parinfo)
;FOR i=0L,Npar-1 DO BEGIN
; print,(*!dustem_parinfo)[i].parname,(*!dustem_parinfo)[i].value
;ENDFOR
message,'=================================================',/info
END