PRO make_sed_phangs_tables,test=test,show_seds=show_seds,grid_type=grid_type,isrf_class=isrf_class ;make_sed_phangs_tables,/show ;That's a test ;make_sed_phangs_tables,grid_type=1,/show_seds,/test ;That's a test ;make_sed_phangs_tables,/test,grid_type=2,/show_seds,isrf_class=15 ;make_sed_phangs_tables,/test,grid_type=3,/show_seds ;=== This is needed for Phangs work ;defsysv,'!phangs_data_dir','/Volumes/PILOT_FLIGHT1/PHANGS/' ;defsysv,'!phangs_data_dir','/data/projects/phangs/' ;=== This is where the grids will be written ;dir=!dustem_wrap_soft_dir+'/Grids/' dir=!phangs_data_dir+'/ISRF/GRIDS/' dustem_define_la_common use_grid_type=0 IF keyword_set(grid_type) THEN BEGIN use_grid_type=grid_type ENDIF test_str='' IF keyword_set(test) THEN BEGIN test_str='TEST_' ENDIF CASE use_grid_type OF 0: BEGIN ;======= This is for test only !quiet=1 model='DBP90' ;===== This is to do a small test_table pd = [ $ '(*!dustem_params).G0' $ ;G0 ] iv_min = [0.1] iv_max = [10] iv_Nvalues=[2] plog=[1] fpd=['(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction '(*!dustem_params).grains(1).mdust_o_mh'] fiv=[1.e-3,1.e-2] table_name=dir+'TEST_'+model+'_G0.fits' dustem_init,model=model ;=== select filters to be used for the grid (default=ALL) ;filters=[(*!dustem_filters).nircam.filter_names,(*!dustem_filters).miri.filter_names] dustem_make_sed_table,model,pd,iv_min,iv_max,iv_Nvalues,fpd=fpd,fiv=fiv,filename=table_name,plog=plog,show_seds=show_seds,/print_params,filters=filters END 1: BEGIN ;======= This is to produce a grid with the DBP90 model + Mathis field for G0 and PAH abundance !quiet=1 model='DBP90' ;===== This is to do a small test_table pd = [ $ '(*!dustem_params).G0', $ ;G0 '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction '(*!dustem_params).grains(1).mdust_o_mh'] ;VSG mass fraction iv_min = [0.1,1.e-4,1.e-4] iv_max = [100,1.e-1,1.e-1] plog=[1,1,1] fpd=[] fiv=[] IF keyword_set(test) THEN BEGIN ;iv_Nvalues=[5,3,3] iv_Nvalues=[2,2,2] table_name=dir+'TEST_'+model+'_JWST_G0_YPAH_YVSG_4Phangs.fits' ENDIF ELSE BEGIN iv_Nvalues=[50,20,20] table_name=dir+model+'_JWST_G0_YPAH_YVSG_4Phangs.fits' ENDELSE dustem_init,model=model ;=== select filters to be used for the grid filters=[(*!dustem_filters).nircam.filter_names,(*!dustem_filters).miri.filter_names] dustem_make_sed_table,model,pd,iv_min,iv_max,iv_Nvalues,fpd=fpd,fiv=fiv,filename=table_name,filters=filters,plog=plog,show_seds=show_seds END 2: BEGIN ;This is DPB90 model with PHANGS ISRF classes !quiet=1 model='DBP90' ;This is to use the DBP90 dust model ;======= This is to produce a grid with the above model for G0 and PAH abundance and ISRF from the Muse data ;======= Note that g0 is fixed parameters is actually not used, replaced by dustem_plugin_phangs_class_isrf_2 pd = [ $ 'dustem_plugin_phangs_class_isrf_2', $ ;G0 factor for Phangs ISRF classes '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction '(*!dustem_params).grains(1).mdust_o_mh'] ;VSG mass fraction iv_min = [0.1,1.e-4,1.e-4] iv_max = [100,1.e-1,1.e-1] plog=[1,1,1] Nclass=31L fpd=['(*!dustem_params).gas.g0','(*!dustem_params).g0','dustem_plugin_phangs_class_isrf_1','dustem_plugin_phangs_class_isrf_4'] ;ISRF class to be used dustem_init,model=model fortran_user=dustem_set_up_fortran(/random_name) ;use a random fortran number !dustem_verbose=0 (*!dustem_params).KEYWORDS='quiet '+(*!dustem_params).KEYWORDS ;This makes Fortran be quiet too ;=== select filters to be used for the grid (HOOPS, we need MUSE also, and maybe all filters ...) filters=[(*!dustem_filters).nircam.filter_names,(*!dustem_filters).miri.filter_names, $ (*!dustem_filters).iras.filter_names,(*!dustem_filters).pacs.filter_names,(*!dustem_filters).spire.filter_names] IF keyword_set(isrf_class) THEN BEGIN ;do just one table use_isrf_class=isrf_class ENDIF ELSE BEGIN use_isrf_class=0 ;This is for Mathis field ENDELSE fiv=[-1.,1.,use_isrf_class,0.] ;This sets the ISRF class to the requested value. alos removes ionising photons. isrf_class_str='_isrfclass'+strtrim(use_isrf_class,2) ;define the number of free parameters in the grid and the grid fits table name IF keyword_set(test) THEN BEGIN ;iv_Nvalues=[2,2,2] iv_Nvalues=[4,4,6,10] table_name=dir+'TEST_'+model+'_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs_noionis'+isrf_class_str+'.fits' ENDIF ELSE BEGIN iv_Nvalues=[50,20,20] table_name=dir+model+'_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs_noionis'+isrf_class_str+'.fits' ENDELSE dustem_make_sed_table,model,pd,iv_min,iv_max,iv_Nvalues,fpd=fpd,fiv=fiv,filename=table_name,filters=filters,plog=plog,show_seds=show_seds END 3: BEGIN ;This is DPB90 model with DL07 ISRF prescription (a la Chastanet) !quiet=1 model='DBP90' ;This is to use the DBP90 dust model ;======= This is to produce a grid with the above model for G0 and PAH abundance and ISRF from the Muse data ;======= Note that g0 is fixed parameters is actually not used, replaced by dustem_plugin_phangs_class_isrf_2 pd = [ $ 'dustem_plugin_dl07_isrf_model_3', $ ;Umin factor [0.1-100] 6 values 'dustem_plugin_dl07_isrf_model_1', $ ;gamma factor [0.0,0.02] 5 values '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction [1.e-4,1.e-1] 20 values '(*!dustem_params).grains(1).mdust_o_mh' $ ;VSG mass fraction [1.e-4,1.e-1] 20 values ] ;iv_min = [0.1,0. ,1.e-4,1.e-4] ;does not run for values =0., because of use of pmin (division by initial value) iv_min = [0.1,1.e-10 ,1.e-4,1.e-4] iv_max = [100.,0.02,1.e-1,1.e-1] plog=[1,0,1,1] fpd=['dustem_plugin_dl07_isrf_model_2', $ ;alpha=1 'dustem_plugin_dl07_isrf_model_4' $ ;Umax=1.e7 ] fiv=[2.,1.e7] ;This sets the fixed parameters dustem_init,model=model fortran_user=dustem_set_up_fortran(/random_name) ;use a random fortran number !dustem_verbose=1 !quiet=0 !dustem_nocatch=1 ;!dustem_verbose=0 ;(*!dustem_params).KEYWORDS='quiet '+(*!dustem_params).KEYWORDS ;This makes Fortran be quiet too ;=== select filters to be used for the grid (no definition -> all known filters used) ;filters=[(*!dustem_filters).nircam.filter_names,(*!dustem_filters).miri.filter_names, $ ; (*!dustem_filters).iras.filter_names,(*!dustem_filters).pacs.filter_names,(*!dustem_filters).spire.filter_names] ;define the number of free parameters in the grid and the grid fits table name IF keyword_set(test) THEN BEGIN ;iv_Nvalues=[2,2,3,3] iv_Nvalues=[2,2,3,3] ;iv_Nvalues=[4,4,6,10] table_name=dir+'TEST_'+model+'_DL07ISRF_YPAH_YVSG_Umin_gamma_4Phangs'+'.fits' ENDIF ELSE BEGIN iv_Nvalues=[6,5,20,20] table_name=dir+model+'_DL07ISRF_YPAH_YVSG_Umin_gamma_4Phangs'+'.fits' ENDELSE dustem_make_sed_table,model,pd,iv_min,iv_max,iv_Nvalues,fpd=fpd,fiv=fiv,filename=table_name,filters=filters,plog=plog,show_seds=show_seds END 4: BEGIN ;This is DL07 model with PHANGS ISRF classes !quiet=1 model='DL07' ;This is to use the DBP90 dust model ;======= This is to produce a grid with the above model for G0 and PAH abundance and ISRF from the Muse data ;======= Note that g0 is fixed parameters is actually not used, replaced by dustem_plugin_phangs_class_isrf_2 pd = [ $ 'dustem_plugin_phangs_class_isrf_2', $ ;G0 factor for Phangs ISRF classes '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction '(*!dustem_params).grains(1).mdust_o_mh'] ;VSG mass fraction ;iv_min = [0.1,1.e-4,1.e-4] ;iv_max = [100,1.e-1,1.e-1] iv_min = [0.1,5.e-5,5.e-5] iv_max = [1.e6,5.e-1,5.e-1] plog=[1,1,1] Nclass=31L fpd=['(*!dustem_params).gas.g0','(*!dustem_params).g0','dustem_plugin_phangs_class_isrf_1','dustem_plugin_phangs_class_isrf_4'] ;ISRF class to be used dustem_init,model=model fortran_user=dustem_set_up_fortran(/random_name) ;use a random fortran number !dustem_verbose=0 (*!dustem_params).KEYWORDS='quiet '+(*!dustem_params).KEYWORDS ;This makes Fortran be quiet too ;=== select filters to be used for the grid (HOOPS, we need MUSE also, and maybe all filters ...) filters=dustem_get_all_filter_names() ;filters=[(*!dustem_filters).nircam.filter_names,(*!dustem_filters).miri.filter_names, $ ; (*!dustem_filters).iras.filter_names,(*!dustem_filters).pacs.filter_names,(*!dustem_filters).spire.filter_names] IF keyword_set(isrf_class) THEN BEGIN ;do just one table use_isrf_class=isrf_class ENDIF ELSE BEGIN use_isrf_class=0 ;This is for Mathis field ENDELSE fiv=[-1.,1.,use_isrf_class,0.] ;This sets the ISRF class to the requested value. alos removes ionising photons. isrf_class_str='_isrfclass'+strtrim(use_isrf_class,2) ;define the number of free parameters in the grid and the grid fits table name IF keyword_set(test) THEN BEGIN ;iv_Nvalues=[2,2,2] iv_Nvalues=[2,2,3,5] table_name=dir+'TEST_'+model+'_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs_noionis'+isrf_class_str+'.fits' ENDIF ELSE BEGIN iv_Nvalues=[100,20,20] table_name=dir+model+'_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs_noionis'+isrf_class_str+'.fits' ENDELSE dustem_make_sed_table,model,pd,iv_min,iv_max,iv_Nvalues,fpd=fpd,fiv=fiv,filename=table_name,filters=filters,plog=plog,show_seds=show_seds END 5: BEGIN ;This is DL07 model with PHANGS ISRF classes, with only G0 as free parameter !quiet=1 model='DL07' ;This is to use the DBP90 dust model ;======= This is to produce a grid with the above model for G0 and PAH abundance and ISRF from the Muse data ;======= Note that g0 is fixed parameters is actually not used, replaced by dustem_plugin_phangs_class_isrf_2 pd = [ $ 'dustem_plugin_phangs_class_isrf_2' $ ;G0 factor for Phangs ISRF classes ] iv_min = [0.1] iv_max = [1.e6] plog=[1] IF keyword_set(test) THEN BEGIN iv_min = [1.] iv_max = [3.] plog=[1] ENDIF ;Nclass=31L fpd=['(*!dustem_params).gas.g0','(*!dustem_params).g0','dustem_plugin_phangs_class_isrf_1','dustem_plugin_phangs_class_isrf_4'] ;ISRF class to be used dustem_init,model=model fortran_user=dustem_set_up_fortran(/random_name) ;use a random fortran number !dustem_verbose=0 (*!dustem_params).KEYWORDS='quiet '+(*!dustem_params).KEYWORDS ;This makes Fortran be quiet too ;=== select filters to be used for the grid (HOOPS, we need MUSE also, and maybe all filters ...) filters=dustem_get_all_filter_names() IF keyword_set(isrf_class) THEN BEGIN ;do just one table use_isrf_class=isrf_class ENDIF ELSE BEGIN use_isrf_class=0 ;This is for Mathis field ENDELSE fiv=[-1.,1.,use_isrf_class,0.] ;This sets the ISRF class to the requested value. also removes ionising photons. isrf_class_str='_isrfclass'+strtrim(use_isrf_class,2) ;define the number of free parameters in the grid and the grid fits table name IF keyword_set(test) THEN BEGIN iv_Nvalues=[2] ;table_name=dir+test_str+model+'_MuseISRF_JWST_G0_4Phangs_noionis'+isrf_class_str+'.fits' ENDIF ELSE BEGIN iv_Nvalues=[100] ENDELSE table_name=dir+test_str+model+'_MuseISRF_JWST_G0_4Phangs_noionis'+isrf_class_str+'.fits' dustem_make_sed_table,model,pd,iv_min,iv_max,iv_Nvalues,fpd=fpd,fiv=fiv,filename=table_name,filters=filters,plog=plog,show_seds=show_seds ;adding linear parameters abundance message,'Adding Dust abundances to grid',/continue pd=['(*!dustem_params).grains[0].MDUST_O_MH','(*!dustem_params).grains[1].MDUST_O_MH','(*!dustem_params).grains[2].MDUST_O_MH'] default_value=(dustem_get_param_values_default(pd)) ;iv_min=[default_value/10.] & iv_max=[default_value*100.] iv_min=[default_value/10.] iv_max=[default_value*10.] iv_Nvalues=[20,20,20] plog=[1,1,1] IF keyword_set(test) THEN BEGIN iv_min=[default_value/2.] & iv_max=[default_value*2.] iv_Nvalues=[3,3,3] plog=[0,0,0] ENDIF output_table_name=dir+test_str+model+'_MuseISRF_JWST_G0_Ypah1added_Ypah2added_Yvsgadded_4Phangs_noionis'+isrf_class_str+'.fits' dustem_add_linear_params2grid,table_name,pd,iv_min,iv_max,iv_Nvalues,out_filename=output_table_name,plog=plog,show_seds=show_seds ;adding linear parameters abundance ;message,'Adding PAH0 abundances to grid',/continue ;pd=['(*!dustem_params).grains[0].MDUST_O_MH'] ;default_value=(dustem_get_param_values_default(pd))[0] ;iv_min=[default_value/10.] & iv_max=[default_value*100.] & iv_Nvalues=[100] & plog=[1] ;output_table_name=dir+test_str+model+'_MuseISRF_JWST_G0_Ypahadded_4Phangs_noionis'+isrf_class_str+'.fits' ;dustem_add_linear_params2grid,table_name,pd,iv_min,iv_max,iv_Nvalues,out_filename=output_table_name,plog=plog,show_seds=show_seds ;adding linear parameter PAH1 abundance ;message,'Adding PAH1 abundances to grid',/continue ;table_name=dir+test_str+model+'_MuseISRF_JWST_G0_Ypahadded_4Phangs_noionis'+isrf_class_str+'.fits' ;pd=['(*!dustem_params).grains[1].MDUST_O_MH'] ;default_value=(dustem_get_param_values_default(pd))[0] ;iv_min=[default_value/10.] & iv_max=[default_value*100.] & iv_Nvalues=[100] & plog=[1] ;output_table_name=dir+test_str+model+'_MuseISRF_JWST_G0_Ypah1added_Ypah2added_4Phangs_noionis'+isrf_class_str+'.fits' ;dustem_add_linear_params2grid,table_name,pd,iv_min,iv_max,iv_Nvalues,out_filename=output_table_name,plog=plog,show_seds=show_seds ;adding linear parameter VSG abundance ;message,'Adding VSG abundances to grid',/continue ;table_name=dir+test_str+model+'_MuseISRF_JWST_G0_Ypah1added_Ypah2added_4Phangs_noionis'+isrf_class_str+'.fits' ;pd=['(*!dustem_params).grains[3].MDUST_O_MH'] ;default_value=(dustem_get_param_values_default(pd))[0] ;iv_min=[default_value/10.] & iv_max=[default_value*100.] & iv_Nvalues=[100] & plog=[1] ;output_table_name=dir+test_str+model+'_MuseISRF_JWST_G0_Ypah1added_Ypah2added_Yvsgadded_4Phangs_noionis'+isrf_class_str+'.fits' ;dustem_add_linear_params2grid,table_name,pd,iv_min,iv_max,iv_Nvalues,out_filename=output_table_name,plog=plog,show_seds=show_seds END ENDCASE the_end: END