Blame view

LabTools/IRAP/JPB/make_sed_phangs_tables.pro 3.13 KB
d6343d56   Jean-Philippe Bernard   First commit
1
2
3
PRO make_sed_phangs_tables,test=test,show_seds=show_seds

;make_sed_phangs_tables
0ed148cc   Jean-Philippe Bernard   improved
4
5
6
;make_sed_phangs_tables,/test,/show_seds

;=== This is needed for Phangs work
80d9cb5e   Jean-Philippe Bernard   improved pathes
7
8
;defsysv,'!phangs_data_dir','/Volumes/PILOT_FLIGHT1/PHANGS/'
;defsysv,'!phangs_data_dir','/data/projects/phangs/'
0ed148cc   Jean-Philippe Bernard   improved
9
;=== This is where the grids will be written
80d9cb5e   Jean-Philippe Bernard   improved pathes
10
;dir=!dustem_wrap_soft_dir+'/Grids/'
a1668e0f   Jean-Philippe Bernard   improved path
11
dir=!phangs_data_dir+'/ISRF/GRIDS/'
d6343d56   Jean-Philippe Bernard   First commit
12
13

dustem_define_la_common
0ed148cc   Jean-Philippe Bernard   improved
14
15
16
17
18
19
20
21
22
23

use_grid='grid2'

IF use_grid EQ 'grid1' THEN goto,grid1
IF use_grid EQ 'grid2' THEN goto,grid2

;======= This is to produce a grid with the DBP90 model for G0 and PAH abundance
grid1:

!quiet=1
d6343d56   Jean-Philippe Bernard   First commit
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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] 
log=[1,1,1]

fpd=[]
fiv=[]

d6343d56   Jean-Philippe Bernard   First commit
39
40
41
42
43
44
45
46
47
IF keyword_set(test) THEN BEGIN
   iv_Nvalues=[5,3,3]
   table_name=dir+'TEST_DBP90_JWST_G0_YPAH_YVSG_4Phangs.fits'
ENDIF ELSE BEGIN
	iv_Nvalues=[50,20,20]
	table_name=dir+'DBP90_JWST_G0_YPAH_YVSG_4Phangs.fits'
ENDELSE

dustem_init,model=model
0ed148cc   Jean-Philippe Bernard   improved
48
;=== select filters to be used for the grid
d6343d56   Jean-Philippe Bernard   First commit
49
50
51
52
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,log=log,show_seds=show_seds

0ed148cc   Jean-Philippe Bernard   improved
53
54
55
56
goto,the_end

grid2:

1a792851   Jean-Philippe Bernard   made quiet
57
!quiet=1
0ed148cc   Jean-Philippe Bernard   improved
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
model='DBP90'

;======= This is to produce a grid with the DL07 model for G0 and PAH abundance and ISRF from Muse data
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] 
log=[1,1,1]

;fpd=['*!dustem_params.gas.g0','*!dustem_params.g0','dustem_plugin_phangs_class_isrf_1']             ;ISRF class to be used
;fiv=[-1.,1.e-13,isrf_class]

!quiet=1
show_seds=1
Nclass=31L
FOR isrf_class=0L,Nclass-1 DO BEGIN
   ;isrf_class=29L    ;This is for ISRF class
   fpd=['(*!dustem_params).gas.g0','(*!dustem_params).g0','dustem_plugin_phangs_class_isrf_1']             ;ISRF class to be used
   fiv=[-1.,1.,isrf_class]

   isrf_class_str='_isrfclass'+strtrim(isrf_class,2)
   IF keyword_set(test) THEN BEGIN
      iv_Nvalues=[5,3,3]
      table_name=dir+'TEST_DBP90_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs'+isrf_class_str+'.fits'
   ENDIF ELSE BEGIN
      iv_Nvalues=[50,20,20]
      table_name=dir+'DBP90_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs'+isrf_class_str+'.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_filters).pacs.filter_names,(*!dustem_filters).spire.filter_names]

   dustem_make_sed_table,model,pd,iv_min,iv_max,iv_Nvalues,fpd=fpd,fiv=fiv,filename=table_name,filters=filters,log=log,show_seds=show_seds,isrf_class=isrf_class,/use_isrf_class

ENDFOR

d6343d56   Jean-Philippe Bernard   First commit
98
99
stop

0ed148cc   Jean-Philippe Bernard   improved
100
101
the_end:

d6343d56   Jean-Philippe Bernard   First commit
102
END