Commit af5bca1fbb7f97ff62d42e679bdc668956852755
1 parent
1355825c
Exists in
master
general update
Showing
2 changed files
with
77 additions
and
106 deletions
Show diff stats
src/idl/dustem_plugin_freefree.pro
src/idl/dustemwrap_plot.pro
1 | -PRO dustemwrap_plot,p_dim,st,dustem_sed,dustem_qsed,dustem_used,dustem_polsed,_extra=_extra ;, dustem_polfrac | |
1 | +PRO dustemwrap_plot,p_dim,st,dustem_sed,dustem_qsed,dustem_used,dustem_polsed,dustem_polfrac,_extra=_extra ;, dustem_polfrac | |
2 | 2 | |
3 | 3 | ;NB/ the old POLFRAC treatment from mpfit_run will have to be copied over here when plotting the polarization fraction. |
4 | 4 | |
... | ... | @@ -35,6 +35,7 @@ IF not keyword_set(st) THEN BEGIN |
35 | 35 | st=dustem_run(p_dim) |
36 | 36 | ENDIF |
37 | 37 | |
38 | +stop | |
38 | 39 | ;If the interpolates arrays are not present (dustem_sed, etc...) run: |
39 | 40 | ;dustem_compute_sed etc to generate them. |
40 | 41 | |
... | ... | @@ -100,7 +101,7 @@ if test_m then begin |
100 | 101 | ;Generating emission window and saving window ID |
101 | 102 | |
102 | 103 | if iswinsed then begin |
103 | - if !run_pol then cgwindow,wxsize=1260,wysize=670,wtitle='DUSTEMWRAP v2.0 (EMISSION)' else cgwindow, wtitle='DUSTEMWRAP v2.0 (EMISSION)';, wback='grey';,wobject=winobj_m | |
104 | + if !run_pol then cgwindow,wxsize=910,wysize=658,wtitle='DUSTEMWRAP v2.0 (EMISSION)' else cgwindow, wtitle='DUSTEMWRAP v2.0 (EMISSION)';, wback='grey';,wobject=winobj_m | |
104 | 105 | winid_m = cgquery(dimensions=dim_m,/current) ;this has to be changed because the dimensions of this array change with the data sets present (extinction/emission). |
105 | 106 | !dustemcgwin_id.sed = winid_m |
106 | 107 | |
... | ... | @@ -113,13 +114,14 @@ if test_m then begin |
113 | 114 | ;,wback='grey' |
114 | 115 | |
115 | 116 | ;position arrays for plot and normalized graph |
116 | - ;there might be some problems with the 'math' here | |
117 | + | |
118 | + | |
119 | + ;THIS IS HARD-CODED IN A VERY SILLY WAY | |
117 | 120 | |
118 | 121 | p_sed = [0.05,0.67,0.475,0.90] |
119 | 122 | p_psed = [0.525,0.67,0.95,0.90] |
120 | - ;p_spsed = [0.07,0.42,0.5,0.57] | |
123 | + p_spsed = [0.05,0.375,0.475,0.575] | |
121 | 124 | p_psised = [0.525,0.375,0.95,0.575] |
122 | - | |
123 | 125 | p_qsed = [0.05,0.12,0.475,0.35] ;FIX THESE POSITIONS. |
124 | 126 | p_used = [0.525,0.12,0.95,0.35] |
125 | 127 | |
... | ... | @@ -127,7 +129,21 @@ if test_m then begin |
127 | 129 | np_psed = [0.525,0.60,0.95,0.67] |
128 | 130 | np_qsed = [0.05,0.05,0.475,0.12] |
129 | 131 | np_used = [0.525,0.05,0.95,0.12] |
130 | - | |
132 | + | |
133 | + p_sed[1]+= 0.0125 & p_sed[3]+= 0.0125 | |
134 | + p_psed[1]+= 0.0125 & p_psed[3]+= 0.0125 | |
135 | + p_spsed[1]+= 0.0125 & p_spsed[3]+= 0.0125 | |
136 | + p_psised[1]+= 0.0125 & p_psised[3]+= 0.0125 | |
137 | + p_qsed[1]+= 0.0125 & p_qsed[3]+= 0.0125 | |
138 | + p_used[1]+= 0.0125 & p_used[3]+= 0.0125 | |
139 | + | |
140 | + np_sed[1]+= 0.0125 & np_sed[3]+= 0.0125 | |
141 | + np_psed[1]+= 0.0125 & np_psed[3]+= 0.0125 | |
142 | + np_qsed[1]+= 0.0125 & np_qsed[3]+= 0.0125 | |
143 | + np_used[1]+= 0.0125 & np_used[3]+= 0.0125 | |
144 | + | |
145 | + | |
146 | + | |
131 | 147 | endif else begin |
132 | 148 | p_sed = [0.07,0.30,0.97,0.85] |
133 | 149 | np_sed = [0.07,0.10,0.97,0.30] |
... | ... | @@ -235,23 +251,19 @@ if test_m then begin |
235 | 251 | if ~test_psi_em then begin ; psi_em data is not present (For completeness) # This is only valid when !run_pol=1 |
236 | 252 | |
237 | 253 | cgwindow,'dustemcgwin_dataset', st, dataset='psi_em', /nodata, position=p_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 |
238 | - ;cgwindow,'dustemcgwin_dataset', st, dataset='psi_em', /norm, /nodata, position=np_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
239 | 254 | |
240 | 255 | endif else begin ;psi_em exists |
241 | 256 | |
242 | 257 | if ~iswinsed then begin |
243 | 258 | cmdind_m = !dustemcgwin_ncmds.psi_em.pl |
244 | 259 | cgwindow,'dustemcgwin_dataset', st, dustem_psi_em, dataset='psi_em', /refresh ,position=p_psised, winid=winid_m,/replacecmd,cmdindex=cmdind_m, _extra=_extra |
245 | - ;cmdind_m = !dustemcgwin_ncmds.psi_em.nrm | |
246 | - ;cgwindow,'dustemcgwin_dataset', st, dustem_psi_em, dataset='psi_em', /refresh, /norm,position=np_psised, winid=winid_m,/replacecmd,cmdindex=cmdind_m, _extra=_extra | |
260 | + | |
247 | 261 | endif else begin |
248 | 262 | ;stop |
249 | 263 | cgwindow,'dustemcgwin_dataset', st, dataset='psi_em', position=p_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 |
250 | 264 | cgwindow,'dustemcgwin_dataset', st, dustem_psi_em, dataset='psi_em', /refresh ,position=p_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 |
251 | 265 | !dustemcgwin_ncmds.psi_em.pl = cmdind_m |
252 | -; cgwindow,'dustemcgwin_dataset', st, dataset='psi_em',/norm, position=np_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 ;I think nodata can also be upsi_em too | |
253 | -; cgwindow,'dustemcgwin_dataset', st, dustem_psi_em, dataset='psi_em', /refresh, /norm,position=np_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
254 | -; !dustemcgwin_ncmds.psi_em.nrm = cmdind_m | |
266 | + | |
255 | 267 | endelse |
256 | 268 | endelse |
257 | 269 | |
... | ... | @@ -278,103 +290,28 @@ if test_m then begin |
278 | 290 | !dustemcgwin_ncmds.polsed.nrm = cmdind_m |
279 | 291 | endelse |
280 | 292 | endelse |
281 | - | |
282 | - | |
283 | - | |
284 | -;############################################################################# | |
285 | -;!!!!!!!!!NOTA BENE : Do not forget to modify the value of 'prediction' and adjust it to the computation of the polarization angle using | |
286 | -;the two stokes paramters model prediction interpolates provided as output by the wrapper. | |
287 | -;############################################################################# | |
288 | - | |
293 | + | |
294 | + | |
295 | + | |
296 | + if ~test_polfrac then begin ; polfrac data is not present (For completeness) # This is only valid when !run_pol=1 | |
297 | + | |
298 | + cgwindow,'dustemcgwin_dataset', st, dataset='polfrac', /nodata, position=p_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
289 | 299 | |
300 | + endif else begin ;polfrac exists | |
290 | 301 | |
302 | + if ~iswinsed then begin | |
303 | + cmdind_m = !dustemcgwin_ncmds.polfrac.pl | |
304 | + cgwindow,'dustemcgwin_dataset', st, dustem_polfrac, dataset='polfrac', /refresh ,position=p_spsed, winid=winid_m,/replacecmd,cmdindex=cmdind_m, _extra=_extra | |
305 | + | |
306 | + endif else begin | |
307 | + ;stop | |
308 | + cgwindow,'dustemcgwin_dataset', st, dataset='polfrac', position=p_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
309 | + cgwindow,'dustemcgwin_dataset', st, dustem_polfrac, dataset='polfrac', /refresh ,position=p_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
310 | + !dustemcgwin_ncmds.polfrac.pl = cmdind_m | |
291 | 311 | |
312 | + endelse | |
313 | + endelse | |
292 | 314 | |
293 | -; if ~iswinsed and test_polsed then goto, zone7 | |
294 | -; | |
295 | -; if ~test_polsed then begin ;Polsed is not present | |
296 | -; | |
297 | -; cgwindow,'dustemcgwin_dataset', st, dataset='POLSED', /nodata, position=p_psed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
298 | -; cgwindow,'dustemcgwin_dataset', st, dataset='POLSED', /norm, /nodata, position=np_psed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
299 | -; | |
300 | -; endif else begin ;Polsed data is present | |
301 | -; cgwindow,'dustemcgwin_dataset', st, dataset='POLSED', position=p_psed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
302 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polsed, dataset='POLSED', /refresh ,position=p_psed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
303 | -; !dustemcgwin_ncmds.polsed.pl = cmdind_m | |
304 | -; zone7: | |
305 | -; if ~iswinsed then begin | |
306 | -; cmdind_m = !dustemcgwin_ncmds.polsed.pl | |
307 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polsed, dataset='POLSED', /refresh ,position=p_psed, winid=winid_m, _extra=_extra,/replacecmd,cmdindex=cmdind_m | |
308 | -; goto, zone8 | |
309 | -; endif | |
310 | -; cgwindow,'dustemcgwin_dataset', st, dataset='POLSED', /norm, position=np_psed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 ;I think nodata can also be used too | |
311 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polsed, dataset='POLSED', /refresh, /norm,position=np_psed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
312 | -; !dustemcgwin_ncmds.polsed.nrm = cmdind_m | |
313 | -; zone8: | |
314 | -; if ~iswinsed then begin | |
315 | -; cmdind_m = !dustemcgwin_ncmds.polsed.nrm | |
316 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polsed, dataset='POLSED', /refresh, /norm,position=np_psed, winid=winid_m, _extra=_extra,/replacecmd,cmdindex=cmdind_m | |
317 | -; endif | |
318 | -; | |
319 | -; endelse | |
320 | -; | |
321 | -; if ~iswinsed and test_polfrac then goto, zone9 | |
322 | -; | |
323 | -; if ~test_polfrac then begin ;Polfrac is not present | |
324 | -; | |
325 | -; cgwindow,'dustemcgwin_dataset', st, dataset='POLFRAC', /nodata, position=p_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
326 | -; cgwindow,'dustemcgwin_dataset', st, dataset='POLFRAC', /norm, /nodata, position=np_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
327 | -; | |
328 | -; endif else begin ;Polfrac data is present | |
329 | -; cgwindow,'dustemcgwin_dataset', st, dataset='POLFRAC', position=p_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
330 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polsed, dataset='POLFRAC', /refresh ,position=p_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
331 | -; !dustemcgwin_ncmds.polfrac.pl = cmdind_m | |
332 | -; zone9: | |
333 | -; if ~iswinsed then begin | |
334 | -; cmdind_m = !dustemcgwin_ncmds.polfrac.pl | |
335 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polfrac, dataset='POLFRAC', /refresh ,position=p_spsed, winid=winid_m, _extra=_extra,/replacecmd,cmdindex=cmdind_m | |
336 | -; goto, zone10 | |
337 | -; endif | |
338 | -; cgwindow,'dustemcgwin_dataset', st, dataset='POLFRAC', /norm, position=np_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 ;I think nodata can also be used too | |
339 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polfrac, dataset='POLFRAC', /refresh, /norm,position=np_spsed, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
340 | -; !dustemcgwin_ncmds.polfrac.nrm = cmdind_m | |
341 | -; zone10: | |
342 | -; if ~iswinsed then begin | |
343 | -; cmdind_m = !dustemcgwin_ncmds.polfrac.nrm | |
344 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polfrac, dataset='POLFRAC', /refresh, /norm,position=np_spsed, winid=winid_m, _extra=_extra,/replacecmd,cmdindex=cmdind_m | |
345 | -; endif | |
346 | -; | |
347 | -; endelse | |
348 | -; | |
349 | -; if ~iswinsed and test_psi_em then goto, zone11 DO NOT FORGET | |
350 | -; | |
351 | -; if ~test_psi_em then begin ;Polfrac is not present | |
352 | -; | |
353 | -; cgwindow,'dustemcgwin_dataset', st, dataset='PSI_EM', /nodata, position=p_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
354 | -; cgwindow,'dustemcgwin_dataset', st, dataset='PSI_EM', /norm, /nodata, position=np_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
355 | -; | |
356 | -; endif else begin ;Polfrac data is present | |
357 | -; cgwindow,'dustemcgwin_dataset', st, dataset='PSI_EM', position=p_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
358 | -; cgwindow,'dustemcgwin_dataset', st, dustem_polsed, dataset='PSI_EM', /refresh ,position=p_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
359 | -; !dustemcgwin_ncmds.psi_em.pl = cmdind_m | |
360 | -; zone11: | |
361 | -; if ~iswinsed then begin | |
362 | -; cmdind_m = !dustemcgwin_ncmds.psi_em.pl | |
363 | -; cgwindow,'dustemcgwin_dataset', st, dustem_psi_em, dataset='PSI_EM', /refresh ,position=p_psised, winid=winid_m, _extra=_extra,/replacecmd,cmdindex=cmdind_m | |
364 | -; goto, zone12 | |
365 | -; endif | |
366 | -; cgwindow,'dustemcgwin_dataset', st, dataset='PSI_EM', /norm, position=np_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 ;I think nodata can also be used too | |
367 | -; cgwindow,'dustemcgwin_dataset', st, dustem_psi_em, dataset='PSI_EM', /refresh, /norm,position=np_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 | |
368 | -; !dustemcgwin_ncmds.psi_em.nrm = cmdind_m | |
369 | -; zone12: | |
370 | -; if ~iswinsed then begin | |
371 | -; cmdind_m = !dustemcgwin_ncmds.psi_em.nrm | |
372 | -; cgwindow,'dustemcgwin_dataset', st, dustem_psi_em, dataset='PSI_EM', /refresh, /norm,position=np_psised, winid=winid_m, _extra=_extra,/replacecmd,cmdindex=cmdind_m | |
373 | -; endif | |
374 | -; | |
375 | -; endelse | |
376 | -; | |
377 | -; | |
378 | 315 | endif |
379 | 316 | |
380 | 317 | end_m: |
... | ... | @@ -402,6 +339,40 @@ endif |
402 | 339 | ;endif |
403 | 340 | |
404 | 341 | |
342 | +;Putting everything required for the plotting of the legends (column density,model chi2 and rchi2) and the two windows for the parameters and the plugins respectively | |
343 | + | |
344 | + xxpos = | |
345 | + yypos = | |
346 | + ltit = 'Model: '+ | |
347 | + xyouts,xxpos,yypos,ltit+!dustem_model,color=0,/normal,charsize=legend_charsize | |
348 | + xxpos = | |
349 | + yypos = | |
350 | + ltit = 'N_{H}:'+strmid(string(*!dustem_HCD,format='(1E10.2)'),2)+'(H/cm^2)' | |
351 | + ltit = textoidl(ltit) | |
352 | + xyouts,xxpos,yypos,ltit,color=0,/normal,charsize=legend_charsize | |
353 | + xxpos = | |
354 | + yypos = | |
355 | + xyouts,xxpos,yypos,_extra.title,color=0,/normal,charsize=legend_charsize | |
356 | + | |
357 | + | |
358 | + | |
359 | + | |
360 | + | |
361 | + | |
362 | + | |
363 | + | |
364 | + | |
365 | + | |
366 | + | |
367 | + | |
368 | + | |
369 | + | |
370 | + | |
371 | + | |
372 | + | |
373 | + | |
374 | + | |
375 | + | |
405 | 376 | ;stop |
406 | 377 | |
407 | 378 | ... | ... |