Blame view

LabTools/IRAP/JPB/make_sed_phangs_tables.pro 7.4 KB
3b79f061   Jean-Philippe Bernard   improved
1
PRO make_sed_phangs_tables,test=test,show_seds=show_seds,grid_type=grid_type,isrf_class=isrf_class
d6343d56   Jean-Philippe Bernard   First commit
2

e2ce1dee   Jean-Philippe Bernard   defined grid stru...
3
;make_sed_phangs_tables,/show   ;That's a test
ea1acf9c   Jean-Philippe Bernard   improved
4
;make_sed_phangs_tables,grid_type=1,/show_seds,/test   ;That's a test
3b79f061   Jean-Philippe Bernard   improved
5
;make_sed_phangs_tables,/test,grid_type=2,/show_seds,isrf_class=15
14ae4f23   Jean-Philippe Bernard   improved
6
;make_sed_phangs_tables,/test,grid_type=3,/show_seds
0ed148cc   Jean-Philippe Bernard   improved
7
8

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

dustem_define_la_common
0ed148cc   Jean-Philippe Bernard   improved
16

54583f40   Jean-Philippe Bernard   improved
17
use_grid_type=0
3b79f061   Jean-Philippe Bernard   improved
18
19
20
21
22
IF keyword_set(grid_type) THEN BEGIN
  use_grid_type=grid_type
ENDIF

CASE use_grid_type OF
54583f40   Jean-Philippe Bernard   improved
23
24
25
26
27
28
29
30
31
32
   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]
e2ce1dee   Jean-Philippe Bernard   defined grid stru...
33
      plog=[1]
54583f40   Jean-Philippe Bernard   improved
34
35
36
37
38
      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
e2ce1dee   Jean-Philippe Bernard   defined grid stru...
39
40
41
      ;=== 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
54583f40   Jean-Philippe Bernard   improved
42
   END
14ae4f23   Jean-Philippe Bernard   improved
43
   1: BEGIN ;======= This is to produce a grid with the DBP90 model + Mathis field for G0 and PAH abundance
3b79f061   Jean-Philippe Bernard   improved
44
45
      !quiet=1
      model='DBP90'
3b79f061   Jean-Philippe Bernard   improved
46
47
48
49
50
      ;===== 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
3b79f061   Jean-Philippe Bernard   improved
51
52
      iv_min =   [0.1,1.e-4,1.e-4]
      iv_max =   [100,1.e-1,1.e-1] 
e2ce1dee   Jean-Philippe Bernard   defined grid stru...
53
      plog=[1,1,1]
3b79f061   Jean-Philippe Bernard   improved
54
55
      fpd=[]
      fiv=[]
3b79f061   Jean-Philippe Bernard   improved
56
      IF keyword_set(test) THEN BEGIN
54583f40   Jean-Philippe Bernard   improved
57
58
         ;iv_Nvalues=[5,3,3]
         iv_Nvalues=[2,2,2]
429a6075   Jean-Philippe Bernard   improved
59
         table_name=dir+'TEST_'+model+'_JWST_G0_YPAH_YVSG_4Phangs.fits'
3b79f061   Jean-Philippe Bernard   improved
60
61
      ENDIF ELSE BEGIN
      	iv_Nvalues=[50,20,20]
429a6075   Jean-Philippe Bernard   improved
62
      	table_name=dir+model+'_JWST_G0_YPAH_YVSG_4Phangs.fits'
3b79f061   Jean-Philippe Bernard   improved
63
      ENDELSE
3b79f061   Jean-Philippe Bernard   improved
64
65
66
      dustem_init,model=model
      ;=== select filters to be used for the grid
      filters=[(*!dustem_filters).nircam.filter_names,(*!dustem_filters).miri.filter_names]
e2ce1dee   Jean-Philippe Bernard   defined grid stru...
67
      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
3b79f061   Jean-Philippe Bernard   improved
68
   END
14ae4f23   Jean-Philippe Bernard   improved
69
   2: BEGIN          ;This is DPB90 model with PHANGS ISRF classes
3b79f061   Jean-Philippe Bernard   improved
70
      !quiet=1
429a6075   Jean-Philippe Bernard   improved
71
      model='DBP90'   ;This is to use the DBP90 dust model
429a6075   Jean-Philippe Bernard   improved
72
73
      ;======= 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
3b79f061   Jean-Philippe Bernard   improved
74
75
76
77
78
79
      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] 
e2ce1dee   Jean-Philippe Bernard   defined grid stru...
80
      plog=[1,1,1]
3b79f061   Jean-Philippe Bernard   improved
81
      Nclass=31L
ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
82
      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
3b79f061   Jean-Philippe Bernard   improved
83
      dustem_init,model=model
b099d16c   Jean-Philippe Bernard   using set up fortran
84
      fortran_user=dustem_set_up_fortran(/random_name)   ;use a random fortran number
1dfe610a   Jean-Philippe Bernard   improved
85
86
      !dustem_verbose=0
      (*!dustem_params).KEYWORDS='quiet '+(*!dustem_params).KEYWORDS    ;This makes Fortran be quiet too
