Commit 94c4dffa7a3381cc515efcbcf788087441b598d1

Authored by Ilyes Choubani
1 parent f2caf3f1
Exists in master

update + fixes for dustemcgwin_dataset (extinction)

Showing 1 changed file with 56 additions and 32 deletions   Show diff stats
src/idl/dustemcgwin_dataset.pro
... ... @@ -292,16 +292,22 @@ if keyword_set(dataset) then begin
292 292 xx=((*!dustem_data.ext).wav)[idx_spec]
293 293 yy=dustem_interp[idx_spec]
294 294 rms=3.*((*!dustem_data.ext).sigma)(idx_spec)/2.
295   - cgoplot,1/xx,((*!dustem_data.ext).values)[idx_spec]/yy,color='Powder Blue',psym=16,syms=0.8,noerase=1,pos=position
296   - cgerrplot,1/((*!dustem_data.ext).wav)(idx_spec),(((*!dustem_data.ext).values)[idx_spec]-rms)/yy,(((*!dustem_data.ext).values)[idx_spec]+rms)/yy,color='Powder Blue'
  295 + indzero = where(yy NE 0, ct_zero)
  296 + IF ct_zero NE 0 THEN BEGIN
  297 + cgoplot,(1/xx)[indzero],(((*!dustem_data.ext).values)[idx_spec])[indzero]/yy[indzero],color='Powder Blue',psym=16,syms=0.8,noerase=1,pos=position
  298 + cgerrplot,(1/((*!dustem_data.ext).wav)(idx_spec))[indzero],((((*!dustem_data.ext).values)[idx_spec])[indzero]-rms[indzero])/yy[indzero],((((*!dustem_data.ext).values)[idx_spec])[indzero]+rms[indzero])/yy[indzero],color='Powder Blue'
  299 + ENDIF
297 300 ENDIF
298 301  
299 302 IF ct_filt NE 0 THEN BEGIN ; There are no filter points for now...
300 303 xx=((*!dustem_data.ext).wav)[idx_filt]
301 304 yy=dustem_interp[idx_filt]
302   - rms=3.*((*!dustem_data.ext).sigma)(idx_filt)/2.
303   - cgoplot,1/xx,((*!dustem_data.ext).values)[idx_filt]/yy,psym=16,color='Dodger Blue',syms=0.8,noerase=1,pos=position
304   - cgerrplot,1/((*!dustem_data.ext).wav)(idx_filt),(((*!dustem_data.ext).values)[idx_filt]-rms)/yy,(((*!dustem_data.ext).values)[idx_filt]+rms)/yy,color='Dodger Blue';,/overplot
  305 + rms=3.*((*!dustem_data.ext).sigma)(idx_filt)/2.
  306 + indzero = where(yy NE 0, ct_zero)
  307 + IF ct_zero NE 0 THEN BEGIN
  308 + cgoplot,(1/xx)[indzero],(((*!dustem_data.ext).values)[idx_filt])[indzero]/yy[indzero],psym=16,color='Dodger Blue',syms=0.8,noerase=1,pos=position
  309 + cgerrplot,(1/((*!dustem_data.ext).wav)(idx_filt))[indzero],((((*!dustem_data.ext).values)[idx_filt])[indzero]-rms[indzero])/yy[indzero],((((*!dustem_data.ext).values)[idx_filt])[indzero]+rms[indzero])/yy[indzero],color='Dodger Blue';,/overplot
  310 + ENDIF
