Commit 1882e1a575eccf99c808fb88b4afa45b616936ef

Authored by Jean-Philippe Bernard
1 parent c9a8dd22
Exists in master

improved

LabTools/IRAP/JPB/phangs_brute_force_fit_with_isrf_grid.pro
... ... @@ -109,7 +109,11 @@ chi2s=fltarr(Nvor)+la_undef()
109 109 rchi2s=fltarr(Nvor)+la_undef()
110 110 dG0s=fltarr(Nvor)+la_undef()
111 111 dYpahs=fltarr(Nvor)+la_undef()
112   -dYVSGs=fltarr(Nvor)+la_undef()
  112 +dYVSGs=fltarr(Nvor)+la_undef()
  113 +G0_hit=fltarr(Nvor)+la_undef()
  114 +Ypah_hit=fltarr(Nvor)+la_undef()
  115 +Yvsg_hit=fltarr(Nvor)+la_undef()
  116 +
113 117 use_NHmap=NHCO ;used NH map in 1.e21 (from CO)
114 118 ;use_NHmap=NH_map ;used NH map in 1.e21 (from MUSE)
115 119  
... ... @@ -158,10 +162,10 @@ FOR isrf_class=class_min,class_max DO BEGIN
158 162 ;=== Get the G0 value for that vid
159 163 vid=ind_class[vvid]
160 164 ;print,vid
161   - IF vid EQ 12641 THEN BEGIN
162   - message,'stopped at vid =12641',/continue
163   - stop
164   - ENDIF
  165 + ;IF vid EQ 12641 THEN BEGIN
  166 + ; message,'stopped at vid =12641',/continue
  167 + ; stop
  168 + ;ENDIF
165 169 G0=interpol(ISRFs[*,vid],isrf_wavelengths,1.0)/Mathis_1mic
166 170 fixed_parameters_values=[G0]
167 171 sed=*seds_ptr[vid]
... ... @@ -183,11 +187,16 @@ FOR isrf_class=class_min,class_max DO BEGIN
183 187 ;Ypahs[vid]=params[1]/fact ;extenssive quantities must be divided by normalization factor
184 188 ;Yvsgs[vid]=params[2]/fact
185 189 G0s[vid]=G0
186   - Ypahs[vid]=params[0]/fact ;extenssive quantities must be divided by normalization factor
187   - Yvsgs[vid]=params[1]/fact
  190 + ;Ypahs[vid]=params[1]/fact ;extenssive quantities must be divided by normalization factor
  191 + ;Yvsgs[vid]=params[2]/fact
  192 + Ypahs[vid]=weighted_params[1]/fact ;extenssive quantities must be divided by normalization factor
  193 + Yvsgs[vid]=weighted_params[2]/fact
188 194 facts[vid]=fact
189 195 chi2s[vid]=chi2
190 196 rchi2s[vid]=rchi2
  197 + G0_hit[vid]=params_hit[0]
  198 + Ypah_hit[vid]=params_hit[1]
  199 + Yvsg_hit[vid]=params_hit[2]
191 200 ;This would be if there was no fixed_parameters
192 201 ;dG0s[vid]=params_uncertainties[0]
193 202 ;dYpahs[vid]=params_uncertainties[1]/fact ;extenssive quantities must be devided by normalization factor
... ... @@ -225,6 +234,9 @@ dG0_map=fltarr(sxpar(href,'NAXIS1'),sxpar(href,'NAXIS2'))+la_undef()
225 234 dYpah_map=fltarr(sxpar(href,'NAXIS1'),sxpar(href,'NAXIS2'))+la_undef()
226 235 dYVSG_map=fltarr(sxpar(href,'NAXIS1'),sxpar(href,'NAXIS2'))+la_undef()
227 236 fact_map=fltarr(sxpar(href,'NAXIS1'),sxpar(href,'NAXIS2'))+la_undef()
  237 +Ypah_hit_map=fltarr(sxpar(href,'NAXIS1'),sxpar(href,'NAXIS2'))+la_undef()
  238 +YVSG_hit_map=fltarr(sxpar(href,'NAXIS1'),sxpar(href,'NAXIS2'))+la_undef()
  239 +
