Commit 54583f40b31db3baee283d922249a261af4998f5

Authored by Jean-Philippe Bernard
1 parent 0266152d
Exists in master

improved

LabTools/IRAP/JPB/make_sed_phangs_tables.pro
1 1 PRO make_sed_phangs_tables,test=test,show_seds=show_seds,grid_type=grid_type,isrf_class=isrf_class
2 2  
3   -;make_sed_phangs_tables
  3 +;make_sed_phangs_tables ;That's a test
4 4 ;make_sed_phangs_tables,/test,grid_type=2,/show_seds,isrf_class=15
5 5 ;make_sed_phangs_tables,/test,grid_type=3,/show_seds
6 6  
... ... @@ -13,14 +13,33 @@ dir=!phangs_data_dir+'/ISRF/GRIDS/'
13 13  
14 14 dustem_define_la_common
15 15  
16   -use_grid_type=1
  16 +use_grid_type=0
17 17 IF keyword_set(grid_type) THEN BEGIN
18 18 use_grid_type=grid_type
19 19 ENDIF
20 20  
21 21 CASE use_grid_type OF
  22 + 0: BEGIN ;======= This is for test only
  23 + !quiet=1
  24 + model='DBP90'
  25 + ;===== This is to do a small test_table
  26 + pd = [ $
  27 + '(*!dustem_params).G0' $ ;G0
  28 + ]
  29 + iv_min = [0.1]
  30 + iv_max = [10]
  31 + iv_Nvalues=[2]
  32 + log=[1]
  33 + fpd=['(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction
  34 + '(*!dustem_params).grains(1).mdust_o_mh']
  35 + fiv=[1.e-3,1.e-2]
  36 + table_name=dir+'TEST_'+model+'_G0.fits'
  37 + dustem_init,model=model
  38 + ;=== select filters to be used for the grid
  39 + filters=[(*!dustem_filters).nircam.filter_names,(*!dustem_filters).miri.filter_names]
  40 + dustem_make_sed_table,model,pd,iv_min,iv_max,iv_Nvalues,fpd=fpd,fiv=fiv,filename=table_name,log=log,show_seds=show_seds,/print_params,filters=filters
  41 + END
22 42 1: BEGIN ;======= This is to produce a grid with the DBP90 model + Mathis field for G0 and PAH abundance
23   -
24 43 !quiet=1
25 44 model='DBP90'
26 45 ;===== This is to do a small test_table
... ... @@ -34,7 +53,8 @@ CASE use_grid_type OF
34 53 fpd=[]
35 54 fiv=[]
36 55 IF keyword_set(test) THEN BEGIN
37   - iv_Nvalues=[5,3,3]
  56 + ;iv_Nvalues=[5,3,3]
  57 + iv_Nvalues=[2,2,2]
38 58 table_name=dir+'TEST_'+model+'_JWST_G0_YPAH_YVSG_4Phangs.fits'
39 59 ENDIF ELSE BEGIN
40 60 iv_Nvalues=[50,20,20]
... ...
LabTools/IRAP/JPB/phangs_brute_force_fit_with_isrf_grid.pro
... ... @@ -493,13 +493,16 @@ image_cont20,la_log10(rap_G0),Href,/square,imrange=imrange,axis_color_table=1,im
493 493 ;=== other plots
494 494 NH_range=[0.1,1000.]
495 495 G0_range=[0.1,10]
496   -G0_range_pred=[0.001,10]/10000.
  496 +G0_range_pred=[0.001,10]
497 497 Ypah_range=[8.e-5,2.e-1]
498 498 Yvsg_range=[8.e-5,2.e-1]
499 499 chi2_range=[1.e3,1.e7]
500 500  
501 501 window,win,xsize=800,ysize=900 & win=win+1
502 502 cgplot,G0s_predicted,G0s,/xlog,/ylog,xrange=G0_range_pred,/xsty,yrange=G0_range,/ysty,psym=3,xtit='G0 predicted',ytit='G0'
  503 +cgoplot,[1.e-3,1.e3],[1.e-3,1.e3],linesyle=2,color='red'
  504 +cgoplot,[1.e-3,1.e3],[1.e-3,1.e3]*10.,linesyle=2,color='blue'
  505 +cgoplot,[1.e-3,1.e3],[1.e-3,1.e3]*100.,linesyle=2,color='blue'
503 506  
504 507 window,win,xsize=800,ysize=900 & win=win+1
505 508 !p.multi=[0,1,3]
... ...
LabTools/IRAP/JPB/phangs_compare_seds_isrf.pro
... ... @@ -28,6 +28,10 @@ PRO phangs_compare_seds_isrf,isrf_class $
28 28  
29 29 ;=== weird, these look similar
30 30 ;phangs_compare_seds_isrf,8,N_seds=100L,/normalize,/weighted,isrf_class_analysis=14
  31 +;=== weird, these are ok
  32 +;phangs_compare_seds_isrf,8,N_seds=100L,/weighted,isrf_class_analysis=14
  33 +;=== weird this also
  34 +;phangs_compare_seds_isrf,8,N_seds=100L,/weighted,isrf_class_analysis=14,/include_herschel_filters
