Commit 8d5fbc21f1de82f7ba986eede9a07dd94c0a565e

Authored by Ilyes Choubani
2 parents 25140f99 474c4b97
Exists in master

Merge branch 'master' of https://gitlab.irap.omp.eu/OV-GSO-DC/dustem-wrapper_idl

instrument_description.xcat
@@ -395,4 +395,5 @@ GISMO GISMO1 2000.00 MJy/sr nuInu=cste 0.0046389 @@ -395,4 +395,5 @@ GISMO GISMO1 2000.00 MJy/sr nuInu=cste 0.0046389
395 \Everything should be checked. 395 \Everything should be checked.
396 BOLOCAM BOLOCAM1 1105.4 MJy/sr nuInu=cste 0 396 BOLOCAM BOLOCAM1 1105.4 MJy/sr nuInu=cste 0
397 \================ ================================================================================ 397 \================ ================================================================================
398 - 398 +\This last dummy filter needs to be included to cope for spectrum data
  399 +UNKNOWN SPECTRUM -32768. MJy/sr NONE 0
src/idl/dustem_compute_polsed.pro
1 FUNCTION dustem_compute_polsed,p_dim,$ 1 FUNCTION dustem_compute_polsed,p_dim,$
2 -st=st,$  
3 -P_spec=P_spec,$  
4 -SP_spec=SP_spec,$  
5 -dustem_polfrac=dustem_polfrac,$  
6 -out_st=out_st,$  
7 -dustem_sed=dustem_sed,$  
8 -_extra=extra  
9 - 2 + st=st,$
  3 + P_spec=P_spec,$
  4 + SP_spec=SP_spec,$
  5 + dustem_polfrac=dustem_polfrac,$
  6 + dustem_sed=dustem_sed
10 7
11 ;+ 8 ;+
12 ; NAME: 9 ; NAME:
@@ -16,7 +13,7 @@ _extra=extra @@ -16,7 +13,7 @@ _extra=extra
16 ; CATEGORY: 13 ; CATEGORY:
17 ; Dustem 14 ; Dustem
18 ; CALLING SEQUENCE: 15 ; CALLING SEQUENCE:
19 -; sed=dustem_compute_polsed(p_dim[,st=][,P_spec=],[SP_spec=][dustem_polfrac=][out_st=][dustem_sed=][,_extra=][,/help]) 16 +; sed=dustem_compute_polsed(p_dim[,st=][,P_spec=],[SP_spec=][dustem_polfrac=][dustem_sed=][,/help])
20 ; INPUTS: 17 ; INPUTS:
21 ; p_dim = parameter values 18 ; p_dim = parameter values
22 ; OPTIONAL INPUT PARAMETERS: 19 ; OPTIONAL INPUT PARAMETERS:
@@ -29,7 +26,8 @@ _extra=extra @@ -29,7 +26,8 @@ _extra=extra
29 ; SP_spec = Dustem polarized emission fraction 26 ; SP_spec = Dustem polarized emission fraction
30 ; dustem_polfrac = Computed polarization emission fraction for spectrum points in !dustem_data 27 ; dustem_polfrac = Computed polarization emission fraction for spectrum points in !dustem_data
31 ; OPTIONAL OUTPUT PARAMETERS: 28 ; OPTIONAL OUTPUT PARAMETERS:
32 -; out_st = Dustem output structure 29 +; st = Dustem structure
  30 +; dustem_sed = Computed emission for spectrum points in !dustem_data