3b79f061   Jean-Philippe Bernard   improved
87
88
      ;=== select filters to be used for the grid
      filters=[(*!dustem_filters).nircam.filter_names,(*!dustem_filters).miri.filter_names, $
429a6075   Jean-Philippe Bernard   improved
89
               (*!dustem_filters).iras.filter_names,(*!dustem_filters).pacs.filter_names,(*!dustem_filters).spire.filter_names]
3b79f061   Jean-Philippe Bernard   improved
90
      IF keyword_set(isrf_class) THEN BEGIN  ;do just one table
429a6075   Jean-Philippe Bernard   improved
91
         use_isrf_class=isrf_class
3b79f061   Jean-Philippe Bernard   improved
92
      ENDIF ELSE BEGIN
429a6075   Jean-Philippe Bernard   improved
93
         use_isrf_class=0  ;This is for Mathis field
3b79f061   Jean-Philippe Bernard   improved
94
      ENDELSE
ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
95
      fiv=[-1.,1.,use_isrf_class,0.]     ;This sets the ISRF class to the requested value. alos removes ionising photons.
429a6075   Jean-Philippe Bernard   improved
96
97
98
      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
d2fdd389   Jean-Philippe Bernard   modified
99
         iv_Nvalues=[2,2,2]
ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
100
         table_name=dir+'TEST_'+model+'_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs_noionis'+isrf_class_str+'.fits'
429a6075   Jean-Philippe Bernard   improved
101
102
      ENDIF ELSE BEGIN
         iv_Nvalues=[50,20,20]
ccfa6760   Jean-Philippe Bernard   corrected ISRF cl...
103
         table_name=dir+model+'_MuseISRF_JWST_G0_YPAH_YVSG_4Phangs_noionis'+isrf_class_str+'.fits'
429a6075   Jean-Philippe Bernard   improved
104
      ENDELSE
e2ce1dee   Jean-Philippe Bernard   defined grid stru...
105
      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
3b79f061   Jean-Philippe Bernard   improved
106
   END
14ae4f23   Jean-Philippe Bernard   improved
107
108
109
110
111
112
   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 = [ $
c2457c07   Jean-Philippe Bernard   improved
113
114
115
116
           '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
14ae4f23   Jean-Philippe Bernard   improved
117
            ]
d339db1c   Jean-Philippe Bernard   improved
118
119
      ;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]
14ae4f23   Jean-Philippe Bernard   improved
120
      iv_max =   [100,0.02,1.e-1,1.e-1]
e2ce1dee   Jean-Philippe Bernard   defined grid stru...
121
      plog=[1,0,1,1]
d339db1c   Jean-Philippe Bernard   improved
122
      fpd=['dustem_plugin_dl07_isrf_model_2', $ ;alpha=1
c2457c07   Jean-Philippe Bernard   improved
123
124
           'dustem_plugin_dl07_isrf_model_4' $  ;Umax=1.e7
           ]
d339db1c   Jean-Philippe Bernard   improved
125
      fiv=[2.,1.e7]     ;This sets the fixed parameters
14ae4f23   Jean-Philippe Bernard   improved
126
127
      dustem_init,model=model
      fortran_user=dustem_set_up_fortran(/random_name)   ;use a random fortran number
d339db1c   Jean-Philippe Bernard   improved
128
129
130
131
132
      !dustem_verbose=1
      !quiet=0
      !dustem_nocatch=1
      ;!dustem_verbose=0
      ;(*!dustem_params).KEYWORDS='quiet '+(*!dustem_params).KEYWORDS    ;This makes Fortran be quiet too
ea2707c1   Jean-Philippe Bernard   improved
133
134
135
      ;=== 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]
14ae4f23   Jean-Philippe Bernard   improved
136
137
      ;define the number of free parameters in the grid and the grid fits table name
      IF keyword_set(test) THEN BEGIN
ea2707c1   Jean-Philippe Bernard   improved
138
139
         ;iv_Nvalues=[2,2,3,3]
         iv_Nvalues=[2,2,2,2]
c2457c07   Jean-Philippe Bernard   improved
140
         table_name=dir+'TEST_'+model+'_DL07ISRF_YPAH_YVSG_Umin_gamma_4Phangs'+'.fits'
14ae4f23   Jean-Philippe Bernard   improved
141
142
      ENDIF ELSE BEGIN
         iv_Nvalues=[6,5,20,20]
c2457c07   Jean-Philippe Bernard   improved
143
         table_name=dir+model+'_DL07ISRF_YPAH_YVSG_Umin_gamma_4Phangs'+'.fits'
14ae4f23   Jean-Philippe Bernard   improved
144
      ENDELSE
e2ce1dee   Jean-Philippe Bernard   defined grid stru...
145
      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
14ae4f23   Jean-Philippe Bernard   improved
146
147
   END

3b79f061   Jean-Philippe Bernard   improved
148
ENDCASE
0ed148cc   Jean-Philippe Bernard   improved
149

d6343d56   Jean-Philippe Bernard   First commit
150

0ed148cc   Jean-Philippe Bernard   improved
151
152
the_end:

d6343d56   Jean-Philippe Bernard   First commit
153
END