31 35  
32 36 define_la_common
33 37  
... ...
src/idl/dustem_make_sed_table.pro
... ... @@ -9,6 +9,7 @@ PRO dustem_make_sed_table,model, $
9 9 filters=filters, $
10 10 log=log, $
11 11 show_seds=show_seds, $
  12 + print_params=print_params, $
12 13 help=help
13 14  
14 15 ;+
... ... @@ -28,7 +29,7 @@ PRO dustem_make_sed_table,model, $
28 29 ; parvalues_max : maximum values for each parameter
29 30 ; parvalues_Nvalues : number of parameter values for each parameter
30 31 ; OPTIONAL INPUT PARAMETERS:
31   -; filters : name of dustemwrap filters to be included in the SED calculations (default = IRAS filters)
  32 +; filters : name of dustemwrap filters to be included in the SED calculations (default = ALL known filters)
32 33 ; fpd : fixed parameter description
33 34 ; fiv : fixed parameter values
34 35 ; filename : output fits file name for the table (default ='/tmp/dustem_seds.fits')
... ... @@ -48,7 +49,7 @@ PRO dustem_make_sed_table,model, $
48 49 ; The DustEM fortran code must be installed
49 50 ; The DustEMWrap IDL code must be installed
50 51 ; PROCEDURE:
51   -; None
  52 +; Filters in the table are ordered by increasing wavelength
52 53 ; EXAMPLES
53 54 ; dustem_make_sed_table,'DBP90',['(*!dustem_params).G0','(*!dustem_params).grains(0).mdust_o_mh'], $
54 55 ; [0.1,1.e-3],[100.,1.e-1],[10,3],filename='/tmp/IRAS_GO.fits',log=[1,0],/show_seds, $
... ... @@ -75,7 +76,7 @@ dustem_init,model=model,pol=use_polarisation
75 76 !dustem_which='RELEASE'
76 77  
77 78 ;=== define default filters
78   -use_filters=[dustem_instru2filters('NIRCAM'),dustem_instru2filters('MIRI'),dustem_instru2filters('IRAS'),dustem_instru2filters('PACS'),dustem_instru2filters('SPIRE'),dustem_instru2filters('HFI')]
  79 +use_filters=dustem_get_all_filter_names()
79 80 IF keyword_set(filters) THEN use_filters=filters
80 81 wavs=dustem_filter2wav(use_filters)
81 82 order=sort(wavs)
... ... @@ -161,7 +162,11 @@ FOR i=0L,Nc-1 DO BEGIN
161 162 ;stop
162 163 ;=== initialise all this information into dustemwrap's brain
163 164 dustem_init_params,model,pd,pval,fpd=fpd,fiv=fiv,pol=use_polarisation,/force_reset
164   - ;stop
  165 +
  166 + IF keyword_set(print_params) THEN BEGIN
  167 + dustem_print_params,0
  168 + ;stop
  169 + ENDIF
165 170  
166 171 ;=== compute the predicted SED and extinction curve for the dust-model
167 172 ;=== and any plugins
... ... @@ -197,7 +202,7 @@ FOR i=0L,Nc-1 DO BEGIN
197 202 ENDIF
198 203 ;stop
199 204 ENDFOR
200   -stop
  205 +;stop
201 206  
202 207 str='one_sed={'
203 208 FOR i=0L,Nparams-1 DO BEGIN
... ... @@ -232,9 +237,6 @@ FOR i=0L,Nc-1 DO BEGIN
232 237 ENDFOR
233 238  
234 239 ;======== save SED tables
235   -;use_sed_outfile='/tmp/dustem_seds.xcat'
236   -;write_xcat,seds_array,use_sed_outfile
237   -;message,'Wrote '+use_sed_outfile,/continue
238 240  
239 241 fits_file='/tmp/dustem_seds.fits'
240 242 IF keyword_set(filename) THEN fits_file=filename
... ...
src/idl/dustem_print_params.pro
1   -PRO dustem_print_params
  1 +PRO dustem_print_params,bidon
2 2  
3 3 ;help,!dustem_params,/str
4 4 ;** Structure <5f85ea08>, 14 tags, length=5672, data length=5652, refs=1:
... ... @@ -79,7 +79,7 @@ ENDFOR
79 79 FOR i=0L,N_fixed_par-1 DO BEGIN
80 80 status_fixed_params[i]=dustem_parameter_description2type((*(*!dustem_fit).fixed_param_descs)[i],string_name=string_name)
81 81 IF status_fixed_params[i] EQ 'FORTRAN' THEN BEGIN
82   - str='fortran_fixed_values[i]='+(*(*!dustem_fit).param_descs)[i]
  82 + str='fortran_fixed_values[i]='+(*(*!dustem_fit).fixed_param_descs)[i]
83 83 message,'executing '+str,/continue
84 84 toto=execute(str)
85 85 ENDIF
... ...