33 ; ACCEPTED KEY-WORDS: 31 ; ACCEPTED KEY-WORDS:
34 ; help = If set, print this help 32 ; help = If set, print this help
35 ; COMMON BLOCKS: 33 ; COMMON BLOCKS:
@@ -162,7 +160,7 @@ out_st=st @@ -162,7 +160,7 @@ out_st=st
162 ;GENERATING THE INTERPOLATES FOR POLFRAC (dustem_polfrac) 160 ;GENERATING THE INTERPOLATES FOR POLFRAC (dustem_polfrac)
163 if !run_lin then begin 161 if !run_lin then begin
164 162
165 - if not keyword_set(dustem_sed) then dustem_sed = dustem_compute_sed(p_dim,st,SED_spec) 163 + if not keyword_set(dustem_sed) then dustem_sed = dustem_compute_sed(p_dim,st=st,SED_spec=SED_spec)
166 164
167 If n_elements(dustem_sed) ne n_elements(dustem_polsed) then begin 165 If n_elements(dustem_sed) ne n_elements(dustem_polsed) then begin
168 if n_elements(dustem_sed) gt n_elements(dustem_polsed) then begin 166 if n_elements(dustem_sed) gt n_elements(dustem_polsed) then begin
src/idl/dustem_compute_stokes.pro
@@ -4,8 +4,6 @@ FUNCTION dustem_compute_stokes,p_dim,$ @@ -4,8 +4,6 @@ FUNCTION dustem_compute_stokes,p_dim,$
4 U_spec=U_spec,$ 4 U_spec=U_spec,$
5 PSI_spec=PSI_spec,$ 5 PSI_spec=PSI_spec,$
6 dustem_psi_em=dustem_psi_em,$ 6 dustem_psi_em=dustem_psi_em,$
7 - out_st=out_st,$  
8 - _extra=extra,$  
9 help=help 7 help=help
10 8
11 ;+ 9 ;+
@@ -16,7 +14,7 @@ FUNCTION dustem_compute_stokes,p_dim,$ @@ -16,7 +14,7 @@ FUNCTION dustem_compute_stokes,p_dim,$
16 ; CATEGORY: 14 ; CATEGORY:
17 ; Dustem 15 ; Dustem
18 ; CALLING SEQUENCE: 16 ; CALLING SEQUENCE:
19 -; out=dustem_compute_stokes(p_dim[,st][,Q_spec][,U_spec][,PSI_spec][,dustem_psi_em][,out_st=][,_extra=] 17 +; out=dustem_compute_stokes(p_dim[,st][,Q_spec][,U_spec][,PSI_spec][,dustem_psi_em]
20 ; INPUTS: 18 ; INPUTS:
21 ; p_dim = parameter values 19 ; p_dim = parameter values
22 ; OPTIONAL INPUT PARAMETERS: 20 ; OPTIONAL INPUT PARAMETERS:
@@ -26,7 +24,7 @@ FUNCTION dustem_compute_stokes,p_dim,$ @@ -26,7 +24,7 @@ FUNCTION dustem_compute_stokes,p_dim,$
26 ; out[0] = Computed Stokes Q emission for spectrum points in !dustem_data 24 ; out[0] = Computed Stokes Q emission for spectrum points in !dustem_data
27 ; out[1] = Computed Stokes U emission for spectrum points in !dustem_data 25 ; out[1] = Computed Stokes U emission for spectrum points in !dustem_data
28 ; OPTIONAL OUTPUT PARAMETERS: 26 ; OPTIONAL OUTPUT PARAMETERS:
29 -; out_st = Dustem output structure 27 +; st = Dustem output structure
30 ; Q_spec = Dustem Stokes Q emission 28 ; Q_spec = Dustem Stokes Q emission
31 ; U_spec = Dustem Stokes U emission 29 ; U_spec = Dustem Stokes U emission
32 ; PSI_spec = Dustem Polarization angle output in emission 30 ; PSI_spec = Dustem Polarization angle output in emission
@@ -55,8 +53,7 @@ IF keyword_set(help) THEN BEGIN @@ -55,8 +53,7 @@ IF keyword_set(help) THEN BEGIN
55 ENDIF 53 ENDIF
56 54
57 IF not keyword_set(st) THEN BEGIN 55 IF not keyword_set(st) THEN BEGIN
58 - dustem_activate_plugins,p_dim/(*(*!dustem_fit).param_init_values),st  
59 - ;st=dustem_run(p_dim) 56 + dustem_activate_plugins,p_dim/(*(*!dustem_fit).param_init_values),st=st
60 ENDIF 57 ENDIF
61 58
62 59
@@ -174,8 +171,6 @@ IF count_uspec NE 0 THEN BEGIN @@ -174,8 +171,6 @@ IF count_uspec NE 0 THEN BEGIN
174 if isa(dustem_used) then dustem_used[ind_uspec]=interpol(U_spec,st.polsed.wav,(((*(*!dustem_data).used).wav)[ind_uspec])) 171 if isa(dustem_used) then dustem_used[ind_uspec]=interpol(U_spec,st.polsed.wav,(((*(*!dustem_data).used).wav)[ind_uspec]))
175 ENDIF 172 ENDIF
176 173
177 -out_st=st  
178 -  
179 ;generating interpolates for Psi_em 174 ;generating interpolates for Psi_em
180 dustem_psi_em = 0.5*atan(dustem_used,dustem_qsed)/!dtor 175 dustem_psi_em = 0.5*atan(dustem_used,dustem_qsed)/!dtor
181 176
src/idl/dustem_filter2instru.pro
@@ -44,11 +44,11 @@ Nfilt=n_elements(filter) @@ -44,11 +44,11 @@ Nfilt=n_elements(filter)
44 44
45 ind1=lonarr(Nfilt) 45 ind1=lonarr(Nfilt)
46 FOR i=0L,Nfilt-1 DO BEGIN 46 FOR i=0L,Nfilt-1 DO BEGIN
47 - ind=where(!dustem_instrument_description.filter EQ strtrim(filter(i),2),count) 47 + ind=where(!dustem_instrument_description.filter EQ strtrim(filter[i],2),count)
48 IF count EQ 0 THEN BEGIN 48 IF count EQ 0 THEN BEGIN
49 message,'Filter: '+strtrim(filter(i),2)+' not found in instrument_description.xcat' 49 message,'Filter: '+strtrim(filter(i),2)+' not found in instrument_description.xcat'
50 ENDIF 50 ENDIF
51 - ind1(i)=ind(0) 51 + ind1[i]=ind[0]
52 ENDFOR 52 ENDFOR
53 53
54 instru=!dustem_instrument_description(ind1).instru 54 instru=!dustem_instrument_description(ind1).instru
src/idl/dustem_fit_intensity_example.pro
@@ -387,7 +387,7 @@ IF keyword_set(fits_save_and_restore) THEN BEGIN @@ -387,7 +387,7 @@ IF keyword_set(fits_save_and_restore) THEN BEGIN
387 ;==== plot result taken from the saved fits table 387 ;==== plot result taken from the saved fits table
388 res=*(*!dustem_fit).CURRENT_PARAM_VALUES 388 res=*(*!dustem_fit).CURRENT_PARAM_VALUES
389 IF !dustem_noobj THEN BEGIN 389 IF !dustem_noobj THEN BEGIN
390 - dustemwrap_plot_noobj,res,dustem_spectra_st,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)' 390 + dustemwrap_plot_noobj,res,dustem_spectra_st,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
391 ENDIF ELSE BEGIN 391 ENDIF ELSE BEGIN
392 dustemwrap_plot,res,dustem_spectra_st,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)' 392 dustemwrap_plot,res,dustem_spectra_st,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
393 ENDELSE 393 ENDELSE
src/idl/dustem_fit_sed_ext_pol_example.pro
@@ -418,7 +418,7 @@ ext.EXT_Q = toto[0] @@ -418,7 +418,7 @@ ext.EXT_Q = toto[0]
418 ext.EXT_U = toto[1] 418 ext.EXT_U = toto[1]
419 419
420 sed.StokesI = dustem_compute_sed(rv,st=st) 420 sed.StokesI = dustem_compute_sed(rv,st=st)
421 -toto = dustem_compute_stokes(rv,st=st,Qspec=dustem_qsed,Uspec=dustem_used) 421 +toto = dustem_compute_stokes(rv,st=st,Q_spec=dustem_qsed,U_spec=dustem_used)
422 sed.StokesQ = toto[0] 422 sed.StokesQ = toto[0]
423 sed.StokesU = toto[1] 423 sed.StokesU = toto[1]
424 424
src/idl/dustem_get_band_flux.pro
@@ -238,7 +238,8 @@ FUNCTION DUSTEM_GET_BAND_FLUX, dpath, inst, xs=xs, ys=ys, smi=smi, unit=unit, VE @@ -238,7 +238,8 @@ FUNCTION DUSTEM_GET_BAND_FLUX, dpath, inst, xs=xs, ys=ys, smi=smi, unit=unit, VE
238 for itp=0,ntype-1 do begin 238 for itp=0,ntype-1 do begin
239 inu = 1d17 * yw(ixw,itp)/nu/1d9 ; MJy/sr 239 inu = 1d17 * yw(ixw,itp)/nu/1d9 ; MJy/sr
240 y0 = INTERPOL(yw(ixw,itp),nu,wbd(k)) 240 y0 = INTERPOL(yw(ixw,itp),nu,wbd(k))
241 - cc = HFI_COLOR_CORRECTION( bp,bnm(k),bolo_cc, nu,inu ) 241 +; cc = HFI_COLOR_CORRECTION( bp,bnm(k),bolo_cc, nu,inu )
  242 + cc = HFI_COLOR_CORRECTION_DUSTEM( bp.name,bp.freq/1e9,bp.trans,bnm(k),bolo_cc, nu,inu )
