Commit be96d5ee65761c011ded70db96c7c987fd8e5dfb
1 parent
54f8eed5
Exists in
master
saved dustem_params and nocheck keyword to integral for gdl users
Showing
1 changed file
with
12 additions
and
5 deletions
Show diff stats
src/idl/dustem_plugin_dl07_isrf_model.pro
... | ... | @@ -115,9 +115,12 @@ Ngrains=(*!dustem_params).ngrains |
115 | 115 | spec_grains=fltarr(Nwavs,ngrains) |
116 | 116 | spec2_grains=fltarr(Nwavs,ngrains) |
117 | 117 | |
118 | - | |
119 | 118 | ;==== save everything to put back later |
120 | -saved_pd=0 & saved_pinfo=0 & saved_fpd=0 | |
119 | +saved_params=0 & saved_pd=0 & saved_pinfo=0 & saved_fpd=0 | |
120 | +IF ptr_valid(!dustem_params) THEN BEGIN | |
121 | + dparams=*!dustem_params | |
122 | + saved_params=1 | |
123 | +END | |
121 | 124 | IF ptr_valid((*!dustem_fit).param_descs) THEN BEGIN |
122 | 125 | pd=*(*!dustem_fit).param_descs |
123 | 126 | iv=*(*!dustem_fit).param_init_values |
... | ... | @@ -133,6 +136,7 @@ IF ptr_valid((*!dustem_fit).fixed_param_descs) THEN BEGIN |
133 | 136 | fiv=*(*!dustem_fit).fixed_param_init_values |
134 | 137 | saved_fpd=1 |
135 | 138 | ENDIF |
139 | +stop | |
136 | 140 | |
137 | 141 | ;==== Run dustem with G0(a.k.a. U)=1. |
138 | 142 | param_desc=['(*!dustem_params).G0'] |
... | ... | @@ -173,10 +177,10 @@ IF gamma NE 0. THEN BEGIN |
173 | 177 | ;integrate over U |
174 | 178 | ;stop |
175 | 179 | FOR j=0L,Nwavs-1 DO BEGIN |
176 | - integ=integral(Us,reform(specs[*,j]),Umin,Umax) | |
180 | + integ=integral(Us,reform(specs[*,j]),Umin,Umax,/no_check) | |
177 | 181 | spec[j]=spec[j]+integ[0] |
178 | 182 | for k=0,ngrains-1 do begin |
179 | - integ_grains=integral(Us,reform(specs_grains[*,j,k]),Umin,Umax) | |
183 | + integ_grains=integral(Us,reform(specs_grains[*,j,k]),Umin,Umax,/no_check) | |
180 | 184 | spec_grains[j,k]=spec_grains[j,k]+integ_grains[0] |
181 | 185 | endfor |
182 | 186 | ENDFOR |
... | ... | @@ -193,7 +197,7 @@ for k=0,ngrains-1 do st.sed.(k+1)=spec_grains[*,k] |
193 | 197 | if saved_pd eq 1 then begin |
194 | 198 | (*!dustem_fit).param_descs=ptr_new(pd) |
195 | 199 | (*!dustem_fit).param_init_values=ptr_new(iv) |
196 | - (*!dustem_fit).param_init_values=ptr_new(cv) | |
200 | + (*!dustem_fit).current_param_values=ptr_new(cv) | |
197 | 201 | end |
198 | 202 | if saved_fpd eq 1 then begin |
199 | 203 | (*!dustem_fit).fixed_param_descs=ptr_new(fpd) |
... | ... | @@ -202,6 +206,9 @@ end |
202 | 206 | if saved_pinfo eq 1 then begin |
203 | 207 | !dustem_parinfo=ptr_new(parinfo) |
204 | 208 | end |
209 | +if saved_params eq 1 then begin | |
210 | + !dustem_params=ptr_new(dparams) | |
211 | +end | |
205 | 212 | |
206 | 213 | |
207 | 214 | the_end: | ... | ... |