Commit 4176fb1e62a647a769effcadab2b5deea254e3ae

Authored by Jean-Philippe Bernard
1 parent 49c5df35
Exists in master

fixed a bug

Showing 1 changed file with 7 additions and 7 deletions   Show diff stats
src/idl/dustem_brute_force_fit.pro
... ... @@ -126,13 +126,6 @@ ENDELSE
126 126 chi2=min(chi2s)
127 127 ind=where(chi2s EQ chi2,count)
128 128  
129   -;==== should check bumping to table edges there
130   -params_hit=intarr(Nparams)
131   -FOR i=0L,Nparams-1 DO BEGIN
132   - IF params[i] EQ minvalues[i] THEN params_hit[i]=-1
133   - IF params[i] EQ maxvalues[i] THEN params_hit[i]=1
134   -ENDFOR
135   -
136 129 params=grid_param_values[ind[0],*] ;these are the best fit parameters
137 130 fact=facts[ind[0]] ; This is the corresponding scaling factor
138 131 Nfreedom=Nseds-Nparams-1 ;This is the degree of freedom
... ... @@ -140,6 +133,13 @@ rchi2=chi2/Nfreedom ;This is the reduced chi2
140 133 best_grid_sed=reform(grid_seds[ind[0],*]) ;This is the best SED fround in the grid.
141 134 best_sed=best_grid_sed*fact ;This is the best scaled grid SED matching the input SED.
142 135  
  136 +;==== should check bumping to table edges there
  137 +params_hit=intarr(Nparams)
  138 +FOR i=0L,Nparams-1 DO BEGIN
  139 + IF params[i] EQ minvalues[i] THEN params_hit[i]=-1
  140 + IF params[i] EQ maxvalues[i] THEN params_hit[i]=1
  141 +ENDFOR
  142 +
143 143 ;==== should compute parameter uncertainties there
144 144 conf_level=90./100.
145 145 dchi2=delta_chi2(Nfreedom,conf_level)
... ...