242 smdat.(itx).ym(k,itp) = cc.cc * y0 ; SED (erg/cm2/s/sr) @ band center 243 smdat.(itx).ym(k,itp) = cc.cc * y0 ; SED (erg/cm2/s/sr) @ band center
243 smdat.(itx).flx(k,itp) = 1d17*cc.cc*y0/wbd(k)/1d9 ; in MJy/sr 244 smdat.(itx).flx(k,itp) = 1d17*cc.cc*y0/wbd(k)/1d9 ; in MJy/sr
244 smdat.(itx).cc(k,itp) = cc.cc 245 smdat.(itx).cc(k,itp) = cc.cc
src/idl/dustem_plugin_mbbdy.pro
@@ -42,7 +42,7 @@ ENDIF @@ -42,7 +42,7 @@ ENDIF
42 42
43 ;default values of input parameters 43 ;default values of input parameters
44 amp = 0.5 ; Amplitude of the modified black-body emission 44 amp = 0.5 ; Amplitude of the modified black-body emission
45 -temp = 19 ; Temperature of the dust species 45 +temp = 20.0 ; Temperature of the dust
46 beta = 1.8 ; Emissivity index 46 beta = 1.8 ; Emissivity index
47 47
48 w0=100. ; Theoretical wavelength (3THz) where optical depth equals unity 48 w0=100. ; Theoretical wavelength (3THz) where optical depth equals unity
@@ -53,7 +53,7 @@ smallp=0. @@ -53,7 +53,7 @@ smallp=0.
53 psi=0. 53 psi=0.
54 54
55 scope='ADD_SED+ADD_POLSED' 55 scope='ADD_SED+ADD_POLSED'
56 -paramtag=['Amp','T_MBB (K)','beta (Plaw_index)','p','Psi (deg)'] 56 +paramtag=['Amp',textoidl('T_{MBB}')+' [K]',textoidl('\beta'),'p','Psi [deg]']
57 57
58 IF keyword_set(key) THEN BEGIN 58 IF keyword_set(key) THEN BEGIN
59 59
src/idl/dustem_plugin_modify_dust_pol.pro
@@ -8,7 +8,7 @@ FUNCTION dustem_plugin_modify_dust_pol, key=key, val=val, scope=scope, paramtag= @@ -8,7 +8,7 @@ FUNCTION dustem_plugin_modify_dust_pol, key=key, val=val, scope=scope, paramtag=
8 ; CATEGORY: 8 ; CATEGORY:
9 ; DUSTEM Wrapper 9 ; DUSTEM Wrapper
10 ; CALLING SEQUENCE: 10 ; CALLING SEQUENCE:
11 -; a=dustem_plugin_modify_dust_pol(st,[key=][val=][,scope=][,paramtag=][,/help]) 11 +; a=dustem_plugin_modify_dust_pol(st,[key=][val=][,scope=][,paramtag=][,paramdefault=][,/help])
12 ; INPUTS: 12 ; INPUTS:
13 ; st = dustem structure 13 ; st = dustem structure
14 ; OPTIONAL INPUT PARAMETERS: 14 ; OPTIONAL INPUT PARAMETERS:
@@ -38,8 +38,6 @@ IF keyword_set(help) THEN BEGIN @@ -38,8 +38,6 @@ IF keyword_set(help) THEN BEGIN
38 GOTO,the_end 38 GOTO,the_end
39 ENDIF 39 ENDIF
40 40
41 -  
42 -  
43 IF keyword_set(scope) THEN BEGIN 41 IF keyword_set(scope) THEN BEGIN
44 out=0 42 out=0
45 GOTO, the_end 43 GOTO, the_end
@@ -57,7 +55,7 @@ if ~isa(!dustem_current) then begin @@ -57,7 +55,7 @@ if ~isa(!dustem_current) then begin
57 ENDIF else st=(*!dustem_current) 55 ENDIF else st=(*!dustem_current)
58 56
59 ;below are the default values for the plugin parameters 57 ;below are the default values for the plugin parameters
60 -smallp_fact=1. ;This is the default multiplicative factore to the dust polarization 58 +smallp_fact=1. ;This is the default dust polarization factor
61 psi=0. ;This is the default polarization angle 59 psi=0. ;This is the default polarization angle
62 60
63 IF keyword_set(key) THEN BEGIN 61 IF keyword_set(key) THEN BEGIN
@@ -102,7 +100,7 @@ RETURN, out @@ -102,7 +100,7 @@ RETURN, out
102 100
103 the_end: 101 the_end:
104 scope='REPLACE_POLSED' 102 scope='REPLACE_POLSED'
105 -paramtag=['p','Psi (deg)'] 103 +paramtag=['p',textoidl('\psi')+' [deg]']
106 104
107 105
108 END 106 END
src/idl/dustem_plugin_synchrotron.pro
@@ -52,8 +52,8 @@ psi=0. ;default polarization angle @@ -52,8 +52,8 @@ psi=0. ;default polarization angle
52 smallp=0.3;0.3 ;default polarization fraction 52 smallp=0.3;0.3 ;default polarization fraction
53 scope='ADD_SED+ADD_POLSED' 53 scope='ADD_SED+ADD_POLSED'
54 ;paramtag=['s (plaw_index)','Amp','p','Psi (deg)'] 54 ;paramtag=['s (plaw_index)','Amp','p','Psi (deg)']
55 -paramtag=[textoidl('\alpha_{CR}'),'Amp','p','Psi [deg]']  
56 -paramdefault=[s,A,psi,smallp] 55 +paramtag=[textoidl('\alpha_{CR}'),'Amp','p',textoidl('\psi')+' [deg]']
  56 +paramdefault=[s,A,smallp,psi]
