diff --git a/LabTools/IRAP/JPB/phangs_compare_seds_isrf.pro b/LabTools/IRAP/JPB/phangs_compare_seds_isrf.pro index e0a149b..9bdbeaf 100644 --- a/LabTools/IRAP/JPB/phangs_compare_seds_isrf.pro +++ b/LabTools/IRAP/JPB/phangs_compare_seds_isrf.pro @@ -1,7 +1,17 @@ +PRO phangs_compare_seds_isrf,isrf_class $ + ,N_seds=N_seds $ + ,normalize=normalize $ + ,weighted=weighted $ + ,include_herschel_filters=include_herschel_filters -PRO phangs_compare_seds_isrf,isrf_class,N_seds=N_seds,normalize=normalize,weighted=weighted +;phangs_compare_seds_isrf,0,N_seds=100L ;test works +;phangs_compare_seds_isrf,0,N_seds=100L,/weighted ;not working because weights are infinite +;phangs_compare_seds_isrf,0,N_seds=100L,/normalize ;not working because weights are infinite -;phangs_compare_seds_isrf,15,N_seds=1000L +;phangs_compare_seds_isrf,15,N_seds=100L +;phangs_compare_seds_isrf,15,N_seds=1000L,/normalize + +define_la_common dir=!phangs_data_dir+'/ISRF/GRIDS/' isrf_class_str='_isrfclass'+strtrim(isrf_class,2) @@ -10,8 +20,11 @@ table_name=dir+model+'_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs'+isrf_class_str+'.fits st=mrdfits(table_name,1,h) Nst=n_elements(st) -;use_filters_names=['F360M','F0770W','F1000W','F1130W','F2100W'] -use_filters_names=['F360M','F0770W','F1000W','F1130W','F2100W','PACS_BLUE','PACS_GREEN','PACS_RED','PSW','PMW','PLW'] + +use_filters_names=['F360M','F0770W','F1000W','F1130W','F2100W'] +IF keyword_set(include_herschel_filters) THEN BEGIN + use_filters_names=['F360M','F0770W','F1000W','F1130W','F2100W','PACS_BLUE','PACS_GREEN','PACS_RED','PSW','PMW','PLW'] +ENDIF filters=dustem_filter_names2filters(use_filters_names) Nfilters=n_elements(filters) @@ -23,6 +36,7 @@ IF keyword_set(N_seds) THEN Nseds=N_seds Nparams=3 true_params=fltarr(Nseds,Nparams) fitted_params=fltarr(Nseds,Nparams) +facts=fltarr(Nseds) seed=1 FOR j=0L,Nseds-1 DO BEGIN @@ -52,6 +66,8 @@ FOR j=0L,Nseds-1 DO BEGIN ,params_hit=params_hit,params_uncertainties=params_uncertainties,params_min=params_min,params_max=params_max $ ,fixed_parameters_description=fixed_parameters_description,fixed_parameters_values=fixed_parameters_values $ ,weighted_params=weighted_params) + print,params,fact + facts[j]=fact params[1]=params[1]/fact params[2]=params[2]/fact weighted_params[1]=weighted_params[1]/fact @@ -64,23 +80,42 @@ FOR j=0L,Nseds-1 DO BEGIN ENDELSE ENDFOR +;stop + win=0L +!p.multi=[0,1,3] + xtit='True parameter ('+isrf_class_str+')' ytit='recovered parameter (Mathis ISRF)' -window,win & win=win+1 -cgplot,true_params[*,0],fitted_params[*,0],tit='G0',psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit +tit='G0' + +tit_str=':' +IF keyword_set(weighted) THEN tit_str=tit_str+' weighted' +IF keyword_set(normalize) THEN tit_str=tit_str+' normalized' +IF keyword_set(include_herschel_filters) THEN tit_str=tit_str+' MUSE+Herschel' ELSE tit_str=tit_str+' MUSE' + +;window,win & win=win+1 +window,win,xsize=500,ysize=900 +xrange=minmax(true_params[*,0]) +cgplot,true_params[*,0],fitted_params[*,0],tit='G0'+tit_str,psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit,xrange=xrange,yrange=xrange cgoplot,10^!x.crange,10^!y.crange,linestyle=2,color='red',thickness=3 -window,win & win=win+1 -cgplot,true_params[*,1],fitted_params[*,1],tit='Ypah',psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit +;window,win & win=win+1 +xrange=minmax(true_params[*,1]) +cgplot,true_params[*,1],fitted_params[*,1],tit='Ypah'+tit_str,psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit,xrange=xrange,yrange=xrange cgoplot,10^!x.crange,10^!y.crange,linestyle=2,color='red',thickness=3 -window,win & win=win+1 -cgplot,true_params[*,2],fitted_params[*,2],tit='Yvsg',psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit +;window,win & win=win+1 +xrange=minmax(true_params[*,2]) +cgplot,true_params[*,2],fitted_params[*,2],tit='Yvsg'+tit_str,psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit,xrange=xrange,yrange=xrange cgoplot,10^!x.crange,10^!y.crange,linestyle=2,color='red',thickness=3 stop +cleanplot +window,win & win=win+1 +cgplot,facts,true_params[*,1]-fitted_params[*,1],psym=4 + END -- libgit2 0.21.2