Commit 694026f6895e56f7947d107654109fde03e2e8a0

Authored by Jean-Philippe Bernard
1 parent 0d19c43e
Exists in master

commented

Showing 1 changed file with 45 additions and 10 deletions   Show diff stats
LabTools/IRAP/JPB/phangs_compare_seds_isrf.pro
  1 +PRO phangs_compare_seds_isrf,isrf_class $
  2 + ,N_seds=N_seds $
  3 + ,normalize=normalize $
  4 + ,weighted=weighted $
  5 + ,include_herschel_filters=include_herschel_filters
1 6  
2   -PRO phangs_compare_seds_isrf,isrf_class,N_seds=N_seds,normalize=normalize,weighted=weighted
  7 +;phangs_compare_seds_isrf,0,N_seds=100L ;test works
  8 +;phangs_compare_seds_isrf,0,N_seds=100L,/weighted ;not working because weights are infinite
  9 +;phangs_compare_seds_isrf,0,N_seds=100L,/normalize ;not working because weights are infinite
3 10  
4   -;phangs_compare_seds_isrf,15,N_seds=1000L
  11 +;phangs_compare_seds_isrf,15,N_seds=100L
  12 +;phangs_compare_seds_isrf,15,N_seds=1000L,/normalize
  13 +
  14 +define_la_common
5 15  
6 16 dir=!phangs_data_dir+'/ISRF/GRIDS/'
7 17 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
10 20 st=mrdfits(table_name,1,h)
11 21 Nst=n_elements(st)
12 22  
13   -;use_filters_names=['F360M','F0770W','F1000W','F1130W','F2100W']
14   -use_filters_names=['F360M','F0770W','F1000W','F1130W','F2100W','PACS_BLUE','PACS_GREEN','PACS_RED','PSW','PMW','PLW']
  23 +
  24 +use_filters_names=['F360M','F0770W','F1000W','F1130W','F2100W']
  25 +IF keyword_set(include_herschel_filters) THEN BEGIN
  26 + use_filters_names=['F360M','F0770W','F1000W','F1130W','F2100W','PACS_BLUE','PACS_GREEN','PACS_RED','PSW','PMW','PLW']
  27 +ENDIF
15 28 filters=dustem_filter_names2filters(use_filters_names)
16 29 Nfilters=n_elements(filters)
17 30  
... ... @@ -23,6 +36,7 @@ IF keyword_set(N_seds) THEN Nseds=N_seds
23 36 Nparams=3
24 37 true_params=fltarr(Nseds,Nparams)
25 38 fitted_params=fltarr(Nseds,Nparams)
  39 +facts=fltarr(Nseds)
26 40 seed=1
27 41  
28 42 FOR j=0L,Nseds-1 DO BEGIN
... ... @@ -52,6 +66,8 @@ FOR j=0L,Nseds-1 DO BEGIN
52 66 ,params_hit=params_hit,params_uncertainties=params_uncertainties,params_min=params_min,params_max=params_max $
53 67 ,fixed_parameters_description=fixed_parameters_description,fixed_parameters_values=fixed_parameters_values $
54 68 ,weighted_params=weighted_params)
  69 + print,params,fact
  70 + facts[j]=fact
55 71 params[1]=params[1]/fact
56 72 params[2]=params[2]/fact
57 73 weighted_params[1]=weighted_params[1]/fact
... ... @@ -64,23 +80,42 @@ FOR j=0L,Nseds-1 DO BEGIN
64 80 ENDELSE
65 81 ENDFOR
66 82  
  83 +;stop
  84 +
67 85 win=0L
  86 +!p.multi=[0,1,3]
  87 +
68 88 xtit='True parameter ('+isrf_class_str+')'
69 89 ytit='recovered parameter (Mathis ISRF)'
70 90  
71   -window,win & win=win+1
72   -cgplot,true_params[*,0],fitted_params[*,0],tit='G0',psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit
  91 +tit='G0'
  92 +
  93 +tit_str=':'
  94 +IF keyword_set(weighted) THEN tit_str=tit_str+' weighted'
  95 +IF keyword_set(normalize) THEN tit_str=tit_str+' normalized'
  96 +IF keyword_set(include_herschel_filters) THEN tit_str=tit_str+' MUSE+Herschel' ELSE tit_str=tit_str+' MUSE'
  97 +
  98 +;window,win & win=win+1
  99 +window,win,xsize=500,ysize=900
  100 +xrange=minmax(true_params[*,0])
  101 +cgplot,true_params[*,0],fitted_params[*,0],tit='G0'+tit_str,psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit,xrange=xrange,yrange=xrange
73 102 cgoplot,10^!x.crange,10^!y.crange,linestyle=2,color='red',thickness=3
74 103  
75   -window,win & win=win+1
76   -cgplot,true_params[*,1],fitted_params[*,1],tit='Ypah',psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit
  104 +;window,win & win=win+1
  105 +xrange=minmax(true_params[*,1])
  106 +cgplot,true_params[*,1],fitted_params[*,1],tit='Ypah'+tit_str,psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit,xrange=xrange,yrange=xrange
77 107 cgoplot,10^!x.crange,10^!y.crange,linestyle=2,color='red',thickness=3
78 108  
79   -window,win & win=win+1
80   -cgplot,true_params[*,2],fitted_params[*,2],tit='Yvsg',psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit
  109 +;window,win & win=win+1
  110 +xrange=minmax(true_params[*,2])
  111 +cgplot,true_params[*,2],fitted_params[*,2],tit='Yvsg'+tit_str,psym=4,/xlog,/ylog,xtit=xtit,ytit=ytit,xrange=xrange,yrange=xrange
81 112 cgoplot,10^!x.crange,10^!y.crange,linestyle=2,color='red',thickness=3
82 113  
83 114 stop
84 115  
  116 +cleanplot
  117 +window,win & win=win+1
  118 +cgplot,facts,true_params[*,1]-fitted_params[*,1],psym=4
  119 +
85 120 END
86 121  
... ...