57 IF keyword_set(key) THEN BEGIN 57 IF keyword_set(key) THEN BEGIN
58 58
59 ind1=where(key EQ 1,count1) 59 ind1=where(key EQ 1,count1)
src/idl/dustem_write_fits_table.pro
@@ -55,19 +55,16 @@ IF keyword_set(help) THEN BEGIN @@ -55,19 +55,16 @@ IF keyword_set(help) THEN BEGIN
55 ENDIF 55 ENDIF
56 56
57 ;===== run dustem to get predicted spectrum and sed 57 ;===== run dustem to get predicted spectrum and sed
58 -IF ptr_valid((*!dustem_data).sed) THEN BEGIN  
59 - stop 58 +IF ptr_valid((*!dustem_data).sed) THEN $
60 dustem_predicted_sed=dustem_compute_sed(*(*!dustem_fit).current_param_values,out_st=dustem_spectra_st) 59 dustem_predicted_sed=dustem_compute_sed(*(*!dustem_fit).current_param_values,out_st=dustem_spectra_st)
61 -ENDIF ELSE BEGIN  
62 -ENDELSE  
63 60
64 IF !run_pol THEN BEGIN 61 IF !run_pol THEN BEGIN
65 ;This is needed to compute Q,U of both SED and spectra 62 ;This is needed to compute Q,U of both SED and spectra
66 - dustem_predicted_polsed=dustem_compute_stokes(*(*!dustem_fit).current_param_values,bidon, $  
67 - dustem_predicted_Qsed,dustem_predicted_Used, $  
68 - dustem_predicted_Q_spec,dustem_predicted_U_spec,dustem_predicted_PSI_spec, $  
69 - dustem_psi_em,out_st=out_st)  
70 - 63 + dustem_predicted_polsed=dustem_compute_stokes(*(*!dustem_fit).current_param_values, $
  64 + Q_spec=dustem_predicted_Q_spec,U_spec=dustem_predicted_U_spec,PSI_spec=dustem_predicted_PSI_spec, $
  65 + dustem_psi_em=dustem_psi_em)
  66 + dustem_predicted_Qsed=dustem_predicted_polsed[0]
  67 + dustem_predicted_Used=dustem_predicted_polsed[1]