305 311 ENDIF
306 312  
307 313  
... ... @@ -474,8 +480,8 @@ if keyword_set(dataset) then begin
474 480 endif else begin ;normal plot
475 481 ;/NODATA
476 482 cgplot,wavs,wavs,/nodata,/ylog,/xlog,/ys,xs=9,pos=position,noerase=1,charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,xtit='',yr=yr,psym=8,syms=0.8
477   - cgaxis, xaxis=1 ,xlog=1 ,xrange=((!const.c*1E6/xr)*1E-9),charsize=1.15,title=textoidl('\nu (GHz)'),xticklen=0.05,xminor=10
478   - xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{P_EXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
  483 + cgaxis, xaxis=1 ,xlog=1 ,xrange=((!const.c*1E6*xr)*1E-9),charsize=1.15,title=textoidl('\nu (GHz)'),xticklen=0.05,xminor=10
  484 + xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{PEXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
479 485  
480 486 endelse
481 487  
... ... @@ -487,19 +493,31 @@ if keyword_set(dataset) then begin
487 493 if keyword_set(refresh) then begin ;The data points in the plot that are being refreshed
488 494  
489 495 IF ct_spec NE 0 THEN BEGIN
  496 +
490 497 xx=((*!dustem_data.polext).wav)[idx_spec]
491 498 yy=dustem_interp[idx_spec]
492 499 rms=3.*((*!dustem_data.polext).sigma)(idx_spec)/2.
493   - cgoplot,1/xx,((*!dustem_data.polext).values)[idx_spec]/yy,color='Powder Blue',psym=16,syms=0.8,noerase=1,pos=position
494   - cgerrplot,1/((*!dustem_data.polext).wav)(idx_spec),(((*!dustem_data.polext).values)[idx_spec]-rms)/yy,(((*!dustem_data.polext).values)[idx_spec]+rms)/yy,color='Powder Blue'
  500 + indzero = where(yy NE 0, ct_zero)
  501 +
  502 + IF ct_zero NE 0 THEN BEGIN
  503 +
  504 + cgoplot,(1/xx)[indzero],(((*!dustem_data.polext).values)[idx_spec])[indzero]/yy[indzero],color='Powder Blue',psym=16,syms=0.8,noerase=1,pos=position
  505 + cgerrplot,(1/((*!dustem_data.polext).wav)(idx_spec))[indzero],((((*!dustem_data.polext).values)[idx_spec])[indzero]-rms[indzero])/yy[indzero],((((*!dustem_data.polext).values)[idx_spec])[indzero]+rms[indzero])/yy[indzero],color='Powder Blue'
  506 +
  507 + ENDIF
495 508 ENDIF
496 509  
497 510 IF ct_filt NE 0 THEN BEGIN
498 511 xx=((*!dustem_data.polext).wav)[idx_filt]
499 512 yy=dustem_interp[idx_filt]
500   - rms=3.*((*!dustem_data.polext).sigma)(idx_filt)/2.
501   - cgoplot,1/xx,((*!dustem_data.polext).values)[idx_filt]/yy,psym=16,color='Dodger Blue',syms=0.8,noerase=1,pos=position
502   - cgerrplot,1/((*!dustem_data.polext).wav)(idx_filt),(((*!dustem_data.polext).values)[idx_filt]-rms)/yy,(((*!dustem_data.polext).values)[idx_filt]+rms)/yy,color='Dodger Blue';,/overplot
  513 + rms=3.*((*!dustem_data.polext).sigma)(idx_filt)/2.
  514 + indzero = where(yy NE 0, ct_zero)
  515 + IF ct_zero NE 0 THEN BEGIN
  516 +
  517 + cgoplot,(1/xx)[indzero],(((*!dustem_data.polext).values)[idx_filt])[indzero]/yy[indzero],psym=16,color='Dodger Blue',syms=0.8,noerase=1,pos=position
  518 + cgerrplot,(1/((*!dustem_data.polext).wav)(idx_filt))[indzero],((((*!dustem_data.polext).values)[idx_filt])[indzero]-rms[indzero])/yy[indzero],((((*!dustem_data.polext).values)[idx_filt])[indzero]+rms[indzero])/yy[indzero],color='Dodger Blue';,/overplot
  519 +
  520 + ENDIF
503 521 ENDIF
504 522  
505 523  
... ... @@ -584,9 +602,9 @@ if keyword_set(dataset) then begin
584 602  
585 603  
586 604 ;Plotting of frequency axis
587   - 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)')
  605 + 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)')
