Commit a9349311a090f80663f9a1b7b3882a64c1868e1d

Authored by Annie Hughes
1 parent bb69363f
Exists in master

finished for tutorial

Showing 1 changed file with 25 additions and 39 deletions   Show diff stats
src/idl/dustem_myisrf_example.pro
... ... @@ -5,6 +5,7 @@ PRO dustem_myisrf_example,model=model $
5 5 ,postscript=postscript $
6 6 ,fits_save_and_restore=fits_save_and_restore $
7 7 ,wait=wait $
  8 + ,noobj=noobj $
8 9 ,verbose=verbose $
9 10 ,help=help
10 11  
... ... @@ -64,6 +65,7 @@ PRO dustem_myisrf_example,model=model $
64 65 ; wait = if set, wait this many seconds between each step of
65 66 ; the code (for illustration purposes)
66 67 ; verbose = if set, subroutines will run in verbose mode
  68 +; noobj = if set, runs with no object graphics
67 69 ;
68 70 ; COMMON BLOCKS:
69 71 ; None
... ... @@ -125,53 +127,35 @@ pd = [ $
125 127 '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction
126 128 'dustem_plugin_modify_isrf_1', $ ; Amplitude of user-defined ISRF
127 129 'dustem_plugin_synchrotron_2'] ;Synchrotron amplitude at 10 mm
128   -iv = [5.4e-4,0.1, 0.01]
  130 +iv = [5.4e-4, 0.1, 0.01]
129 131 Npar=n_elements(pd)
130 132 ulimed=replicate(0,Npar)
131 133 llimed=replicate(1,Npar)
132 134 llims=replicate(1.e-15,Npar)
133   -; To suppress the
  135 +; To suppress the Mathis field altogether
134 136 ;fpd=['(*!dustem_params).G0']
135   -;fiv=[1.e-10]
  137 +;fiv=[1.e-12]
136 138  
137 139  
138   -;; ;=== AN EXAMPLE FOR DL07 (or DL01 or WD01_RV5P5B)
  140 +;; ;=== AN EXAMPLE FOR DL07
139 141 ;; ;=== Here we fit the PAH abundances of the model, and the amplitude
140 142 ;; ;=== of a user-supplied ISRF. A synchrotron component is included
141 143 ;; ;=== The other grain parameters are fixed to their default values.
142 144 ;; ;=== The free parameters are all lower-bounded at zero.
143 145 ;; use_model='DL07' ; you should specify this above, or in the command line
144   -pd = [ $
145   - '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction
146   - '(*!dustem_params).grains(1).mdust_o_mh',$ ;PAH1 mass fraction
147   - 'dustem_plugin_modify_isrf_1', $ ; Ampitude of user-defined ISRF
148   - 'dustem_plugin_synchrotron_2'] ;Synchrotron amplitude at 10 mm
149   -iv = [5.4e-4, 5.4e-4, 0.1, 0.01]
150   -Npar=n_elements(pd)
151   -ulimed=replicate(0,Npar)
152   -llimed=replicate(1,Npar)
153   -llims=replicate(1.e-15,Npar)
154   -fpd=['(*!dustem_params).G0']
155   - '(*!dustem_params).gas.G0']
156   - fiv=[1.,1.]
157   -
158   -;=== AN EXAMPLE FOR DBP90
159   -;=== Here we fit the PAH abundances of the model, and the amplitude
160   -;=== of a user-supplied ISRF. A synchrotron component is included
161   -;=== The other grain parameters are fixed to their default values.
162   -;=== The free parameters are all lower-bounded at zero.
163   -use_model='DBP90' ; you should specify this above, or in the command line
164   -pd = [ $
165   - '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction
166   - 'dustem_plugin_modify_isrf_1', $ ; Ampitude of user-defined ISRF
167   - 'dustem_plugin_synchrotron_2'] ;Synchrotron amplitude at 10 mm
168   -iv = [5.4e-4,0.1, 0.01]
169   -Npar=n_elements(pd)
170   -ulimed=replicate(0,Npar)
171   -llimed=replicate(1,Npar)
172   -llims=replicate(1.e-15,Npar)
173   -fpd=['(*!dustem_params).G0']
174   -fiv=[1.]
  146 +;; pd = [ $
  147 +;; '(*!dustem_params).grains(0).mdust_o_mh',$ ;PAH0 mass fraction
  148 +;; '(*!dustem_params).grains(1).mdust_o_mh',$ ;PAH1 mass fraction
  149 +;; 'dustem_plugin_modify_isrf_1', $ ; Ampitude of user-defined ISRF
  150 +;; 'dustem_plugin_synchrotron_2'] ;Synchrotron amplitude at 10 mm
  151 +;; iv = [5.4e-4, 5.4e-4, 0.1, 0.01]
  152 +;; Npar=n_elements(pd)
  153 +;; ulimed=replicate(0,Npar)
  154 +;; llimed=replicate(1,Npar)
  155 +;; llims=replicate(1.e-15,Npar)
  156 +;; ; To suppress the Mathis field altogether
  157 +;; ;fpd=['(*!dustem_params).gas.G0']
  158 +;; ;fiv=[1.e-12]
