Commit 96a72c8b649ee5ffa4e277734084239eb01d4e05

Authored by Ilyes Choubani
1 parent 0c487640
Exists in master

seperating xrange and yrange for E(M)ission and E(X)tinction. Ask JP what we wan…

…t to exactly call them.
src/idl/dustem_mpfit_data.pro
... ... @@ -62,7 +62,7 @@ if !run_pol then begin
62 62  
63 63 ind_data_tag=dustem_data_tag(count=count_data_tag)
64 64 tagnames=tag_names(!dustem_data)
65   - testpol = tagnames EQ 'POLSED' or tagnames EQ 'POLEXT' or tagnames EQ 'POLFRAC' or tagnames EQ 'PSI_EM' or tagnames EQ 'PSI_EXT'
  65 + testpol = tagnames EQ 'POLSED' or tagnames EQ 'POLEXT' or tagnames EQ 'POLFRAC' or tagnames EQ 'PSI_EM' or tagnames EQ 'PSI_EXT' or tagnames EQ 'FPOLEXT'
66 66 data_ind=where(~testpol,ctestpol)
67 67 if ctestpol ne 0 then begin
68 68 match,ind_data_tag,data_ind,ind1,ind2 ;not using match2 because when matching indices, if the first is 0 it doesn't count which is wrong.
... ... @@ -134,6 +134,7 @@ print, 'Final parameters : ', p_dim
134 134 ;The above was removed because it seems it was not used anywhere.
135 135 ;!dustem_fit_sed=ptr_new(dustem_compute_sed(p_dim,st,cont=cont,_extra=extra))
136 136 (*!dustem_fit).current_param_errors=ptr_new(p_er_dim)
  137 +dustemwrap_plot,p_dim,stp,xr=_extra.xr,/xstyle,yr=_extra.yr,/ysty,/ylog,/xlog,title=_extra.title
137 138 RETURN, p_dim
138 139  
139 140 END
... ...
src/idl/dustem_mpfit_run.pro
... ... @@ -234,6 +234,7 @@ ENDFOR
234 234  
235 235  
236 236 ;Plotting only every successful dustem run
  237 +