71 ;Same in extinction, but does not work in polarization extinction was not fitted. 68 ;Same in extinction, but does not work in polarization extinction was not fitted.
72 ; dustem_predicted_polext=dustem_compute_stokext(*(*!dustem_fit).current_param_values,bidon, $ 69 ; dustem_predicted_polext=dustem_compute_stokext(*(*!dustem_fit).current_param_values,bidon, $
73 ; dustem_predicted_Qext,dustem_predicted_Uext, $ 70 ; dustem_predicted_Qext,dustem_predicted_Uext, $
src/idl/dustemwrap_plot.pro
@@ -188,7 +188,7 @@ if isa((*!dustem_data).sed) then begin @@ -188,7 +188,7 @@ if isa((*!dustem_data).sed) then begin
188 ;Leaving as is. 188 ;Leaving as is.
189 189
190 ;JPB: need here to store values of current parameter values (including plugins) into !iteration_mouchard 190 ;JPB: need here to store values of current parameter values (including plugins) into !iteration_mouchard
191 - help,(*!dustem_fit).CURRENT_PARAM_VALUES ;This is not currently filled up ... 191 +; help,(*!dustem_fit).CURRENT_PARAM_VALUES ;This is not currently filled up ...
192 192
193 ;Below will work only for non plugin parameters 193 ;Below will work only for non plugin parameters
194 goto,skip1 194 goto,skip1
src/idl/dustemwrap_plot_noobj.pro
@@ -92,32 +92,33 @@ END @@ -92,32 +92,33 @@ END
92 ;This is also necessary for the plotting of the results of the fit (Last iteration) 92 ;This is also necessary for the plotting of the results of the fit (Last iteration)
93 IF not keyword_set(st) THEN BEGIN 93 IF not keyword_set(st) THEN BEGIN
94 ;Activation of the plugins is needed because of the plotting of the total emission model that includes them. 94 ;Activation of the plugins is needed because of the plotting of the total emission model that includes them.
95 - dustem_activate_plugins,p_dim/(*(*!dustem_fit).param_init_values),st ; 0/0 division case? 95 + dustem_activate_plugins,p_dim/(*(*!dustem_fit).param_init_values),st=st ; 0/0 division case?
96 96
97 ;# Emission 97 ;# Emission
98 ;if isa(!dustem_data.sed) then begin ;using !dustem_data instead of !dustem_show because in this release the user is compelled to fit IQU whether in M or X 98 ;if isa(!dustem_data.sed) then begin ;using !dustem_data instead of !dustem_show because in this release the user is compelled to fit IQU whether in M or X
99 if not keyword_set(dustem_sed) and isa((*!dustem_data).sed) then begin ;better test? 99 if not keyword_set(dustem_sed) and isa((*!dustem_data).sed) then begin ;better test?
100 100
101 - dustem_sed = dustem_compute_sed(p_dim,st,SED_spec) 101 + dustem_sed = dustem_compute_sed(p_dim,st=st,SED_spec=SED_spec)
102 102
103 if !run_pol && !run_lin then begin 103 if !run_pol && !run_lin then begin
104 -  
105 - dustem_polsed = dustem_compute_polsed(p_dim,st,P_spec,SP_spec,dustem_polfrac)  
106 - toto = dustem_compute_stokes(p_dim,st,dustem_qsed,dustem_used,Q_spec,U_spec,PSI_spec,dustem_psi_em) 104 + dustem_polsed = dustem_compute_polsed(p_dim,st=st,P_spec=P_spec,SP_spec=SP_spec,dustem_polfrac=dustem_polfrac)
  105 +; the following call need to change to include out instead of dustem_qsed/dustem_used?
  106 + toto = dustem_compute_stokes(p_dim,st=st,dustem_qsed,dustem_used,Q_spec=Q_spec,U_spec=U_spec,PSI_spec=PSI_spec,dustem_psi_em=dustem_psi_em)
107 107
108 -  
109 endif 108 endif
110 endif 109 endif
111 110
112 ;# Extinction 111 ;# Extinction
113 ; if isa(!dustem_data.ext) then begin 112 ; if isa(!dustem_data.ext) then begin
114 if not keyword_set(dustem_ext) and isa((*!dustem_data).ext) then begin 113 if not keyword_set(dustem_ext) and isa((*!dustem_data).ext) then begin
115 - dustem_ext = dustem_compute_ext(p_dim,st,EXT_spec) 114 + dustem_ext = dustem_compute_ext(p_dim,st=st,EXT_spec=EXT_spec)
116 115
117 if !run_pol && !run_lin then begin 116 if !run_pol && !run_lin then begin
118 117
119 - dustem_polext = dustem_compute_polext(p_dim,st,POLEXT_spec,SPEXT_spec,dustem_fpolext)  
120 - toto = dustem_compute_stokext(p_dim,st,dustem_qext,dustem_uext,QEXT_spec,UEXT_spec,PSIEXT_spec,dustem_psi_ext) 118 +; the following call need to change to include out instead of dustem_fpolext?
  119 + dustem_polext = dustem_compute_polext(p_dim,st=st,polext_spec=POLEXT_spec,spext_spec=SPEXT_spec,dustem_fpolext)
  120 +; the following call need to change to include out instead of QEXT/UEXT-spec?
  121 + toto = dustem_compute_stokext(p_dim,st=st,dustem_qext,dustem_uext,QEXT_spec=QEXT_spec,UEXT_spec=UEXT_spec,PSIEXT_spe=PSIEXT_spec,dustem_psi_ext=dustem_psi_ext)
121 122
122 endif 123 endif
123 endif 124 endif
@@ -128,12 +129,13 @@ ENDIF ELSE BEGIN ;st is provided @@ -128,12 +129,13 @@ ENDIF ELSE BEGIN ;st is provided
128 ;# Emission 129 ;# Emission
129 ;if isa(!dustem_data.sed) then begin 130 ;if isa(!dustem_data.sed) then begin
130 if not keyword_set(dustem_sed) and isa((*!dustem_data).sed) then begin 131 if not keyword_set(dustem_sed) and isa((*!dustem_data).sed) then begin
131 - dustem_sed = dustem_compute_sed(p_dim,st,SED_spec) 132 + dustem_sed = dustem_compute_sed(p_dim,st=st,SED_spec=SED_spec)
132 133
133 if !run_pol && !run_lin then begin 134 if !run_pol && !run_lin then begin
134 135
135 - dustem_polsed = dustem_compute_polsed(p_dim,st,P_spec,SP_spec,dustem_polfrac)  
136 - toto = dustem_compute_stokes(p_dim,st,dustem_qsed,dustem_used,Q_spec,U_spec,PSI_spec,dustem_psi_em) 136 + dustem_polsed = dustem_compute_polsed(p_dim,st=st,P_spec=P_spec,SP_spec=SP_spec,dustem_polfrac=dustem_polfrac)
  137 +; the following call need to change to include out instead of dustem_q/used?
  138 + toto = dustem_compute_stokes(p_dim,st=st,dustem_qsed,dustem_used,Q_spec=Q_spec,U_spec=U_spec,PSI_spec=PSI_spec,dustem_psi_em=dustem_psi_em)
137 ;stop 139 ;stop
138 endif 140 endif
139 endif 141 endif
@@ -143,12 +145,12 @@ ENDIF ELSE BEGIN ;st is provided @@ -143,12 +145,12 @@ ENDIF ELSE BEGIN ;st is provided
143 145
144 if not keyword_set(dustem_ext) and isa((*!dustem_data).ext) then begin 146 if not keyword_set(dustem_ext) and isa((*!dustem_data).ext) then begin
145 147
146 - dustem_ext = dustem_compute_ext(p_dim,st,EXT_spec) 148 + dustem_ext = dustem_compute_ext(p_dim,st=st,EXT_spec=EXT_spec)
147 149
148 if !run_pol && !run_lin then begin 150 if !run_pol && !run_lin then begin
149 151
150 - dustem_polext = dustem_compute_polext(p_dim,st,POLEXT_spec,SPEXT_spec,dustem_fpolext)  
151 - toto = dustem_compute_stokext(p_dim,st,dustem_qext,dustem_uext,QEXT_spec,UEXT_spec,PSIEXT_spec,dustem_psi_ext) 152 + dustem_polext = dustem_compute_polext(p_dim,st=st,POLEXT_spec=POLEXT_spec,SPEXT_spec=SPEXT_spec,dustem_fpolext)
  153 + toto = dustem_compute_stokext(p_dim,st=st,dustem_qext,dustem_uext,QEXT_spec=QEXT_spec,UEXT_spec=UEXT_spec,PSIEXT_spec=PSIEXT_spec,dustem_psi_ext=dustem_psi_ext)
152 154
153 endif 155 endif
154 endif 156 endif
@@ -176,7 +178,7 @@ new_mouchard.rchi2=(*!dustem_fit).rchi2 @@ -176,7 +178,7 @@ new_mouchard.rchi2=(*!dustem_fit).rchi2
176 ;Leaving as is. 178 ;Leaving as is.
177 179
178 ;JPB: need here to store values of current parameter values (including plugins) into !iteration_mouchard 180 ;JPB: need here to store values of current parameter values (including plugins) into !iteration_mouchard
179 -help,(*!dustem_fit).CURRENT_PARAM_VALUES ;This is not currently filled up ... 181 +;help,(*!dustem_fit).CURRENT_PARAM_VALUES ;This is not currently filled up ...
180 182
181 ;Below will work only for non plugin parameters 183 ;Below will work only for non plugin parameters
182 goto,skip1 184 goto,skip1