175 159  
176 160  
177 161 if keyword_set(wait) then begin
... ... @@ -179,10 +163,10 @@ if keyword_set(wait) then begin
179 163 wait,wait
180 164 end
181 165  
182   -
183 166 dustem_init,model=use_model,polarization=use_polarization
184 167 !dustem_nocatch=1
185 168 !dustem_verbose=use_verbose
  169 +IF keyword_set(noobj) THEN !dustem_noobj=1
186 170  
187 171 ;== Fill a structure with default inputs to the model. This
188 172 ;== includes the default ISRF, which we want here just for plotting a
... ... @@ -194,7 +178,7 @@ st_model=dustem_read_all(dir_in)
194 178 if not keyword_set(isrf_file) then begin
195 179 mywaves=[]
196 180 my_isrf_file='./myisrf_3bb_8000K.dat'
197   - myisrf=dustem_create_rfield([8000,8000,8000],wdil=[1.d-11,1.d-11,1.d-11],isrf=1,fname=my_isrf_file,x=mywaves)
  181 + myisrf=dustem_create_rfield([8000,8000,8000],wdil=[1.d-11,1.d-11,1.d-11],isrf=0,fname=my_isrf_file,x=mywaves)
198 182 ;myisrf=dustem_create_rfield([3500,4000,5500,6500,8000],wdil=[1.d-13,1.d-13,1.d-13,1.d-13,1.d-13],isrf=1,fname='./myisrf_mathis_5bb.dat',x=mywaves)
199 183 ;myisrf=dustem_create_rfield([3500,4000,5500,6500,8000],wdil=[1.d-13,1.d-13,1.d-13,1.d-13,1.d-13],isrf=2,fname='./myisrf_habing_5bb.dat',x=mywaves)
200 184 ;myisrf=dustem_create_rfield([3500,4000,5500,6500,8000],wdil=[1.d-13,1.d-13,1.d-13,1.d-13,1.d-13],isrf=0,fname='./myisrf_5bb.dat',x=mywaves)
... ... @@ -221,8 +205,10 @@ al_legend,/top,/right,clear=0,box=0 $
221 205 ,thick=2,charsize=1.3
222 206  
223 207 ;=== READ THE ISRF
224   -if keyword_set(isrf_file) then !dustem_isrf_file=ptr_new(isrf_file)
225   -
  208 +if keyword_set(isrf_file) then begin
  209 + message,'Setting ISRF component from file: '+isrf_file,/info
  210 + !dustem_isrf_file=ptr_new(isrf_file)
  211 +end
226 212  
227 213 ;=== READ EXAMPLE SED DATA:
228 214 dir=!dustem_wrap_soft_dir+'/Data/EXAMPLE_OBSDATA/'
... ...