228 240 FOR vid=0LL,Nvor-1 DO BEGIN
229 241 IF vid mod 100 EQ 0 THEN print,(1.*vid)/Nvor*100.
230 242 ;ind=where(voronoi_id EQ vid)
... ... @@ -237,14 +249,10 @@ FOR vid=0LL,Nvor-1 DO BEGIN
237 249 chi2_map[*all_seds_indices[vid]]=chi2s[vid]
238 250 rchi2_map[*all_seds_indices[vid]]=rchi2s[vid]
239 251 fact_map[*all_seds_indices[vid]]=facts[vid]
  252 + Ypah_hit_map[*all_seds_indices[vid]]=Ypah_hit[vid]
  253 + YVSG_hit_map[*all_seds_indices[vid]]=Yvsg_hit[vid]
240 254 ENDFOR
241 255  
242   -;FOR vid=0LL,Nvor-1 DO GO_map[*all_seds_indices[vid]]=GOs[vid]
243   -;FOR vid=0LL,Nvor-1 DO Ypah_map[*all_seds_indices[vid]]=Ypahs[vid]
244   -;FOR vid=0LL,Nvor-1 DO YVSG_map[*all_seds_indices[vid]]=Yvsgs[vid]
245   -;FOR vid=0LL,Nvor-1 DO chi2_map[*all_seds_indices[vid]]=chi2s[vid]
246   -;stop
247   -
248 256 ;G0 histogram
249 257 win=0L
250 258 window,win,xsize=800,ysize=800 & win=win+1
... ... @@ -269,7 +277,7 @@ imrange=[-2.,6]
269 277 image_cont20,la_log10(Ypah_map),Href,/square,imrange=imrange,axis_color_table=1,image_color_table='jpbloadct',/silent,off_bar=obp,title='log10(Ypah)'
270 278  
271 279 window,win,xsize=800,ysize=900 & win=win+1
272   -imrange=[-2.,2]
  280 +imrange=[-2.,6]
273 281 ;imrange=[-3.,0.]-3. ;why ??
274 282 ;image_cont20,la_log10(YVSG_map),Href,/square,imrange=[-2.,6],axis_color_table=1,image_color_table='jpbloadct',/silent,off_bar=obp,title='log10(Yvsg)'
275 283 image_cont20,la_log10(YVSG_map),Href,/square,imrange=imrange,axis_color_table=1,image_color_table='jpbloadct',/silent,off_bar=obp,title='log10(Yvsg)'
... ... @@ -280,9 +288,17 @@ imrange=[3,7]
280 288 image_cont20,la_log10(chi2_map),Href,/square,imrange=imrange,axis_color_table=1,image_color_table='jpbloadct',/silent,title='log10(Chi2)',off_bar=obp
281 289  
282 290 window,win,xsize=800,ysize=900 & win=win+1
283   -imrange=[-1,2]
  291 +imrange=[-3,2]
284 292 image_cont20,la_log10(fact_map),Href,/square,imrange=imrange,axis_color_table=1,image_color_table='jpbloadct',/silent,title='log10(fact)',off_bar=obp
285 293  
  294 +window,win,xsize=800,ysize=900 & win=win+1
  295 +imrange=[-2,2]
  296 +image_cont20,Ypah_hit_map,Href,/square,imrange=imrange,axis_color_table=1,image_color_table='jpbloadct',/silent,title='Ypah hit',off_bar=obp
  297 +
  298 +window,win,xsize=800,ysize=900 & win=win+1
  299 +imrange=[-2,2]
  300 +image_cont20,Yvsg_hit_map,Href,/square,imrange=imrange,axis_color_table=1,image_color_table='jpbloadct',/silent,title='Yvsg hit',off_bar=obp
  301 +
286 302 stop
287 303 jwst_4_coutours=fltarr((size(jwst_images))[1],(size(jwst_images))[2],2)
288 304 jwst_4_coutours[*,*,0]=jwst_images[*,*,0,5]
... ...