588 606  
589   - xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{P_EXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
  607 + xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{PEXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
590 608  
591 609 ;Locating all the hidden data points (spectrum+filter)
592 610 match2,((*!dustem_data.polext).wav),((*!dustem_show.polext).wav),show_polsedpts,fit_polsedpts ;only show_polsedpts is needed
... ... @@ -674,16 +692,22 @@ if keyword_set(dataset) then begin
674 692 xx=((*!dustem_data.polsed).wav)[idx_spec]
675 693 yy=dustem_interp[idx_spec]
676 694 rms=3.*((*!dustem_data.polsed).sigma)(idx_spec)/2.
677   - cgoplot,xx,((*!dustem_data.polsed).values)[idx_spec]/yy,color='Powder Blue',psym=16,syms=0.8,noerase=1,pos=position
678   - cgerrplot,((*!dustem_data.polsed).wav)(idx_spec),(((*!dustem_data.polsed).values)[idx_spec]-rms)/yy,(((*!dustem_data.polsed).values)[idx_spec]+rms)/yy,color='Powder Blue'
  695 + indzero = where(yy NE 0, ct_zero)
  696 + IF ct_zero NE 0 THEN BEGIN
  697 + cgoplot,xx[indzero],(((*!dustem_data.polsed).values)[idx_spec])[indzero]/yy[indzero],color='Powder Blue',psym=16,syms=0.8,noerase=1,pos=position
  698 + cgerrplot,(((*!dustem_data.polsed).wav)(idx_spec))[indzero],((((*!dustem_data.polsed).values)[idx_spec])[indzero]-rms[indzero])/yy[indzero],((((*!dustem_data.polsed).values)[idx_spec])[indzero]+rms[indzero])/yy[indzero],color='Powder Blue'
  699 + ENDIF
679 700 ENDIF
680 701  
681 702 IF ct_filt NE 0 THEN BEGIN
682 703 xx=((*!dustem_data.polsed).wav)[idx_filt]
683 704 yy=dustem_interp[idx_filt]
684   - rms=3.*((*!dustem_data.polsed).sigma)(idx_filt)/2.
685   - cgoplot,xx,((*!dustem_data.polsed).values)[idx_filt]/yy,psym=16,color='Dodger Blue',syms=0.8,noerase=1,pos=position
686   - cgerrplot,((*!dustem_data.polsed).wav)(idx_filt),(((*!dustem_data.polsed).values)[idx_filt]-rms)/yy,(((*!dustem_data.polsed).values)[idx_filt]+rms)/yy,color='Dodger Blue';,/overplot
  705 + rms=3.*((*!dustem_data.polsed).sigma)(idx_filt)/2.
  706 + indzero = where(yy NE 0, ct_zero)
  707 + IF ct_zero NE 0 THEN BEGIN
  708 + cgoplot,xx[indzero],(((*!dustem_data.polsed).values)[idx_filt])[indzero]/yy[indzero],psym=16,color='Dodger Blue',syms=0.8,noerase=1,pos=position
  709 + cgerrplot,(((*!dustem_data.polsed).wav)(idx_filt))[indzero],((((*!dustem_data.polsed).values)[idx_filt])[indzero]-rms[indzero])/yy[indzero],((((*!dustem_data.polsed).values)[idx_filt])[indzero]+rms[indzero])/yy[indzero],color='Dodger Blue';,/overplot
  710 + ENDIF
687 711 ENDIF
688 712  
689 713  
... ... @@ -981,8 +1005,8 @@ if keyword_set(dataset) then begin
981 1005 if keyword_set(nodata) then begin ;when the data is not present
982 1006  
983 1007 xtit = ''
984   - cgplot,wavs,wavs*0.,/nodata,/xlog,/ys,xs=1,pos=position,noerase=1,charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,xtit='',yr=[1.00E-04,50.00],/ylog,psym=8,syms=0.8
985   - xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{P_EXT}/\tau_{EXT} (%)'),color=0,/normal,charsize=1.3;,charthick=2.0
  1008 + cgplot,wavs,wavs*0.,/nodata,/xlog,/ys,xs=1,pos=position,noerase=1,charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,xtit='',yr=[1.00E-04,10.00],/ylog,psym=8,syms=0.8
  1009 + xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{PEXT}/\tau_{EXT} (%)'),color=0,/normal,charsize=1.3;,charthick=2.0
986 1010  
987 1011 endif else begin ;when the data is present ; normal plot
988 1012  
... ... @@ -1009,7 +1033,7 @@ if keyword_set(dataset) then begin
1009 1033  
1010 1034 vecfin[testneq] = (vecto[testneq])*(*!dustem_HCD)/1.0e21/extra_spec[testneq];(st.sed.em_tot)[testneq];spec[testneq];(st.sed.(i+1))[testneq];*fact;(st.sed.(i+1))[testneq]
1011 1035  
1012   - cgoplot,1/st.polext.wav,vecfin*100,pos=position,noerase=1,color=use_cols[i],xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=[1.00E-04,50.00]
  1036 + cgoplot,1/st.polext.wav,vecfin*100,pos=position,noerase=1,color=use_cols[i],xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=[1.00E-04,10.00]
1013 1037 endif
1014 1038 ENDFOR
1015 1039  
... ... @@ -1065,7 +1089,7 @@ if keyword_set(dataset) then begin
1065 1089 if ct_spec ne 0 then begin
1066 1090  
1067 1091 ;Plotting of spectrum data points (to be fitted)
1068   - cgplot,1/((*!dustem_data.fpolext).wav)(idx_spec),((*!dustem_data.fpolext).values)(idx_spec)*100,/xlog,/ylog,/ys,xs=1,pos=position,noerase=1,xtit=' ',charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,yr=[1.00E-04,50.00],psym=16,syms=0.8;,ytickformat='dstmwrp_exp'
  1092 + cgplot,1/((*!dustem_data.fpolext).wav)(idx_spec),((*!dustem_data.fpolext).values)(idx_spec)*100,/xlog,/ylog,/ys,xs=1,pos=position,noerase=1,xtit=' ',charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,yr=[1.00E-04,10.00],psym=16,syms=0.8;,ytickformat='dstmwrp_exp'
1069 1093  
1070 1094 ;Plotting of the spectrum error points
1071 1095 rms=3.*((*!dustem_data.fpolext).sigma)(idx_spec)/2.
... ... @@ -1076,8 +1100,8 @@ if keyword_set(dataset) then begin
1076 1100 if ct_filt ne 0 then begin
1077 1101  
1078 1102 ;Plotting of filter data points (to be fitted) + testing for prior plotting
1079   - if ct_spec ne 0 then cgoplot,1/((*!dustem_data.fpolext).wav)(idx_filt),((*!dustem_data.fpolext).values)(idx_filt)*100,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,pos=position,/ys,xs=1,noerase=1,xtickformat='(A1)',xr=xr,yr=[1.00E-04,50.00],/xlog,/ylog else $;,ytickformat='dstmwrp_exp'
1080   - cgplot,1/((*!dustem_data.fpolext).wav)(idx_filt),((*!dustem_data.fpolext).values)(idx_filt)*100,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,pos=position,/ys,xs=1,noerase=1,xtickformat='(A1)',xtit=' ',xr=xr,yr=[1.00E-04,50.00],/xlog,/ylog;,ytickformat='dstmwrp_exp'
  1103 + if ct_spec ne 0 then cgoplot,1/((*!dustem_data.fpolext).wav)(idx_filt),((*!dustem_data.fpolext).values)(idx_filt)*100,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,pos=position,/ys,xs=1,noerase=1,xtickformat='(A1)',xr=xr,yr=[1.00E-04,10.00],/xlog,/ylog else $;,ytickformat='dstmwrp_exp'
  1104 + cgplot,1/((*!dustem_data.fpolext).wav)(idx_filt),((*!dustem_data.fpolext).values)(idx_filt)*100,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,pos=position,/ys,xs=1,noerase=1,xtickformat='(A1)',xtit=' ',xr=xr,yr=[1.00E-04,10.00],/xlog,/ylog;,ytickformat='dstmwrp_exp'
1081 1105  
1082 1106  
1083 1107 ;Plotting of the filter error points
... ... @@ -1088,7 +1112,7 @@ if keyword_set(dataset) then begin
1088 1112  
1089 1113  
1090 1114  
1091   - xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{P_EXT}/\tau_{EXT} (%)'),color=0,/normal,charsize=1.3;,charthick=2.0
  1115 + xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{PEXT}/\tau_{EXT} (%)'),color=0,/normal,charsize=1.3;,charthick=2.0
1092 1116  
1093 1117 ;Locating all the hidden data points (spectrum+filter)
1094 1118  
... ... @@ -1104,7 +1128,7 @@ if keyword_set(dataset) then begin
1104 1128  
1105 1129 if ct_spec_hdn ne 0 then begin
1106 1130 ;Plotting of hidden spectrum data points
1107   - cgplot,1/(((*!dustem_show.fpolext).wav)[idx_rmv_polfrac])(idx_spec_hdn),(((*!dustem_show.fpolext).values)[idx_rmv_polfrac])(idx_spec_hdn)*100,pos=position,/xlog,/ylog,/ys,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=[1.00E-04,50.00],psym=8,syms=0.8
  1131 + cgplot,1/(((*!dustem_show.fpolext).wav)[idx_rmv_polfrac])(idx_spec_hdn),(((*!dustem_show.fpolext).values)[idx_rmv_polfrac])(idx_spec_hdn)*100,pos=position,/xlog,/ylog,/ys,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=[1.00E-04,10.00],psym=8,syms=0.8
1108 1132  
1109 1133 ;Plotting of hidden spectrum error points
1110 1134 rms=3.*(((*!dustem_show.fpolext).sigma)[idx_rmv_polfrac])(idx_spec_hdn)/2.
... ... @@ -1115,7 +1139,7 @@ if keyword_set(dataset) then begin
1115 1139 ;stop
1116 1140 plotsym,0, /fill
1117 1141 ;Plotting of hidden filter data points
1118   - cgplot,1/(((*!dustem_show.fpolext).wav)[idx_rmv_polfrac])(idx_filt_hdn),(((*!dustem_show.fpolext).values)[idx_rmv_polfrac])(idx_filt_hdn)*100,pos=position,/xlog,/ylog,/ys,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=[1.00E-04,50.00],psym=8,syms=0.8
  1142 + cgplot,1/(((*!dustem_show.fpolext).wav)[idx_rmv_polfrac])(idx_filt_hdn),(((*!dustem_show.fpolext).values)[idx_rmv_polfrac])(idx_filt_hdn)*100,pos=position,/xlog,/ylog,/ys,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=[1.00E-04,10.00],psym=8,syms=0.8
1119 1143 ;stop
1120 1144 ;Plotting of hidden filter error point
1121 1145 rms=3.*(((*!dustem_show.fpolext).sigma)[idx_rmv_polfrac])(idx_filt_hdn)/2.
... ... @@ -2214,7 +2238,7 @@ if keyword_set(dataset) then begin
2214 2238  
2215 2239 cgplot,wavs,wavs,/nodata,/ylog,/xlog,/ys,xs=1,pos=position,noerase=1,charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,xtit='',yr=yr,psym=8,syms=0.8
2216 2240 ;cgaxis, xaxis=1 ,xlog=1 ,xrange=((!const.c*1E6/xr)*1E-9),charsize=1.15,title=textoidl('\nu (GHz)'),xticklen=0.05,xminor=10
2217   - xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{Q EXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
  2241 + xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{QEXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
2218 2242  
2219 2243 endelse
2220 2244  
... ... @@ -2397,7 +2421,7 @@ if keyword_set(dataset) then begin
2397 2421 endif else begin ;The data points in the plot that remain unchanged.; DO NOT USE AN ELSE HERE.
2398 2422 ;stop
2399 2423 ;cgaxis, xaxis=1,xlog=1, xs=1,charsize=1.5,xtickformat='(A1)'
2400   - xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{Q EXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
  2424 + xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{QEXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
2401 2425 ;if ct_hdnpts ne 0 then begin ;Hidden data points are present
2402 2426  
2403 2427 ;Locating the hidden spectrum and filter data points
... ... @@ -2593,7 +2617,7 @@ if keyword_set(dataset) then begin
2593 2617  
2594 2618 cgplot,wavs,wavs,/nodata,/ylog,/xlog,/ys,xs=1,pos=position,noerase=1,charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,xtit='',yr=yr,psym=8,syms=0.8
2595 2619 ;cgaxis, xaxis=1 ,xlog=1 ,xrange=((!const.c*1E6/xr)*1E-9),charsize=1.15,title=textoidl('\nu (GHz)'),xticklen=0.05,xminor=10
2596   - xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{U_EXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
  2620 + xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{UEXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
2597 2621  
2598 2622 endelse
2599 2623  
... ... @@ -2767,7 +2791,7 @@ if keyword_set(dataset) then begin
2767 2791 endif else begin ;The data points in the plot that remain unchanged.; DO NOT USE AN ELSE HERE.
2768 2792 ;stop
2769 2793 ;cgaxis, xaxis=1,xlog=1, xs=1,charsize=1.5,xtickformat='(A1)'
2770   - xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{U_EXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
  2794 + xyouts,pospltxt[0],pospltxt[1],textoidl('\tau_{UEXT}'),color=0,/normal,charsize=1.3;,charthick=2.0
2771 2795 ;if ct_hdnpts ne 0 then begin ;Hidden data points are present
2772 2796  
2773 2797 ;Locating the hidden spectrum and filter data points
... ...