237 238 if !dustem_iter.act NE !dustem_iter.prv or !dustem_iter.prv EQ 1 then begin
238 239 dustemwrap_plot,p_dim,st,dustem_sed,SED_spec,dustem_qsed,Q_spec,dustem_used,U_spec,dustem_polsed,P_spec,dustem_polfrac,SP_spec, dustem_psi_em, PSI_spec,dustem_ext,EXT_spec,dustem_qext,QEXT_spec,dustem_uext,UEXT_spec,dustem_polext,POLEXT_spec,dustem_fpolext,SPEXT_spec,dustem_psi_ext,PSIEXT_spec,_extra=_extra
239 240 if !dustem_iter.act EQ 1 then begin
... ...
src/idl/dustemcgwin_dataset.pro
... ... @@ -23,11 +23,29 @@ clrs_plgns = ['Rosy Brown','Gold','Light Coral','Slate Blue','Dark Khaki','Salmo
23 23  
24 24 scopes=tag_names((*!dustem_plugin))
25 25 tgnms_extra = tag_names(_extra)
26   -ind_xr = where(strmid(tgnms_extra,0,2) eq 'XR')
27   -ind_yr = where(strmid(tgnms_extra,0,2) eq 'YR')
28   -if ind_xr EQ -1 then xr=[1.00E+00,1.00E+05] else xr=(_extra.(ind_xr))
29   -if ind_yr EQ -1 then yr=[5.00E-03,1.00E+08] else yr=(_extra.(ind_yr))
30 26  
  27 +ind_xrm = where(strmid(tgnms_extra,0,4) EQ 'XR_M',ct_xrm)
  28 +ind_xrx = where(strmid(tgnms_extra,0,4) EQ 'XR_X',ct_xrx)
  29 +ind_yrm = where(strmid(tgnms_extra,0,4) EQ 'YR_M',ct_yrm)
  30 +ind_yrx = where(strmid(tgnms_extra,0,4) EQ 'YR_X',ct_yrx)
  31 +ct_m = ct_xrm+ct_yrm
  32 +ct_x = ct_xrx+ct_yrx
  33 +
  34 +IF ct_m+ct_x NE 0 THEN BEGIN
  35 +
  36 + IF ct_xrm NE 0 THEN xr_m = (_extra.(ind_xrm))
  37 + IF ct_xrx NE 0 THEN xr_x = (_extra.(ind_xrx))
  38 + IF ct_yrm NE 0 THEN yr_m = (_extra.(ind_yrm))
  39 + IF ct_yrx NE 0 THEN yr_x = (_extra.(ind_yrx))
  40 +
  41 +ENDIF ELSE BEGIN
  42 +
  43 + ind_xr = where(strmid(tgnms_extra,0,2) eq 'XR')
  44 + ind_yr = where(strmid(tgnms_extra,0,2) eq 'YR')
  45 + if ind_xr EQ -1 then xr=[1.00E+00,1.00E+05] else xr=(_extra.(ind_xr))
  46 + if ind_yr EQ -1 then yr=[5.00E-03,1.00E+08] else yr=(_extra.(ind_yr))
  47 +
  48 +ENDELSE
31 49  
32 50 frmt0='(A46)'
33 51 frmt1='(1E11.4)'
... ... @@ -44,13 +62,13 @@ frmt2='(10F10.2)'
44 62 ;I DO NOT REMEMBER RUNNING ANY OF THE TESTS HERE.
45 63  
46 64  
47   -
48 65 if keyword_set(dataset) then begin
49 66 ;!run_pol is implied for QSED/USED/POLSED etc...
50 67 Case strupcase(dataset) of
51 68  
52 69 'SED': begin
53 70  
  71 + IF ct_m NE 0 then xr=xr_m & yr=yr_m
54 72  
55 73 vectw=DINDGEN(1001)*(alog10(1E7) - alog10(1E5))/(1000 - 1L) + alog10(1E5)
56 74 vectw=10^vectw[1:*]
... ... @@ -199,7 +217,7 @@ if keyword_set(dataset) then begin
199 217  
200 218  
201 219 ;Plotting of frequency axis
202   - cgaxis, xaxis=1, xlog=1, xs=1, xminor=10, xticklen=0.05, xrange=((!const.c*1E6/(_extra.(ind_xr)))*1E-9),charsize=1.15,title=textoidl('\nu (GHz)')
  220 + cgaxis, xaxis=1, xlog=1, xs=1, xminor=10, xticklen=0.05, xrange=((!const.c*1E6/(xr))*1E-9),charsize=1.15,title=textoidl('\nu (GHz)')
203 221  
204 222 xyouts,pospltxt[0],pospltxt[1],textoidl('I_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.3;,charthick=2.0
205 223  
... ... @@ -253,6 +271,8 @@ if keyword_set(dataset) then begin
253 271 ; xr=[0.01,30]
254 272 ; yr=[1.00E-06,10]
255 273  
  274 + IF ct_x NE 0 then xr=xr_x & yr=yr_x
  275 +
256 276 vectw=DINDGEN(1001)*(alog10(1E7) - alog10(1E5))/(1000 - 1L) + alog10(1E5)
257 277 vectw=10^vectw[1:*]
258 278 vectw=[wavs,vectw]
... ... @@ -458,6 +478,7 @@ if keyword_set(dataset) then begin
458 478  
459 479 'POLEXT': begin
460 480  
  481 + IF ct_x NE 0 then xr=xr_x & yr=yr_x
461 482  
462 483 vectw=DINDGEN(1001)*(alog10(1E7) - alog10(1E5))/(1000 - 1L) + alog10(1E5)
463 484 vectw=10^vectw[1:*]
... ... @@ -654,6 +675,7 @@ if keyword_set(dataset) then begin
654 675  
655 676 'POLSED': begin
656 677  
  678 + IF ct_m NE 0 then xr=xr_m & yr=yr_m
657 679  
658 680 vectw=DINDGEN(1001)*(alog10(1E7) - alog10(1E5))/(1000 - 1L) + alog10(1E5)
659 681 vectw=10^vectw[1:*]
... ... @@ -792,7 +814,7 @@ if keyword_set(dataset) then begin
792 814  
793 815  
794 816 ;Plotting of frequency axis
795   - cgaxis, xaxis=1, xlog=1, xs=1, xminor=10, xticklen=0.05, xrange=((!const.c*1E6/(_extra.(ind_xr)))*1E-9),charsize=1.15,title=textoidl('\nu (GHz)')
  817 + cgaxis, xaxis=1, xlog=1, xs=1, xminor=10, xticklen=0.05, xrange=((!const.c*1E6/(xr))*1E-9),charsize=1.15,title=textoidl('\nu (GHz)')
796 818  
797 819 xyouts,pospltxt[0],pospltxt[1],textoidl('P_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.3;,charthick=2.0
798 820  
... ... @@ -841,6 +863,8 @@ if keyword_set(dataset) then begin
841 863 end
842 864  
843 865 'POLFRAC': begin
  866 +
  867 + IF ct_m NE 0 then xr=xr_m & yr=yr_m
844 868  
845 869 idx_filt=where((*!dustem_data.polfrac).filt_names NE 'SPECTRUM',ct_filt)
846 870 idx_spec=where((*!dustem_data.polfrac).filt_names EQ 'SPECTRUM',ct_spec)
... ... @@ -984,7 +1008,9 @@ if keyword_set(dataset) then begin
984 1008 end
985 1009  
986 1010 'FPOLEXT': BEGIN ; For completeness (not sure of the physical usefulness of this qauntity )
987   -
  1011 +
  1012 + IF ct_x NE 0 then xr=xr_x & yr=yr_x
  1013 +
988 1014 idx_filt=where((*!dustem_data.fpolext).filt_names NE 'SPECTRUM',ct_filt)
989 1015 idx_spec=where((*!dustem_data.fpolext).filt_names EQ 'SPECTRUM',ct_spec)
990 1016  
... ... @@ -1133,6 +1159,8 @@ if keyword_set(dataset) then begin
1133 1159  
1134 1160 'PSI_EM': begin ;will be copying code from qsed and hopefully it will work. NB: THIS IS FALSE . YOU DO NOT NEED A LOGARITHMIC AXIS
1135 1161  
  1162 + IF ct_m NE 0 then xr=xr_m & yr=yr_m
  1163 +
1136 1164 idx_filt=where((*!dustem_data.psi_em).filt_names NE 'SPECTRUM',ct_filt)
1137 1165 idx_spec=where((*!dustem_data.psi_em).filt_names EQ 'SPECTRUM',ct_spec)
1138 1166  
... ... @@ -1291,7 +1319,9 @@ if keyword_set(dataset) then begin
1291 1319 end
1292 1320  
1293 1321 'PSI_EXT': begin ;MODIFYING THIS NOW - You should write a plugin for the modification of polarized extinction so that !dustem_psi_ext is different than !dustem_psi.
1294   -
  1322 +
  1323 +
  1324 + IF ct_x NE 0 then xr=xr_x & yr=yr_x
1295 1325  
1296 1326 idx_filt=where((*!dustem_data.psi_ext).filt_names NE 'SPECTRUM',ct_filt)
1297 1327 idx_spec=where((*!dustem_data.psi_ext).filt_names EQ 'SPECTRUM',ct_spec)
... ... @@ -1436,7 +1466,8 @@ if keyword_set(dataset) then begin
1436 1466 end
1437 1467  
1438 1468 'QSED': begin ; THE ONE I WILL BE WORKING ON
1439   -
  1469 +
  1470 + IF ct_m NE 0 then xr=xr_m & yr=yr_m
1440 1471  
1441 1472 vectw=DINDGEN(1001)*(alog10(1E7) - alog10(1E5))/(1000 - 1L) + alog10(1E5)
1442 1473 vectw=10^vectw[1:*]
... ... @@ -1789,7 +1820,9 @@ if keyword_set(dataset) then begin
1789 1820 END
1790 1821  
1791 1822 'USED': begin
1792   -
  1823 +
  1824 + IF ct_m NE 0 then xr=xr_m & yr=yr_m
  1825 +
1793 1826 vectw=DINDGEN(1001)*(alog10(1E7) - alog10(1E5))/(1000 - 1L) + alog10(1E5)
1794 1827 vectw=10^vectw[1:*]
1795 1828 vectw=[wavs,vectw]
... ... @@ -2143,7 +2176,7 @@ if keyword_set(dataset) then begin
2143 2176  
2144 2177 'QEXT': begin ;Correct this like you corrected extinction...
2145 2178  
2146   -
  2179 + IF ct_x NE 0 then xr=xr_x & yr=yr_x
2147 2180 vectw=DINDGEN(1001)*(alog10(1E7) - alog10(1E5))/(1000 - 1L) + alog10(1E5)
2148 2181 vectw=10^vectw[1:*]
2149 2182 vectw=[wavs,vectw]
... ... @@ -2519,7 +2552,7 @@ if keyword_set(dataset) then begin
2519 2552 end
2520 2553  
2521 2554 'UEXT': begin
2522   -
  2555 + IF ct_x NE 0 then xr=xr_x & yr=yr_x
2523 2556 vectw=DINDGEN(1001)*(alog10(1E7) - alog10(1E5))/(1000 - 1L) + alog10(1E5)
2524 2557 vectw=10^vectw[1:*]
2525 2558 vectw=[wavs,vectw]
... ...
src/idl/dustemwrap_plot.pro
... ... @@ -387,16 +387,17 @@ if test_m then begin
387 387  
388 388 if ~iswinsed then begin
389 389  
390   - cmdind_m = !dustemcgwin_ncmds.sed.pl
391   - cgwindow,'dustemcgwin_dataset', st, dustem_sed,SED_spec,dataset='SED', /refresh ,position=p_sed, winid=winid_m,cmdindex=cmdind_m,/replacecmd,_extra=_extra
392   -
393   - cmdind_m = !dustemcgwin_ncmds.sed.nrm
394   - cgwindow,'dustemcgwin_dataset', st, dustem_sed,SED_spec,dataset='SED', /norm, /refresh,position=np_sed, winid=winid_m,cmdindex=cmdind_m,/replacecmd,_extra=_extra
  390 + cmdind_m = !dustemcgwin_ncmds.sed.pl
  391 + cgwindow,'dustemcgwin_dataset', st, dustem_sed,SED_spec,dataset='SED', /refresh ,position=p_sed, winid=winid_m,cmdindex=cmdind_m,/replacecmd,_extra=_extra
  392 +
  393 + cmdind_m = !dustemcgwin_ncmds.sed.nrm
  394 + cgwindow,'dustemcgwin_dataset', st, dustem_sed,SED_spec,dataset='SED', /norm, /refresh,position=np_sed, winid=winid_m,cmdindex=cmdind_m,/replacecmd,_extra=_extra
395 395  
396 396  
397 397 endif else begin
398 398  
399 399 cgwindow,'dustemcgwin_dataset', st, dataset='SED', position=p_sed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1
  400 +
400 401 cgwindow,'dustemcgwin_dataset', st, dustem_sed,SED_spec, dataset='SED', /refresh ,position=p_sed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1
401 402 !dustemcgwin_ncmds.sed.pl = cmdind_m
402 403  
... ... @@ -419,6 +420,7 @@ if test_m then begin
419 420 endif else begin ;Qsed data is present
420 421  
421 422 if ~iswinsed then begin
  423 +
422 424 cmdind_m = !dustemcgwin_ncmds.qsed.pl
423 425 ;refreshing the positive_only and negative_only plots if data is present in them
424 426 cgwindow,'dustemcgwin_dataset', st, dustem_qsed,Q_spec,dataset='QSED',/positive_only, nodata=0, /refresh ,position=p_qsed, winid=winid_m,/replacecmd,cmdindex=cmdind_m, _extra=_extra
... ...