PRO dustemcgwin_dataset, st, prediction, dataset=dataset, norm=norm, refresh=refresh, nodata=nodata, position=position,positive_only=positive_only, negative_only=negative_only, _extra=_extra ;######DRAFT HELP SECTION###### ;dataset = string. IE: 'SED','POLSED','QSED' etc... ;prediction = array. IE: 'dustem_sed', 'dustem_polsed' ... (discrete dustemwrap model predictions) ;norm = boolean. To indicate that it is the normalized plot. ;refresh = boolen. To indicate that the commands are the be replaced. ;#1-loop on the data set and find its index in !dustem_data/!dustem_show ;#prediction will be used whith refresh. ;#you need to know that the data set has been plotted once in order to replace the commands. That is why you need the command index ;first run requires to be known. ;To do so I will use this system variable '!dustemcgwin_ncmds' that I will only set after the first run ;.sed.pl and .sed.nrm will tell about the number of commands for each kind of plot. ;this will also interact with the refresh keyword. ;except for when nodata is used, the 'prediction' array should always be present for errors not to occur. ;YOU NEED THE INFORMATION INSIDE THE _EXTRA STRUCTURE ;NB: this procedures uses both !dustem_data/!dustem_show to locate hidden filter/spectrum data points ;positions for xyouts on the plots - not using any widgets for now ;using same margins for (placement of xyouts plot titles (ie: I_nu, Q_nu, U_nu etc...)) normalized plots and normal ones. ;######LIST OF THINGS NEEDED################################################################# ;############################################################################################ if !run_pol then pospltxt = [position(0)+0.02,position(3)-0.02] else pospltxt = [position(0)+0.02,position(3)-0.05] ;hard-coded but we can find a way wavs=dustem_get_wavelengths() n_plgns = n_tags(*!dustem_plugin) Ngrains=(*!dustem_params).Ngrains use_cols=dustem_grains_colors(Ngrains,/cgplot) use_cols[1]='Cornflower' fact = 1.e4*(*!dustem_HCD)/(4.*!pi)/(3.e8/1.e-6/st.sed.wav)*1.e20/1.e7 ; st.sed.wav and st.polsed.wav should remain the same spec = st.sed.em_tot * fact degtorad = !pi/180 ;factor that the arctan will be devided by in order to have an axis in degrees. Talk to JP maybe he wants angle in radians. if !run_pol then begin specpol = st.polsed.em_tot * fact ; stop ;Instead of matching the non-zero values in spec and specpol (dustem outputs), ;I will only test on specpol as spec does not contain any null values FOR NOW. ;If this happens to change, these lines will have to be adjusted. ;CHECKING IF THIS IS CORRECT FOR EACH OF THE SPECIES SPECTRA = ? specpolfrac = specpol *0. psi_em = specpol*0. indpolsed = where(specpol ne 0, ct_nullpolsed) ;I am not using the counter for now as it serves me no direct purpose. specpolfrac[indpolsed] = specpol[indpolsed]/spec[indpolsed] ;spec[0:11] = 1.00e-40 ; I can't even test for nans because cgwin won't accept the presence of nans in this ratio. ;specpolfrac = specpol/spec polar_ippsi2iqu,spec,specq,specu,specpolfrac,replicate(!dustem_psi,n_elements(spec)) ;(Q & U) were generated this way to save time. This sysv fixes my problem but still... ;psi_em[indpolsed] = 0.5*atan(specu[indpolsed],specq[indpolsed])/degtorad ;specpol = (specq*1.0E10)^2+(specu*1.0E10)^2 & specpol=1.0E-10*sqrt(specpol) ;for some reason cgwindow couldn't handle these mathematical operations. It seems this is caused by values that are too close to zero ;stop endif ;stop clrs_plgns = ['Rosy Brown','Gold','Light Coral','Slate Blue','Dark Khaki','Salmon','Dark Green'] ;FOR NOW scopes=tag_names((*!dustem_scope)) IF scopes[0] NE 'NONE' THEN BEGIN FOR i=0L,n_tags(*!dustem_scope)-1 DO BEGIN IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_SED') THEN spec+=(*(*!dustem_plugin).(i))[*,0] If !run_pol then begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'REPLACE_POLSED') THEN begin specq = (*(*!dustem_plugin).(i))[*,1] specu = (*(*!dustem_plugin).(i))[*,2] ;STILL LACKING A WORKAROUND. specpol = (specq*1.0E10)^2+(specu*1.0E10)^2 & specpol=1.0E-10*sqrt(specpol) ;for some reason cgwindow couldn't handle these mathematical operations. It seems this is caused by values that are too close to zero ;specpol = (specq^2 + specu^2) & specpol = sqrt(specpol) specpolfrac[indpolsed] = specpol[indpolsed]/spec[indpolsed] psi_em[indpolsed] = 0.5*atan(specu[indpolsed],specq[indpolsed])/degtorad ;stop endif IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_POLSED') THEN begin specq+= (*(*!dustem_plugin).(i))[*,1] specu+= (*(*!dustem_plugin).(i))[*,2] specpol+= sqrt(((*(*!dustem_plugin).(i))[*,1])^2+(*(*!dustem_plugin).(i))[*,2]^2) specpolfrac[indpolsed]+= (sqrt(((*(*!dustem_plugin).(i))[*,1])^2+(*(*!dustem_plugin).(i))[*,2]^2))[indpolsed]/((*(*!dustem_plugin).(i))[*,0])[indpolsed] psi_em[indpolsed]+= 0.5*atan(((*(*!dustem_plugin).(i))[*,2])[indpolsed],((*(*!dustem_plugin).(i))[*,1])[indpolsed])/degtorad endif ENDIF ENDFOR ENDIF ;stop tgnms_extra = tag_names(_extra) ind_xr = where(strmid(tgnms_extra,0,2) eq 'XR') ind_yr = where(strmid(tgnms_extra,0,2) eq 'YR') if ind_xr EQ -1 then xr=[1.00E+00,1.00E+05] else xr=(_extra.(ind_xr)) if ind_yr EQ -1 then yr=[5.00E-03,1.00E+08] else yr=(_extra.(ind_yr)) ;############################################################################################ ;############################################################################################ ;NB: because of small issue you forgot in the main code. Add xtit=xtit when convenient if keyword_set(dataset) then begin ;!run_pol is implied for QSED/USED/POLSED etc... Case strupcase(dataset) of 'SED': begin idx_filt=where((*!dustem_data.sed).filt_names NE 'SPECTRUM',ct_filt) idx_spec=where((*!dustem_data.sed).filt_names EQ 'SPECTRUM',ct_spec) ;#1) get the plotting keywords (pertaining to each data set) @here when the _extra structure is ready if keyword_set(nodata) then begin ;when the data is not present if keyword_set(norm) then begin ;normalized plot xtit=textoidl('\lambda (\mum)') if !run_pol then xtit = '' cgplot,wavs,wavs/wavs,/xlog,/ys,xs=1,pos=position,noerase=1,xtickformat='(A1)',color='Black',xr=xr,xtit=xtit,yr=[0.0,2.0],yticks=2,ymino=2,xticklen=0.1,ytickformat='(F6.2)',charsize=1.0 xyouts,pospltxt[0],pospltxt[1],textoidl('norm'),color=0,/normal,charsize=1.1 endif else begin ;normal plot 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 cgaxis, xaxis=1 ,xlog=1 ,xrange=((!const.c*1E6/xr)*1E-9),charsize=1.15,title=textoidl('\nu (GHz)'),xticklen=0.05,xminor=10 xyouts,pospltxt[0],pospltxt[1],textoidl('I_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.1 endelse endif else begin ;when the data is present if keyword_set(norm) then begin if keyword_set(refresh) then begin ;The data points in the plot that are being refreshed IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.sed).wav)[idx_spec] yy=prediction[idx_spec] rms=3.*((*!dustem_data.sed).sigma)(idx_spec)/2. cgoplot,xx,((*!dustem_data.sed).values)[idx_spec]/yy,color='Powder Blue',psym=16,syms=0.8,noerase=1,pos=position cgerrplot,((*!dustem_data.sed).wav)(idx_spec),(((*!dustem_data.sed).values)[idx_spec]-rms)/yy,(((*!dustem_data.sed).values)[idx_spec]+rms)/yy,color='Powder Blue' ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.sed).wav)[idx_filt] yy=prediction[idx_filt] rms=3.*((*!dustem_data.sed).sigma)(idx_filt)/2. cgoplot,xx,((*!dustem_data.sed).values)[idx_filt]/yy,psym=16,color='Dodger Blue',syms=0.8,noerase=1,pos=position cgerrplot,((*!dustem_data.sed).wav)(idx_filt),(((*!dustem_data.sed).values)[idx_filt]-rms)/yy,(((*!dustem_data.sed).values)[idx_filt]+rms)/yy,color='Dodger Blue';,/overplot ENDIF endif else begin ;The data points in the plot that remain unchanged ; UNNECESSARY BLOCK but needede to limit erros when calls are made with missing keywords. xtit=textoidl('\lambda (\mum)') if !run_pol then xtit = '' cgplot,wavs,wavs/wavs,/xlog,/ys,xs=1,pos=position,noerase=1,xtickformat='(A1)',color='Black',xr=xr,xtit=xtit,yr=[0.0,2.0],yticks=2,ymino=2,xticklen=0.1,ytickformat='(F6.2)',charsize=1.0 xyouts,pospltxt[0],pospltxt[1],textoidl('norm'),color=0,/normal,charsize=1.1 endelse endif else begin ; normal plot if keyword_set(refresh) then begin ;The data points in the plot are being refreshed ;Plotting of the spectra of the dust species FOR i=0L,Ngrains-1 DO BEGIN cgoplot,st.sed.wav,st.sed.(i+1)*fact,color=use_cols[i],pos=position,noerase=1 ENDFOR ;Plotting of the plugins. for i=0L,n_plgns-1 do begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_SED') THEN begin cgoplot,st.sed.wav,((*(*!dustem_plugin).(i))[*,0]),color=clrs_plgns[i],pos=position,noerase=1,linestyle=2 ENDIF endfor ;PLotting of the interpolates corresponding to spectrum and filter points IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.sed).wav)[idx_spec] yy=prediction[idx_spec] cgoplot,xx,yy,color='red',pos=position,psym=7,syms=2,noerase=1 ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.sed).wav)[idx_filt] yy=prediction[idx_filt] cgoplot,xx,yy,color='red',pos=position,psym=6,syms=2,noerase=1 ENDIF ;Plotting of the total dust emission spectrum cgoplot,st.sed.wav,spec,pos=position,noerase=1,/xlog,/ys,/xs,/ylog endif else begin ;The data points in the plot that remain unchanged. ;Spectrum points are treated before for plotting reasons. if ct_spec ne 0 then begin ;Plotting of spectrum data points (to be fitted) cgplot,((*!dustem_data.sed).wav)(idx_spec),((*!dustem_data.sed).values)(idx_spec),/ylog,/xlog,/ys,xs=9,pos=position,noerase=1,xtit=' ',charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,yr=yr,psym=8,syms=0.8,ytickformat='dstmwrp_exp' ;Plotting of the spectrum error points rms=3.*((*!dustem_data.sed).sigma)(idx_spec)/2. cgerrplot,((*!dustem_data.sed).wav)(idx_spec),((*!dustem_data.sed).values)(idx_spec)-rms,((*!dustem_data.sed).values)(idx_spec)+rms,color='Powder Blue' endif if ct_filt ne 0 then begin ;Plotting of filter data points (to be fitted) + testing for prior plotting if ct_spec ne 0 then cgoplot,((*!dustem_data.sed).wav)(idx_filt),((*!dustem_data.sed).values)(idx_filt),charsize=1.15,color='Dodger Blue',psym=8,syms=0.8,pos=position,/ys,xs=9,noerase=1,xtickformat='(A1)',xr=xr,yr=yr,ytickformat='dstmwrp_exp',/ylog,/xlog else $ cgplot,((*!dustem_data.sed).wav)(idx_filt),((*!dustem_data.sed).values)(idx_filt),charsize=1.15,color='Dodger Blue',psym=8,syms=0.8,pos=position,/ys,xs=9,noerase=1,xtickformat='(A1)',xtit=' ',xr=xr,yr=yr,ytickformat='dstmwrp_exp',/ylog,/xlog ;Plotting of the filter error points rms=3.*((*!dustem_data.sed).sigma)(idx_filt)/2.;/dustem_sed(idx_filt) cgerrplot,((*!dustem_data.sed).wav)(idx_filt),((*!dustem_data.sed).values)(idx_filt)-rms,((*!dustem_data.sed).values)(idx_filt)+rms,color='Dodger Blue' endif ;Plotting of frequency axis 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)') xyouts,pospltxt[0],pospltxt[1],textoidl('I_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.1 ;Locating all the hidden data points (spectrum+filter) match2,((*!dustem_data.sed).wav),((*!dustem_show.sed).wav),fit_sedpts,show_sedpts ;only show_sedpts is needed idx_rmv_sed=where(show_sedpts eq -1, ct_hdnpts) ; indices of the points to hide ;Locating the hidden spectrum and filter data points idx_filt_hdn = where((((*!dustem_show.sed).filt_names))(idx_rmv_sed) NE 'SPECTRUM',ct_filt_hdn) idx_spec_hdn = where(((*!dustem_show.sed).filt_names)(idx_rmv_sed) EQ 'SPECTRUM',ct_spec_hdn) if ct_hdnpts ne 0 then begin ;Hidden data points are present ;stop if ct_spec_hdn ne 0 then begin ;Plotting of hidden spectrum data points cgoplot,(((*!dustem_show.sed).wav)[idx_rmv_sed])(idx_spec_hdn),(((*!dustem_show.sed).values)[idx_rmv_sed])(idx_spec_hdn),pos=position,/ylog,/xlog,/ys,xs=9,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=yr,psym=8,syms=0.8 ;Plotting of hidden spectrum error points rms=3.*(((*!dustem_show.sed).sigma)[idx_rmv_sed])(idx_spec_hdn)/2. cgerrplot,(((*!dustem_show.sed).wav)[idx_rmv_sed])(idx_spec_hdn),(((*!dustem_show.sed).values)[idx_rmv_sed])(idx_spec_hdn)-rms,(((*!dustem_show.sed).values)[idx_rmv_sed])(idx_spec_hdn)+rms,color='Black' endif if ct_filt_hdn then begin ;Plotting of hidden filter data points cgoplot,(((*!dustem_show.sed).wav)[idx_rmv_sed])(idx_filt_hdn),(((*!dustem_show.sed).values)[idx_rmv_sed])(idx_filt_hdn),pos=position,/ylog,/xlog,/ys,xs=9,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=yr,psym=8,syms=0.8 ;Plotting of hidden filter error point rms=3.*(((*!dustem_show.sed).sigma)[idx_rmv_sed])(idx_filt_hdn)/2. cgerrplot,(((*!dustem_show.sed).wav)[idx_rmv_sed])(idx_filt_hdn),(((*!dustem_show.sed).values)[idx_rmv_sed])(idx_filt_hdn)-rms,(((*!dustem_show.sed).values)[idx_rmv_sed])(idx_filt_hdn)+rms,color='Black' endif endif endelse endelse endelse ;stop end 'EXT': begin end 'POLEXT': begin end 'POLSED': begin ;#NB: There seems to be an issue with the display of the dust species. 'Carbonaceous grains' 's emission exceeds the total emission. ;MABE AN ISSUE WITH HOW 'SPECPOL' refreshes? ;PROCEEDING TO POLFRAC idx_filt=where((*!dustem_data.polsed).filt_names NE 'SPECTRUM',ct_filt) idx_spec=where((*!dustem_data.polsed).filt_names EQ 'SPECTRUM',ct_spec) ;#1) get the plotting keywords (pertaining to each data set) @here when the _extra structure is ready if keyword_set(nodata) then begin ;when the data is not present if keyword_set(norm) then begin ;normalized plot xtit=textoidl('\lambda (\mum)') if !run_pol then xtit = '' cgplot,wavs,wavs/wavs,/xlog,/ys,xs=1,pos=position,noerase=1,xtickformat='(A1)',color='Black',xr=xr,xtit=xtit,yr=[0.0,2.0],yticks=2,ymino=2,xticklen=0.1,ytickformat='(F6.2)',charsize=1.0 xyouts,pospltxt[0],pospltxt[1],textoidl('norm'),color=0,/normal,charsize=1.1 endif else begin ;normal plot 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 cgaxis, xaxis=1 ,xlog=1 ,xrange=((!const.c*1E6/xr)*1E-9),charsize=1.15,title=textoidl('\nu (GHz)'),xticklen=0.05,xminor=10 xyouts,pospltxt[0],pospltxt[1],textoidl('P_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.1 endelse endif else begin ;when the data is present if keyword_set(norm) then begin if keyword_set(refresh) then begin ;The data points in the plot that are being refreshed IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.polsed).wav)[idx_spec] yy=prediction[idx_spec] rms=3.*((*!dustem_data.polsed).sigma)(idx_spec)/2. cgoplot,xx,((*!dustem_data.polsed).values)[idx_spec]/yy,color='Powder Blue',psym=16,syms=0.8,noerase=1,pos=position 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' ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.polsed).wav)[idx_filt] yy=prediction[idx_filt] rms=3.*((*!dustem_data.polsed).sigma)(idx_filt)/2. cgoplot,xx,((*!dustem_data.polsed).values)[idx_filt]/yy,psym=16,color='Dodger Blue',syms=0.8,noerase=1,pos=position 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 ENDIF endif else begin ;The data points in the plot that remain unchanged ; UNNECESSARY BLOCK but needede to limit erros when calls are made with missing keywords. xtit=textoidl('\lambda (\mum)') if !run_pol then xtit = '' cgplot,wavs,wavs/wavs,/xlog,/ys,xs=1,pos=position,noerase=1,xtickformat='(A1)',color='Black',xr=xr,xtit=xtit,yr=[0.0,2.0],yticks=2,ymino=2,xticklen=0.1,ytickformat='(F6.2)',charsize=1.0 xyouts,pospltxt[0],pospltxt[1],textoidl('norm'),color=0,/normal,charsize=1.1 endelse endif else begin ; normal plot if keyword_set(refresh) then begin ;The data points in the plot are being refreshed ;Plotting of the spectra of the dust species FOR i=0L,Ngrains-1 DO BEGIN cgoplot,st.polsed.wav,st.polsed.(i+1)*fact,color=use_cols[i],pos=position,noerase=1 ENDFOR ;stop ;Plotting of the plugins. for i=0L,n_plgns-1 do begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_polsed') THEN begin cgoplot,st.polsed.wav,sqrt(((*(*!dustem_plugin).(i))[*,1])^2+((*(*!dustem_plugin).(i))[*,2])^2),color=clrs_plgns[i],pos=position,noerase=1,linestyle=2 ENDIF endfor ;PLotting of the interpolates corresponding to spectrum and filter points IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.polsed).wav)[idx_spec] yy=prediction[idx_spec] cgoplot,xx,yy,color='red',pos=position,psym=7,syms=2,noerase=1 ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.polsed).wav)[idx_filt] yy=prediction[idx_filt] cgoplot,xx,yy,color='red',pos=position,psym=6,syms=2,noerase=1 ENDIF ;Plotting of the total dust emission spectru cgoplot,st.polsed.wav,specpol,pos=position,noerase=1,/xlog,/ys,/xs,/ylog endif else begin ;The data points in the plot that remain unchanged. ;Spectrum points are treated before for plotting reasons. if ct_spec ne 0 then begin ;Plotting of spectrum data points (to be fitted) cgplot,((*!dustem_data.polsed).wav)(idx_spec),((*!dustem_data.polsed).values)(idx_spec),/ylog,/xlog,/ys,xs=9,pos=position,noerase=1,xtit=' ',charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,yr=yr,psym=8,syms=0.8,ytickformat='dstmwrp_exp' ;Plotting of the spectrum error points rms=3.*((*!dustem_data.polsed).sigma)(idx_spec)/2. cgerrplot,((*!dustem_data.polsed).wav)(idx_spec),((*!dustem_data.polsed).values)(idx_spec)-rms,((*!dustem_data.polsed).values)(idx_spec)+rms,color='Powder Blue' endif if ct_filt ne 0 then begin plotsym,0,/fill ;Plotting of filter data points (to be fitted) + testing for prior plotting if ct_spec ne 0 then cgoplot,((*!dustem_data.polsed).wav)(idx_filt),((*!dustem_data.polsed).values)(idx_filt),charsize=1.15,color='Dodger Blue',psym=8,syms=0.8,pos=position,/ys,xs=9,noerase=1,xtickformat='(A1)',xr=xr,yr=yr,ytickformat='dstmwrp_exp',/ylog,/xlog else $ cgplot,((*!dustem_data.polsed).wav)(idx_filt),((*!dustem_data.polsed).values)(idx_filt),charsize=1.15,color='Dodger Blue',psym=8,syms=0.8,pos=position,/ys,xs=9,noerase=1,xtickformat='(A1)',xtit=' ',xr=xr,yr=yr,ytickformat='dstmwrp_exp',/ylog,/xlog ;Plotting of the filter error points rms=3.*((*!dustem_data.polsed).sigma)(idx_filt)/2.;/dustem_polsed(idx_filt) cgerrplot,((*!dustem_data.polsed).wav)(idx_filt),((*!dustem_data.polsed).values)(idx_filt)-rms,((*!dustem_data.polsed).values)(idx_filt)+rms,color='Dodger Blue' endif ;Plotting of frequency axis 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)') xyouts,pospltxt[0],pospltxt[1],textoidl('P_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.1 ;Locating all the hidden data points (spectrum+filter) match2,((*!dustem_data.polsed).wav),((*!dustem_show.polsed).wav),fit_polsedpts,show_polsedpts ;only show_polsedpts is needed idx_rmv_polsed=where(show_polsedpts eq -1, ct_hdnpts) ; indices of the points to hide ;Locating the hidden spectrum and filter data points idx_filt_hdn = where((((*!dustem_show.polsed).filt_names))(idx_rmv_polsed) NE 'SPECTRUM',ct_filt_hdn) idx_spec_hdn = where(((*!dustem_show.polsed).filt_names)(idx_rmv_polsed) EQ 'SPECTRUM',ct_spec_hdn) ;stop if ct_hdnpts ne 0 then begin ;Hidden data points are present ;stop if ct_spec_hdn ne 0 then begin ;Plotting of hidden spectrum data points cgplot,(((*!dustem_show.polsed).wav)[idx_rmv_polsed])(idx_spec_hdn),(((*!dustem_show.polsed).values)[idx_rmv_polsed])(idx_spec_hdn),pos=position,/ylog,/xlog,/ys,xs=9,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=yr,psym=8,syms=0.8 ;Plotting of hidden spectrum error points rms=3.*(((*!dustem_show.polsed).sigma)[idx_rmv_polsed])(idx_spec_hdn)/2. cgerrplot,(((*!dustem_show.polsed).wav)[idx_rmv_polsed])(idx_spec_hdn),(((*!dustem_show.polsed).values)[idx_rmv_polsed])(idx_spec_hdn)-rms,(((*!dustem_show.polsed).values)[idx_rmv_polsed])(idx_spec_hdn)+rms,color='Black' endif if ct_filt_hdn ne 0 then begin ;Plotting of hidden filter data points cgplot,(((*!dustem_show.polsed).wav)[idx_rmv_polsed])(idx_filt_hdn),(((*!dustem_show.polsed).values)[idx_rmv_polsed])(idx_filt_hdn),pos=position,/ylog,/xlog,/ys,xs=9,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=yr,psym=8,syms=0.8 ;Plotting of hidden filter error point rms=3.*(((*!dustem_show.polsed).sigma)[idx_rmv_polsed])(idx_filt_hdn)/2. cgerrplot,(((*!dustem_show.polsed).wav)[idx_rmv_polsed])(idx_filt_hdn),(((*!dustem_show.polsed).values)[idx_rmv_polsed])(idx_filt_hdn)-rms,(((*!dustem_show.polsed).values)[idx_rmv_polsed])(idx_filt_hdn)+rms,color='Black' endif endif endelse endelse endelse end 'POLFRAC': begin ; YOU NEED TO CODE THIS PART - TOU STILL HAVE'NT FINISHED. idx_filt=where((*!dustem_data.polfrac).filt_names NE 'SPECTRUM',ct_filt) idx_spec=where((*!dustem_data.polfrac).filt_names EQ 'SPECTRUM',ct_spec) ;#1) get the plotting keywords (pertaining to each data set) @here when the _extra structure is ready if keyword_set(nodata) then begin ;when the data is not present xtit = '' 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-03,50.00],/ylog,psym=8,syms=0.8 xyouts,pospltxt[0],pospltxt[1],textoidl('p_{\nu} (%)'),color=0,/normal,charsize=1.1 endif else begin ;when the data is present ; normal plot if keyword_set(refresh) then begin ;The data points in the plot are being refreshed ;##################TAKEN FROM SED ;Plotting of the spectra of the dust species ;I THINK I WILL HAVE AN ERROR HERE BECAUSE I WILL HAVE TO DIVIDE TWO ARRAYS FOR EACH DUST SPECIES. ; (st.polsed.(i+1)/st.sed.(i+1))*fact ;There is an issue with the fact that there are grain species that are not polarized ;test and set a counter? YES FOR NOW ; FOR i=0L,Ngrains-1 DO BEGIN testneq = where(st.polsed.(i+1) ne 0, countneq) vecfin = st.polsed.(i+1)*0.0 ;SET the condition later if countneq ne 0 then vecfin[testneq] = (st.polsed.(i+1))[testneq]/(st.sed.(i+1))[testneq] cgoplot,st.polsed.wav,vecfin*100,pos=position,noerase=1,color=use_cols[i],xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=[1.00E-03,50.00] ENDFOR ;Plotting of the plugins. ;NB: YOU HAVE YET TO TEST THIS BLOCK. DON'T FORGET TO ADD A POLARIZATION FRACTION TO FF for instance. ; The thing is you've already had errors of that kind. ;PLUGINS SEEM TO HAVE ZERO NULL VALUES. THIS IS GOOD NEWS. LESS TESTING. ;BUT if you get errors you know it has to be the division of the two arrays. ;THE CHANGES SEEM LIKE THEY'RE GONNA WORK. ;MISSING KEYWORDS? for i=0L,n_plgns-1 do begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_POLSED') THEN begin cgoplot,st.polsed.wav,sqrt(((*(*!dustem_plugin).(i))[*,1])^2+((*(*!dustem_plugin).(i))[*,2])^2)/((*(*!dustem_plugin).(i))[*,0])*100,color=clrs_plgns[i],pos=position,noerase=1,linestyle=2 ENDIF endfor ;PLotting of the interpolates corresponding to spectrum and filter points IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.polfrac).wav)[idx_spec] yy=prediction[idx_spec] cgoplot,xx,yy*100,color='red',pos=position,psym=7,syms=2,noerase=1 ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.polfrac).wav)[idx_filt] yy=prediction[idx_filt] cgoplot,xx,yy*100,color='red',pos=position,psym=6,syms=2,noerase=1 ENDIF ;Plotting of the total dust emission spectrum cgoplot,st.polsed.wav,specpolfrac*100,pos=position,noerase=1,/xlog,/ys,/xs endif else begin ;The data points in the plot that remain unchanged. ;Plotting of frequency axis ;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)') ;Spectrum points are treated before for plotting reasons. if ct_spec ne 0 then begin ;Plotting of spectrum data points (to be fitted) cgplot,((*!dustem_data.polfrac).wav)(idx_spec),((*!dustem_data.polfrac).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-03,50.00],psym=16,syms=0.8;,ytickformat='dstmwrp_exp' ;Plotting of the spectrum error points rms=3.*((*!dustem_data.polfrac).sigma)(idx_spec)/2. cgerrplot,((*!dustem_data.polfrac).wav)(idx_spec),(((*!dustem_data.polfrac).values)(idx_spec)-rms)*100,(((*!dustem_data.polfrac).values)(idx_spec)+rms)*100,color='Powder Blue' endif if ct_filt ne 0 then begin ;Plotting of filter data points (to be fitted) + testing for prior plotting if ct_spec ne 0 then cgoplot,((*!dustem_data.polfrac).wav)(idx_filt),((*!dustem_data.polfrac).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-03,50.00],/xlog,/ylog else $;,ytickformat='dstmwrp_exp' cgplot,((*!dustem_data.polfrac).wav)(idx_filt),((*!dustem_data.polfrac).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-03,50.00],/xlog,/ylog;,ytickformat='dstmwrp_exp' ;Plotting of the filter error points rms=3.*((*!dustem_data.polfrac).sigma)(idx_filt)/2.;/dustem_polfrac(idx_filt) cgerrplot,((*!dustem_data.polfrac).wav)(idx_filt),(((*!dustem_data.polfrac).values)(idx_filt)-rms)*100,(((*!dustem_data.polfrac).values)(idx_filt)+rms)*100,color='Dodger Blue' endif xyouts,pospltxt[0],pospltxt[1],textoidl('p_{\nu} (%)'),color=0,/normal,charsize=1.1 ;Locating all the hidden data points (spectrum+filter) ;The filtering has been done prior (in the primary routine) match2,((*!dustem_data.polfrac).wav),((*!dustem_show.polfrac).wav),fit_polfracpts,show_polfracpts ;only show_polfracpts is needed idx_rmv_polfrac=where(show_polfracpts eq -1, ct_hdnpts) ; indices of the points to hide ;stop ;Locating the hidden spectrum and filter data points idx_filt_hdn = where(((*!dustem_show.polfrac).filt_names)(idx_rmv_polfrac) NE 'SPECTRUM',ct_filt_hdn) idx_spec_hdn = where(((*!dustem_show.polfrac).filt_names)(idx_rmv_polfrac) EQ 'SPECTRUM',ct_spec_hdn) if ct_hdnpts ne 0 then begin ;Hidden data points are present ;stop if ct_spec_hdn ne 0 then begin ;Plotting of hidden spectrum data points cgplot,(((*!dustem_show.polfrac).wav)[idx_rmv_polfrac])(idx_spec_hdn),(((*!dustem_show.polfrac).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-03,50.00],psym=8,syms=0.8 ;Plotting of hidden spectrum error points rms=3.*(((*!dustem_show.polfrac).sigma)[idx_rmv_polfrac])(idx_spec_hdn)/2. cgerrplot,(((*!dustem_show.polfrac).wav)[idx_rmv_polfrac])(idx_spec_hdn),((((*!dustem_show.polfrac).values)[idx_rmv_polfrac])(idx_spec_hdn)-rms)*100,((((*!dustem_show.polfrac).values)[idx_rmv_polfrac])(idx_spec_hdn)+rms)*100,color='Black' endif if ct_filt_hdn ne 0 then begin ;stop plotsym,0, /fill ;Plotting of hidden filter data points cgplot,(((*!dustem_show.polfrac).wav)[idx_rmv_polfrac])(idx_filt_hdn),(((*!dustem_show.polfrac).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-03,50.00],psym=8,syms=0.8 ;stop ;Plotting of hidden filter error point rms=3.*(((*!dustem_show.polfrac).sigma)[idx_rmv_polfrac])(idx_filt_hdn)/2. cgerrplot,(((*!dustem_show.polfrac).wav)[idx_rmv_polfrac])(idx_filt_hdn),((((*!dustem_show.polfrac).values)[idx_rmv_polfrac])(idx_filt_hdn)-rms)*100,((((*!dustem_show.polfrac).values)[idx_rmv_polfrac])(idx_filt_hdn)+rms)*100,color='Black' endif endif endelse endelse end '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 idx_filt=where((*!dustem_data.psi_em).filt_names NE 'SPECTRUM',ct_filt) idx_spec=where((*!dustem_data.psi_em).filt_names EQ 'SPECTRUM',ct_spec) ;#1) get the plotting keywords (pertaining to each data set) @here when the _extra structure is ready if keyword_set(nodata) then begin ;when the data is not present xtit = '' 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=[-90.00,90.00],psym=8,syms=0.8 xyouts,pospltxt[0],pospltxt[1],textoidl('\Psi_{\nu} (deg)'),color=0,/normal,charsize=1.1 endif else begin ;when the data is present ; normal plot if keyword_set(refresh) then begin ;The data points in the plot are being refreshed ;##################TAKEN FROM SED ;Plotting of the spectra of the dust species FOR i=0L,Ngrains-1 DO BEGIN polar_ippsi2iqu,st.sed.(i+1)*fact,specqgrain,specugrain,st.polsed.(i+1)*fact/spec,replicate(!dustem_psi,n_elements(spec)) ;temporary solution ;dustem_plot_mlog,st.polsed.wav,specqgrain,ppositions=position,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog cgoplot,st.polsed.wav,0.5*atan(specugrain,specqgrain)/degtorad,pos=position,noerase=1,color=use_cols[i],xr=xr,/xlog,ytickformat='(A1)',yr=[-90.00,90.00] ENDFOR ;Plotting of the plugins. for i=0L,n_plgns-1 do begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_POLSED') THEN begin ;dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,1],ppositions=position, /overplot, noerase=1, color=clrs_plgns[i], linestyle=2,xr=xr,/xlog cgoplot_mlog,st.polsed.wav,0.5*atan((*(*!dustem_plugin).(i))[*,2],(*(*!dustem_plugin).(i))[*,1])/degtorad,pos=position,noerase=1, color=clrs_plgns[i], linestyle=2 ,xr=xr,/xlog,ytickformat='(A1)',yr=[-90.00,90.00] ENDIF endfor ;PLotting of the interpolates corresponding to spectrum and filter points IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.psi_em).wav)[idx_spec] yy=prediction[idx_spec] cgoplot,xx,yy,color='red',pos=position,psym=7,syms=2,noerase=1 ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.psi_em).wav)[idx_filt] yy=prediction[idx_filt] cgoplot,xx,yy,color='red',pos=position,psym=6,syms=2,noerase=1 ENDIF ;Plotting of the total dust emission spectrum cgoplot,st.sed.wav,0.5*atan(specu,specq)/degtorad,pos=position,noerase=1,/xlog,/ys,/xs endif else begin ;The data points in the plot that remain unchanged. ;Plotting of frequency axis ;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)') ;Spectrum points are treated before for plotting reasons. if ct_spec ne 0 then begin ;Plotting of spectrum data points (to be fitted) cgplot,((*!dustem_data.psi_em).wav)(idx_spec),((*!dustem_data.psi_em).values)(idx_spec),/xlog,/ys,xs=1,pos=position,noerase=1,xtit=' ',charsize=1.15,xtickformat='(A1)',color='Powder Blue',xr=xr,yr=[-90.00,90.00],psym=16,syms=0.8;,ytickformat='dstmwrp_exp' ;Plotting of the spectrum error points rms=3.*((*!dustem_data.psi_em).sigma)(idx_spec)/2. cgerrplot,((*!dustem_data.psi_em).wav)(idx_spec),((*!dustem_data.psi_em).values)(idx_spec)-rms,((*!dustem_data.psi_em).values)(idx_spec)+rms,color='Powder Blue' endif if ct_filt ne 0 then begin ;Plotting of filter data points (to be fitted) + testing for prior plotting if ct_spec ne 0 then cgoplot,((*!dustem_data.psi_em).wav)(idx_filt),((*!dustem_data.psi_em).values)(idx_filt),charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,pos=position,/ys,xs=1,noerase=1,xtickformat='(A1)',xr=xr,yr=[-90.00,90.00],/xlog else $;,ytickformat='dstmwrp_exp' cgplot,((*!dustem_data.psi_em).wav)(idx_filt),((*!dustem_data.psi_em).values)(idx_filt),charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,pos=position,/ys,xs=1,noerase=1,xtickformat='(A1)',xtit=' ',xr=xr,yr=[-90.00,90.00],/xlog;,ytickformat='dstmwrp_exp' ;Plotting of the filter error points rms=3.*((*!dustem_data.psi_em).sigma)(idx_filt)/2.;/dustem_psi_em(idx_filt) cgerrplot,((*!dustem_data.psi_em).wav)(idx_filt),((*!dustem_data.psi_em).values)(idx_filt)-rms,((*!dustem_data.psi_em).values)(idx_filt)+rms,color='Dodger Blue' endif xyouts,pospltxt[0],pospltxt[1],textoidl('\Psi_{\nu} (deg)'),color=0,/normal,charsize=1.1 ;Locating all the hidden data points (spectrum+filter) ;The filtering has been done prior (in the primary routine) match2,((*!dustem_data.psi_em).wav),((*!dustem_show.psi_em).wav),fit_psi_empts,show_psi_empts ;only show_psi_empts is needed idx_rmv_psi_em=where(show_psi_empts eq -1, ct_hdnpts) ; indices of the points to hide ;stop ;Locating the hidden spectrum and filter data points idx_filt_hdn = where(((*!dustem_show.psi_em).filt_names)(idx_rmv_psi_em) NE 'SPECTRUM',ct_filt_hdn) idx_spec_hdn = where(((*!dustem_show.psi_em).filt_names)(idx_rmv_psi_em) EQ 'SPECTRUM',ct_spec_hdn) if ct_hdnpts ne 0 then begin ;Hidden data points are present ;stop if ct_spec_hdn ne 0 then begin ;Plotting of hidden spectrum data points cgplot,(((*!dustem_show.psi_em).wav)[idx_rmv_psi_em])(idx_spec_hdn),(((*!dustem_show.psi_em).values)[idx_rmv_psi_em])(idx_spec_hdn),pos=position,/xlog,/ys,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=[-90.00,90.00],psym=8,syms=0.8 ;Plotting of hidden spectrum error points rms=3.*(((*!dustem_show.psi_em).sigma)[idx_rmv_psi_em])(idx_spec_hdn)/2. cgerrplot,(((*!dustem_show.psi_em).wav)[idx_rmv_psi_em])(idx_spec_hdn),(((*!dustem_show.psi_em).values)[idx_rmv_psi_em])(idx_spec_hdn)-rms,(((*!dustem_show.psi_em).values)[idx_rmv_psi_em])(idx_spec_hdn)+rms,color='Black' endif if ct_filt_hdn ne 0 then begin ;stop plotsym,0, /fill ;Plotting of hidden filter data points cgplot,(((*!dustem_show.psi_em).wav)[idx_rmv_psi_em])(idx_filt_hdn),(((*!dustem_show.psi_em).values)[idx_rmv_psi_em])(idx_filt_hdn),pos=position,/xlog,/ys,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',color='Black',xr=xr,yr=[-90.00,90.00],psym=8,syms=0.8 ;stop ;Plotting of hidden filter error point rms=3.*(((*!dustem_show.psi_em).sigma)[idx_rmv_psi_em])(idx_filt_hdn)/2. cgerrplot,(((*!dustem_show.psi_em).wav)[idx_rmv_psi_em])(idx_filt_hdn),(((*!dustem_show.psi_em).values)[idx_rmv_psi_em])(idx_filt_hdn)-rms,(((*!dustem_show.psi_em).values)[idx_rmv_psi_em])(idx_filt_hdn)+rms,color='Black' endif endif ;stop endelse ;endelse endelse ;stop end 'PSI_EXT': begin end 'QSED': begin ; THE ONE I WILL BE WORKING ON ;SIGN-RELATED PARAMETERS/LOOPS HERE? ;negative & positive values regardless of data type (SPECTRUM or FILTER data points) ;WHAT HAPPENS TO NULL VALUES ? varvar=where((*!dustem_data.qsed).values GT 0, testpstv) varvar=where((*!dustem_data.qsed).values LT 0, testngtv) ;stop idx_filt=where((*!dustem_data.qsed).filt_names NE 'SPECTRUM', ct_filt) idx_spec=where((*!dustem_data.qsed).filt_names EQ 'SPECTRUM' , ct_spec) ;Plotting of frequency axis ;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)') ;stop ;Locating all the hidden data points (spectrum+filter) match2,((*!dustem_data.qsed).wav),((*!dustem_show.qsed).wav),fit_sedpts,show_sedpts ;only show_sedpts is needed idx_rmv_sed=where(show_sedpts eq -1, ct_hdnpts) ; indices of the points to hide stop ;#1) get the plotting keywords (pertaining to each data set) @here when the _extra structure is ready if keyword_set(nodata) then begin ;when the data is not present if keyword_set(norm) then begin ;normalized plot xtit=textoidl('\lambda (\mum)') if !run_pol then xtit = '' cgplot,wavs,wavs/wavs,/xlog,/ys,xs=1,pos=position,noerase=1,xtickformat='(A1)',color='Black',xr=xr,xtit=xtit,yr=[0.0,2.0],yticks=2,ymino=2,xticklen=0.1,ytickformat='(F6.2)',charsize=1.0 xyouts,pospltxt[0],pospltxt[1],textoidl('norm'),color=0,/normal,charsize=1.1 endif else begin ;normal plot 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 ;cgaxis, xaxis=1 ,xlog=1 ,xrange=((!const.c*1E6/xr)*1E-9),charsize=1.15,title=textoidl('\nu (GHz)'),xticklen=0.05,xminor=10 xyouts,pospltxt[0],pospltxt[1],textoidl('Q_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.1 endelse endif else begin ;when the data is present if keyword_set(norm) then begin if keyword_set(refresh) then begin ;The data points in the plot that are being refreshed ;MAJOR LOOP OVER THE SING??? - YES BECAUSE YOU NEED TO KNOW WHICH ONE IS THE IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.qsed).wav)[idx_spec] yy=prediction[idx_spec] rms=3.*((*!dustem_data.qsed).sigma)(idx_spec)/2. ; if testsgq ne 0 then dustem_plot_mlog,xx,((*!dustem_data.qsed).values)(idx_spec),ppositions=position,psym=16,color='Powder Blue',syms=0.8,noerase=1,/negative_only,/overplot else $ ; dustem_plot_mlog,xx,((*!dustem_data.qsed).values)(idx_spec),ppositions=position,((*!dustem_data.qsed).values)[idx_spec]/yy,psym=16,color='Powder Blue',syms=0.8,noerase=1,/positive_only,/overplot cgoplot,xx,((*!dustem_data.qsed).values)(idx_spec)/yy,pos=position,psym=16,color='Powder Blue',syms=0.8,noerase=1 cgerrplot,((*!dustem_data.qsed).wav)(idx_spec),(((*!dustem_data.qsed).values)[idx_spec]-rms)/yy,(((*!dustem_data.qsed).values)[idx_spec]+rms)/yy,color='Powder Blue' ENDIF IF ct_filt NE 0 THEN BEGIN ;stop xx=((*!dustem_data.qsed).wav)[idx_filt] yy=prediction[idx_filt] rms=3.*((*!dustem_data.qsed).sigma)(idx_filt)/2. ; if testsgq ne 0 then dustem_plot_mlog,xx,((*!dustem_data.qsed).values)(idx_filt),ppositions=position,psym=16,color='Dodger Blue',syms=0.8,noerase=1,/negative_only,/overplot else $ ; dustem_plot_mlog,xx,((*!dustem_data.qsed).values)(idx_filt),ppositions=position,psym=16,color='Dodger Blue',syms=0.8,noerase=1,/positive_only,/overplot cgoplot,xx,((*!dustem_data.qsed).values)(idx_filt)/yy,pos=position,psym=16,color='Dodger Blue',syms=0.8,noerase=1 cgerrplot,((*!dustem_data.qsed).wav)(idx_filt),(((*!dustem_data.qsed).values)[idx_filt]-rms)/yy,(((*!dustem_data.qsed).values)[idx_filt]+rms)/yy,color='Dodger Blue' ENDIF endif else begin ;The data points in the plot that remain unchanged ;stop xtit=textoidl('\lambda (\mum)') ;if !run_pol then xtit = '' cgplot,wavs,wavs/wavs,/xlog,/ys,xs=1,pos=position,noerase=1,color='Black',xr=xr,xtit=xtit,yr=[0.0,2.0],yticks=2,ymino=2,xticklen=0.1,ytickformat='(F6.2)',charsize=1.0 xyouts,pospltxt[0],pospltxt[1],textoidl('norm'),color=0,/normal,charsize=1.1 endelse endif else begin ; normal plot - STOPPED HERE FOR QSED if keyword_set(refresh) then begin ;The data points in the plot are being refreshed if keyword_set(positive_only) then begin if testpstv ne 0 then begin FOR i=0L,Ngrains-1 DO BEGIN polar_ippsi2iqu,st.sed.(i+1)*fact,specqgrain,specugrain,st.polsed.(i+1)*fact/spec,replicate(!dustem_psi,n_elements(spec)) ;temporary solution ;dustem_plot_mlog,st.polsed.wav,specqgrain,ppositions=position,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog dustem_plot_mlog,st.polsed.wav,specqgrain,ppositions=position,/positive_only,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDFOR for i=0L,n_plgns-1 do begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_POLSED') THEN begin ;dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,1],ppositions=position, /overplot, noerase=1, color=clrs_plgns[i], linestyle=2,xr=xr,/xlog dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,1],ppositions=position,/positive_only,/overplot,noerase=1, color=clrs_plgns[i], linestyle=2 ,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF endfor IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.qsed).wav)[idx_spec] yy=prediction[idx_spec] ;dustem_plot_mlog,xx,yy,ppositions=position,/overplot, noerase=1, color='red',psym=7,syms=2,xr=xr,/xlog dustem_plot_mlog,xx,yy,ppositions=position,/positive_only, /overplot, noerase=1, color='red',psym=7,syms=2,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.qsed).wav)[idx_filt] yy=prediction[idx_filt] ;dustem_plot_mlog,xx,yy,ppositions=position, /overplot, noerase=1, color='red',psym=6,syms=2,xr=xr,/xlog dustem_plot_mlog,xx,yy,ppositions=position,/positive_only, /overplot, noerase=1, color='red',psym=6,syms=2,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF dustem_plot_mlog,st.polsed.wav,specq,ppositions=position,/positive_only,/overplot,noerase=1,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr endif endif if keyword_set(negative_only) then begin if testngtv ne 0 then begin ;Plotting of the spectra of the dust species FOR i=0L,Ngrains-1 DO BEGIN polar_ippsi2iqu,st.sed.(i+1)*fact,specqgrain,specugrain,st.polsed.(i+1)*fact/spec,replicate(!dustem_psi,n_elements(spec)) ;temporary solution ;dustem_plot_mlog,st.polsed.wav,specqgrain,ppositions=position,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog dustem_plot_mlog,st.polsed.wav,specqgrain,ppositions=position,/negative_only,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDFOR ;Plotting of the plugins for i=0L,n_plgns-1 do begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_POLSED') THEN begin ;dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,1],ppositions=position, /overplot, noerase=1, color=clrs_plgns[i], linestyle=2,xr=xr,/xlog dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,1],ppositions=position,/negative_only,/overplot,noerase=1, color=clrs_plgns[i], linestyle=2 ,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF endfor ;PLotting of the interpolates corresponding to spectrum and filter points IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.qsed).wav)[idx_spec] yy=prediction[idx_spec] ;dustem_plot_mlog,xx,yy,ppositions=position,/overplot, noerase=1, color='red',psym=7,syms=2,xr=xr,/xlog dustem_plot_mlog,xx,yy,ppositions=position,/negative_only, /overplot, noerase=1, color='red',psym=7,syms=2,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.qsed).wav)[idx_filt] yy=prediction[idx_filt] ;dustem_plot_mlog,xx,yy,ppositions=position, /overplot, noerase=1, color='red',psym=6,syms=2,xr=xr,/xlog dustem_plot_mlog,xx,yy,ppositions=position,/negative_only, /overplot, noerase=1, color='red',psym=6,syms=2,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF ;Plotting of the total dust emission spectrum dustem_plot_mlog,st.polsed.wav,specq,ppositions=position,/negative_only,/overplot,noerase=1,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr endif endif ;stop endif else begin ;The data points in the plot that remain unchanged.; DO NOT USE AN ELSE HERE. ;stop ;cgaxis, xaxis=1,xlog=1, xs=1,charsize=1.5,xtickformat='(A1)' xyouts,pospltxt[0],pospltxt[1],textoidl('Q_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.1 ;if ct_hdnpts ne 0 then begin ;Hidden data points are present ;Locating the hidden spectrum and filter data points ;SADLY I STILL DON'T HAVE A SOLUTION FOR THE PLOTTING OF NULL VALUES. ;idx_filt_hdn = where(((*!dustem_show.qsed).filt_names)(idx_rmv_sed) NE 'SPECTRUM',ct_filt_hdn) ;idx_spec_hdn = where(((*!dustem_show.qsed).filt_names)(idx_rmv_sed) EQ 'SPECTRUM',ct_spec_hdn) if ct_hdnpts then begin idx_filt_hdn_pstv = where(((*!dustem_show.qsed).filt_names)(idx_rmv_sed) NE 'SPECTRUM' and ((*!dustem_show.qsed).values)(idx_rmv_sed) gt 0,ct_filt_hdn_pstv) idx_spec_hdn_pstv = where(((*!dustem_show.qsed).filt_names)(idx_rmv_sed) EQ 'SPECTRUM' and ((*!dustem_show.qsed).values)(idx_rmv_sed) gt 0,ct_spec_hdn_pstv) idx_filt_hdn_ngtv = where(((*!dustem_show.qsed).filt_names)(idx_rmv_sed) NE 'SPECTRUM' and ((*!dustem_show.qsed).values)(idx_rmv_sed) lt 0,ct_filt_hdn_ngtv) idx_spec_hdn_ngtv = where(((*!dustem_show.qsed).filt_names)(idx_rmv_sed) EQ 'SPECTRUM' and ((*!dustem_show.qsed).values)(idx_rmv_sed) lt 0,ct_spec_hdn_ngtv) endif if keyword_set(positive_only) then begin ;stop if testpstv ne 0 then begin ;stop ;plotsym, 0 if ct_hdnpts then begin if ct_spec_hdn_pstv ne 0 then begin xx = (((*!dustem_show.qsed).wav)[idx_rmv_sed])(idx_spec_hdn_pstv) yy = (((*!dustem_show.qsed).values)[idx_rmv_sed])(idx_spec_hdn_pstv) rms=3.*(((*!dustem_show.qsed).sigma)[idx_rmv_sed])(idx_spec_hdn_pstv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,noerase=1,color='Black',/overplot,rms=rms,yr=yr,xtickformat='(A1)',xr=xr,xs=1,/xlog,/ylog;,psym=8,syms=0.8 endif if ct_filt_hdn_pstv ne 0 then begin xx = (((*!dustem_show.qsed).wav)[idx_rmv_sed])(idx_filt_hdn_pstv) yy = (((*!dustem_show.qsed).values)[idx_rmv_sed])(idx_filt_hdn_pstv) rms=3.*(((*!dustem_show.qsed).sigma)[idx_rmv_sed])(idx_filt_hdn_pstv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,color='Black',/overplot,rms=rms,xr=xr,yr=yr,xtickformat='(A1)',/xlog,/ylog;,psym=8,syms=0.8 endif endif if ct_spec ne 0 then begin rms=3.*((*!dustem_data.qsed).sigma)(idx_spec)/2. ;dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),-((*!dustem_data.qsed).values)(idx_spec),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,/nodata,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),((*!dustem_data.qsed).values)(idx_spec),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),((*!dustem_data.qsed).values)(idx_spec),ppositions=position,color='Dodger Blue',/positive_only,noerase=1,/overplot,rms=rms,xtit='',charsize=1.15,xtickformat='(A1)',xs=1,psym=16,syms=0.8,xr=xr,/xlog,/ylog,yr=yr,ytickformat='(A1)' endif if ct_filt ne 0 then begin rms=3.*((*!dustem_data.qsed).sigma)(idx_filt)/2. ; dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),-1.*((*!dustem_data.qsed).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,/nodata,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),((*!dustem_data.qsed).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),((*!dustem_data.qsed).values)(idx_filt),ppositions=position,color='Dodger Blue',/positive_only,noerase=1,/overplot,rms=rms,xtit='',charsize=1.15,xtickformat='(A1)',xs=1,psym=16,syms=0.8,xr=xr,/xlog,/ylog,yr=yr,ytickformat='(A1)' endif endif else begin if ct_hdnpts then begin if ct_spec_hdn_pstv ne 0 then begin xx = (((*!dustem_show.qsed).wav)[idx_rmv_sed])(idx_spec_hdn_pstv) yy = (((*!dustem_show.qsed).values)[idx_rmv_sed])(idx_spec_hdn_pstv) rms=3.*(((*!dustem_show.qsed).sigma)[idx_rmv_sed])(idx_spec_hdn_pstv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,noerase=1,color='Black',/overplot,rms=rms,yr=yr,xtickformat='(A1)',xr=xr,xs=1,/xlog,/ylog;,psym=8,syms=0.8 endif if ct_filt_hdn_pstv ne 0 then begin xx = (((*!dustem_show.qsed).wav)[idx_rmv_sed])(idx_filt_hdn_pstv) yy = (((*!dustem_show.qsed).values)[idx_rmv_sed])(idx_filt_hdn_pstv) rms=3.*(((*!dustem_show.qsed).sigma)[idx_rmv_sed])(idx_filt_hdn_pstv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,color='Black',/overplot,rms=rms,xr=xr,yr=yr,xtickformat='(A1)',/xlog,/ylog;,psym=8,syms=0.8 endif if ct_spec_hdn_pstv eq 0 and ct_filt_hdn_pstv eq 0 then begin if ct_spec ne 0 then dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),-((*!dustem_data.qsed).values)(idx_spec),ppositions=position,charsize=1.15,/nodata,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' if ct_filt ne 0 then dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),-((*!dustem_data.qsed).values)(idx_filt),/nodata,ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' endif endif ;add condition here for the plotting of empty plots using the lines above if they work. endelse endif if keyword_set(negative_only) then begin if testngtv ne 0 then begin ;plotsym, 0 if ct_hdnpts then begin if ct_spec_hdn_ngtv ne 0 then begin xx = (((*!dustem_show.qsed).wav)[idx_rmv_sed])(idx_spec_hdn_ngtv) yy = (((*!dustem_show.qsed).values)[idx_rmv_sed])(idx_spec_hdn_ngtv) rms=3.*(((*!dustem_show.qsed).sigma)[idx_rmv_sed])(idx_spec_hdn_ngtv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,noerase=1,color='Black',/overplot,rms=rms,yr=yr,xtickformat='(A1)',xr=xr,xs=1,/xlog,/ylog;,psym=8,syms=0.8 endif if ct_filt_hdn_ngtv ne 0 then begin xx = (((*!dustem_show.qsed).wav)[idx_rmv_sed])(idx_filt_hdn_ngtv) yy = (((*!dustem_show.qsed).values)[idx_rmv_sed])(idx_filt_hdn_ngtv) rms=3.*(((*!dustem_show.qsed).sigma)[idx_rmv_sed])(idx_filt_hdn_ngtv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,color='Black',/overplot,rms=rms,xr=xr,yr=yr,xtickformat='(A1)',/xlog,/ylog;,psym=8,syms=0.8 endif endif if ct_spec ne 0 then begin rms=3.*((*!dustem_data.qsed).sigma)(idx_spec)/2. ;dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),-((*!dustem_data.qsed).values)(idx_spec),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,/nodata,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ; if ct_spec_hdn_ngtv ne 0 then dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),((*!dustem_data.qsed).values)(idx_spec),ppositions=position,/overplot,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr else begin dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),((*!dustem_data.qsed).values)(idx_spec),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;endelse;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),((*!dustem_data.qsed).values)(idx_spec),ppositions=position,color='Dodger Blue',/negative_only,noerase=1,/overplot,rms=rms,xtit='',charsize=1.15,xtickformat='(A1)',xs=1,xr=xr,/xlog,/ylog,yr=yr,ytickformat='(A1)';,psym=16,syms=0.8 endif if ct_filt ne 0 then begin rms=3.*((*!dustem_data.qsed).sigma)(idx_filt)/2. ; dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),-1.*((*!dustem_data.qsed).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,/nodata,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;if ct_filt_hdn_ngtv ne 0 then dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),((*!dustem_data.qsed).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',/overplot,psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr else begin dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),((*!dustem_data.qsed).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;endelse ;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),((*!dustem_data.qsed).values)(idx_filt),ppositions=position,color='Dodger Blue',/negative_only,noerase=1,/overplot,rms=rms,xtit='',charsize=1.15,xtickformat='(A1)',xs=1,xr=xr,/xlog,/ylog,yr=yr,ytickformat='(A1)' endif endif else begin if ct_hdnpts then begin if ct_spec_hdn_ngtv ne 0 then begin xx = (((*!dustem_show.qsed).wav)[idx_rmv_sed])(idx_spec_hdn_ngtv) yy = (((*!dustem_show.qsed).values)[idx_rmv_sed])(idx_spec_hdn_ngtv) rms=3.*(((*!dustem_show.qsed).sigma)[idx_rmv_sed])(idx_spec_hdn_ngtv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,noerase=1,color='Black',/overplot,rms=rms,yr=yr,xtickformat='(A1)',xr=xr,xs=1,/xlog,/ylog;,psym=8,syms=0.8 endif if ct_filt_hdn_ngtv ne 0 then begin xx = (((*!dustem_show.qsed).wav)[idx_rmv_sed])(idx_filt_hdn_ngtv) yy = (((*!dustem_show.qsed).values)[idx_rmv_sed])(idx_filt_hdn_ngtv) rms=3.*(((*!dustem_show.qsed).sigma)[idx_rmv_sed])(idx_filt_hdn_ngtv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,color='Black',/overplot,rms=rms,xr=xr,yr=yr,xtickformat='(A1)',/xlog,/ylog;,psym=8,syms=0.8 endif if ct_spec_hdn_ngtv eq 0 and ct_filt_hdn_ngtv eq 0 then begin if ct_spec ne 0 then dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_spec),-((*!dustem_data.qsed).values)(idx_spec),ppositions=position,charsize=1.15,/nodata,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' if ct_filt ne 0 then dustem_plot_mlog,((*!dustem_data.qsed).wav)(idx_filt),-((*!dustem_data.qsed).values)(idx_filt),/nodata,ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' endif endif endelse endif endelse endelse endelse ; END 'USED': begin ;SIGN-RELATED PARAMETERS/LOOPS HERE? ;negative & positive values regardless of data type (SPECTRUM or FILTER data points) varvar=where((*!dustem_data.used).values LT 0, testngtv) varvar=where((*!dustem_data.used).values GT 0, testpstv) ;stop idx_filt=where((*!dustem_data.used).filt_names NE 'SPECTRUM', ct_filt) idx_spec=where((*!dustem_data.used).filt_names EQ 'SPECTRUM' , ct_spec) ;Plotting of frequency axis ;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)') ;stop ;Locating all the hidden data points (spectrum+filter) match2,((*!dustem_data.used).wav),((*!dustem_show.used).wav),fit_sedpts,show_sedpts ;only show_sedpts is needed idx_rmv_sed=where(show_sedpts eq -1, ct_hdnpts) ; indices of the points to hide stop ;#1) get the plotting keywords (pertaining to each data set) @here when the _extra structure is ready if keyword_set(nodata) then begin ;when the data is not present if keyword_set(norm) then begin ;normalized plot xtit=textoidl('\lambda (\mum)') if !run_pol then xtit = '' cgplot,wavs,wavs/wavs,/xlog,/ys,xs=1,pos=position,noerase=1,xtickformat='(A1)',color='Black',xr=xr,xtit=xtit,yr=[0.0,2.0],yticks=2,ymino=2,xticklen=0.1,ytickformat='(F6.2)',charsize=1.0 xyouts,pospltxt[0],pospltxt[1],textoidl('norm'),color=0,/normal,charsize=1.1 endif else begin ;normal plot 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 ;cgaxis, xaxis=1 ,xlog=1 ,xrange=((!const.c*1E6/xr)*1E-9),charsize=1.15,title=textoidl('\nu (GHz)'),xticklen=0.05,xminor=10 xyouts,pospltxt[0],pospltxt[1],textoidl('U_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.1 endelse endif else begin ;when the data is present if keyword_set(norm) then begin if keyword_set(refresh) then begin ;The data points in the plot that are being refreshed ;MAJOR LOOP OVER THE SING??? - YES BECAUSE YOU NEED TO KNOW WHICH ONE IS THE IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.used).wav)[idx_spec] yy=prediction[idx_spec] rms=3.*((*!dustem_data.used).sigma)(idx_spec)/2. ; if testsgq ne 0 then dustem_plot_mlog,xx,((*!dustem_data.used).values)(idx_spec),ppositions=position,psym=16,color='Powder Blue',syms=0.8,noerase=1,/negative_only,/overplot else $ ; dustem_plot_mlog,xx,((*!dustem_data.used).values)(idx_spec),ppositions=position,((*!dustem_data.used).values)[idx_spec]/yy,psym=16,color='Powder Blue',syms=0.8,noerase=1,/positive_only,/overplot cgoplot,xx,((*!dustem_data.used).values)(idx_spec)/yy,pos=position,psym=16,color='Powder Blue',syms=0.8,noerase=1 cgerrplot,((*!dustem_data.used).wav)(idx_spec),(((*!dustem_data.used).values)[idx_spec]-rms)/yy,(((*!dustem_data.used).values)[idx_spec]+rms)/yy,color='Powder Blue' ENDIF IF ct_filt NE 0 THEN BEGIN ;stop xx=((*!dustem_data.used).wav)[idx_filt] yy=prediction[idx_filt] rms=3.*((*!dustem_data.used).sigma)(idx_filt)/2. ; if testsgq ne 0 then dustem_plot_mlog,xx,((*!dustem_data.used).values)(idx_filt),ppositions=position,psym=16,color='Dodger Blue',syms=0.8,noerase=1,/negative_only,/overplot else $ ; dustem_plot_mlog,xx,((*!dustem_data.used).values)(idx_filt),ppositions=position,psym=16,color='Dodger Blue',syms=0.8,noerase=1,/positive_only,/overplot cgoplot,xx,((*!dustem_data.used).values)(idx_filt)/yy,pos=position,psym=16,color='Dodger Blue',syms=0.8,noerase=1 cgerrplot,((*!dustem_data.used).wav)(idx_filt),(((*!dustem_data.used).values)[idx_filt]-rms)/yy,(((*!dustem_data.used).values)[idx_filt]+rms)/yy,color='Dodger Blue' ENDIF endif else begin ;The data points in the plot that remain unchanged ;stop xtit=textoidl('\lambda (\mum)') ;if !run_pol then xtit = '' cgplot,wavs,wavs/wavs,/xlog,/ys,xs=1,pos=position,noerase=1,color='Black',xr=xr,xtit=xtit,yr=[0.0,2.0],yticks=2,ymino=2,xticklen=0.1,ytickformat='(F6.2)',charsize=1.0 xyouts,pospltxt-[0],pospltxt[1],textoidl('norm'),color=0,/normal,charsize=1.1 endelse endif else begin ; normal plot - STOPPED HERE FOR used if keyword_set(refresh) then begin ;The data points in the plot are being refreshed if keyword_set(positive_only) then begin if testpstv ne 0 then begin FOR i=0L,Ngrains-1 DO BEGIN polar_ippsi2iqu,st.sed.(i+1)*fact,specqgrain,specugrain,st.polsed.(i+1)*fact/spec,replicate(!dustem_psi,n_elements(spec)) ;temporary solution ;dustem_plot_mlog,st.polsed.wav,specqgrain,ppositions=position,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog dustem_plot_mlog,st.polsed.wav,specugrain,ppositions=position,/positive_only,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDFOR for i=0L,n_plgns-1 do begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_POLSED') THEN begin ;dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,1],ppositions=position, /overplot, noerase=1, color=clrs_plgns[i], linestyle=2,xr=xr,/xlog dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,2],ppositions=position,/positive_only,/overplot,noerase=1, color=clrs_plgns[i], linestyle=2 ,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF endfor IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.used).wav)[idx_spec] yy=prediction[idx_spec] ;dustem_plot_mlog,xx,yy,ppositions=position,/overplot, noerase=1, color='red',psym=7,syms=2,xr=xr,/xlog dustem_plot_mlog,xx,yy,ppositions=position,/positive_only, /overplot, noerase=1, color='red',psym=7,syms=2,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.used).wav)[idx_filt] yy=prediction[idx_filt] ;dustem_plot_mlog,xx,yy,ppositions=position, /overplot, noerase=1, color='red',psym=6,syms=2,xr=xr,/xlog dustem_plot_mlog,xx,yy,ppositions=position,/positive_only, /overplot, noerase=1, color='red',psym=6,syms=2,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF dustem_plot_mlog,st.polsed.wav,specu,ppositions=position,/positive_only,/overplot,noerase=1,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr endif endif if keyword_set(negative_only) then begin if testngtv ne 0 then begin ;Plotting of the spectra of the dust species FOR i=0L,Ngrains-1 DO BEGIN polar_ippsi2iqu,st.sed.(i+1)*fact,specqgrain,specugrain,st.polsed.(i+1)*fact/spec,replicate(!dustem_psi,n_elements(spec)) ;temporary solution ;dustem_plot_mlog,st.polsed.wav,specqgrain,ppositions=position,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog dustem_plot_mlog,st.polsed.wav,specugrain,ppositions=position,/negative_only,/overplot,noerase=1,color=use_cols[i],xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDFOR ;Plotting of the plugins for i=0L,n_plgns-1 do begin IF total(strsplit((*(*!dustem_scope).(i)),'+',/extract) EQ 'ADD_POLSED') THEN begin ;dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,1],ppositions=position, /overplot, noerase=1, color=clrs_plgns[i], linestyle=2,xr=xr,/xlog dustem_plot_mlog,st.polsed.wav,(*(*!dustem_plugin).(i))[*,2],ppositions=position,/negative_only,/overplot,noerase=1, color=clrs_plgns[i], linestyle=2 ,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF endfor ;PLotting of the interpolates corresponding to spectrum and filter points IF ct_spec NE 0 THEN BEGIN xx=((*!dustem_data.used).wav)[idx_spec] yy=prediction[idx_spec] ;dustem_plot_mlog,xx,yy,ppositions=position,/overplot, noerase=1, color='red',psym=7,syms=2,xr=xr,/xlog dustem_plot_mlog,xx,yy,ppositions=position,/negative_only, /overplot, noerase=1, color='red',psym=7,syms=2,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.used).wav)[idx_filt] yy=prediction[idx_filt] ;dustem_plot_mlog,xx,yy,ppositions=position, /overplot, noerase=1, color='red',psym=6,syms=2,xr=xr,/xlog dustem_plot_mlog,xx,yy,ppositions=position,/negative_only, /overplot, noerase=1, color='red',psym=6,syms=2,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr ENDIF ;Plotting of the total dust emission spectrum dustem_plot_mlog,st.polsed.wav,specu,ppositions=position,/negative_only,/overplot,noerase=1,xr=xr,/xlog,/ylog,ytickformat='(A1)',yr=yr endif endif ;stop endif else begin ;The data points in the plot that remain unchanged. ;stop ;cgaxis, xaxis=1,xlog=1, xs=1,charsize=1.5,xtickformat='(A1)' xyouts,pospltxt[0],pospltxt[1],textoidl('U_{\nu} (MJy/sr)'),color=0,/normal,charsize=1.1 ;if ct_hdnpts ne 0 then begin ;Hidden data points are present ;Locating the hidden spectrum and filter data points ;SADLY I STILL DON'T HAVE A SOLUTION FOR THE PLOTTING OF NULL VALUES. ;idx_filt_hdn = where(((*!dustem_show.used).filt_names)(idx_rmv_sed) NE 'SPECTRUM',ct_filt_hdn) ;idx_spec_hdn = where(((*!dustem_show.used).filt_names)(idx_rmv_sed) EQ 'SPECTRUM',ct_spec_hdn) if ct_hdnpts then begin idx_filt_hdn_pstv = where(((*!dustem_show.used).filt_names)(idx_rmv_sed) NE 'SPECTRUM' and ((*!dustem_show.used).values)(idx_rmv_sed) gt 0,ct_filt_hdn_pstv) idx_spec_hdn_pstv = where(((*!dustem_show.used).filt_names)(idx_rmv_sed) EQ 'SPECTRUM' and ((*!dustem_show.used).values)(idx_rmv_sed) gt 0,ct_spec_hdn_pstv) idx_filt_hdn_ngtv = where(((*!dustem_show.used).filt_names)(idx_rmv_sed) NE 'SPECTRUM' and ((*!dustem_show.used).values)(idx_rmv_sed) lt 0,ct_filt_hdn_ngtv) idx_spec_hdn_ngtv = where(((*!dustem_show.used).filt_names)(idx_rmv_sed) EQ 'SPECTRUM' and ((*!dustem_show.used).values)(idx_rmv_sed) lt 0,ct_spec_hdn_ngtv) endif stop if keyword_set(positive_only) then begin ;stop if testpstv ne 0 then begin ;stop plotsym, 0 if ct_spec ne 0 then begin rms=3.*((*!dustem_data.used).sigma)(idx_spec)/2. ;dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),-((*!dustem_data.used).values)(idx_spec),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,/nodata,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;if ct_spec_hdn_pstv ne 0 then dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),((*!dustem_data.used).values)(idx_spec),ppositions=position,charsize=1.15,/overplot,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr else begin dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),((*!dustem_data.used).values)(idx_spec),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr ;endelse;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),((*!dustem_data.used).values)(idx_spec),ppositions=position,color='Dodger Blue',/positive_only,noerase=1,/overplot,rms=rms,xtit='',xtickformat='(A1)',xs=1,xr=xr,/xlog,/ylog,yr=yr,ytickformat='(A1)' ;,charsize=1.15,psym=16,syms=0.8 endif if ct_filt ne 0 then begin rms=3.*((*!dustem_data.used).sigma)(idx_filt)/2. ; dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),-1.*((*!dustem_data.used).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,/nodata,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;if ct_filt_hdn_pstv ne 0 then dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),((*!dustem_data.used).values)(idx_filt),/overplot,ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr else begin dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),((*!dustem_data.used).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr ;endelse;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),((*!dustem_data.used).values)(idx_filt),ppositions=position,color='Dodger Blue',/positive_only,noerase=1,/overplot,rms=rms,xtit='',xtickformat='(A1)',xs=1,xr=xr,/xlog,/ylog,yr=yr,ytickformat='(A1)';,charsize=1.15,psym=16,syms=0.8 endif if ct_hdnpts then begin if ct_spec_hdn_pstv ne 0 then begin ;stop xx = (((*!dustem_show.used).wav)[idx_rmv_sed])(idx_spec_hdn_pstv) yy = (((*!dustem_show.used).values)[idx_rmv_sed])(idx_spec_hdn_pstv) rms=3.*(((*!dustem_show.used).sigma)[idx_rmv_sed])(idx_spec_hdn_pstv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',/overplot,xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,noerase=1,color='Black',/overplot,rms=rms,yr=yr,xtickformat='(A1)',xr=xr,xs=1,/xlog,/ylog;,psym=8,syms=0.8 endif if ct_filt_hdn_pstv ne 0 then begin ;stop xx = (((*!dustem_show.used).wav)[idx_rmv_sed])(idx_filt_hdn_pstv) yy = (((*!dustem_show.used).values)[idx_rmv_sed])(idx_filt_hdn_pstv) rms=3.*(((*!dustem_show.used).sigma)[idx_rmv_sed])(idx_filt_hdn_pstv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,charsize=1.15,/overplot,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,color='Black',/overplot,rms=rms,xr=xr,yr=yr,xtickformat='(A1)',/xlog,/ylog;,psym=8,syms=0.8 endif endif endif else begin ;stop if ct_hdnpts then begin if ct_spec_hdn_pstv ne 0 then begin xx = (((*!dustem_show.used).wav)[idx_rmv_sed])(idx_spec_hdn_pstv) yy = (((*!dustem_show.used).values)[idx_rmv_sed])(idx_spec_hdn_pstv) rms=3.*(((*!dustem_show.used).sigma)[idx_rmv_sed])(idx_spec_hdn_pstv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,noerase=1,color='Black',/overplot,rms=rms,yr=yr,xtickformat='(A1)',xr=xr,xs=1,/xlog,/ylog;,psym=8,syms=0.8 endif if ct_filt_hdn_pstv ne 0 then begin xx = (((*!dustem_show.used).wav)[idx_rmv_sed])(idx_filt_hdn_pstv) yy = (((*!dustem_show.used).values)[idx_rmv_sed])(idx_filt_hdn_pstv) rms=3.*(((*!dustem_show.used).sigma)[idx_rmv_sed])(idx_filt_hdn_pstv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/positive_only,xs=1,noerase=1,color='Black',/overplot,rms=rms,xr=xr,yr=yr,xtickformat='(A1)',/xlog,/ylog;,psym=8,syms=0.8 endif if ct_spec_hdn_pstv eq 0 and ct_filt_hdn_pstv eq 0 then begin ; stop if ct_spec ne 0 then dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),-((*!dustem_data.used).values)(idx_spec),ppositions=position,charsize=1.15,/nodata,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' if ct_filt ne 0 then dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),-((*!dustem_data.used).values)(idx_filt),/nodata,ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/positive_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' endif endif endelse endif if keyword_set(negative_only) then begin if testngtv ne 0 then begin plotsym, 0 if ct_spec ne 0 then begin rms=3.*((*!dustem_data.used).sigma)(idx_spec)/2. ;dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),-((*!dustem_data.used).values)(idx_spec),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,/nodata,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;if ct_spec_hdn_ngtv ne 0 then dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),((*!dustem_data.used).values)(idx_spec),ppositions=position,/overplot,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr else begin dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),((*!dustem_data.used).values)(idx_spec),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;endelse;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),((*!dustem_data.used).values)(idx_spec),ppositions=position,color='Dodger Blue',/negative_only,noerase=1,/overplot,rms=rms,xtit='',charsize=1.15,xtickformat='(A1)',xs=1,psym=16,syms=0.8,xr=xr,/xlog,/ylog,yr=yr,ytickformat='(A1)' endif if ct_filt ne 0 then begin rms=3.*((*!dustem_data.used).sigma)(idx_filt)/2. ; dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),-1.*((*!dustem_data.used).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,/nodata,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;if ct_filt_hdn_ngtv ne 0 then dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),((*!dustem_data.used).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',/overplot,psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr else begin dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),((*!dustem_data.used).values)(idx_filt),ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' ;endelse ;,ytickformat='(A1)' dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),((*!dustem_data.used).values)(idx_filt),ppositions=position,color='Dodger Blue',/negative_only,noerase=1,/overplot,rms=rms,xtit='',charsize=1.15,xtickformat='(A1)',xs=1,psym=16,syms=0.8,xr=xr,/xlog,/ylog,yr=yr,ytickformat='(A1)' endif if ct_hdnpts then begin if ct_spec_hdn_ngtv ne 0 then begin xx = (((*!dustem_show.used).wav)[idx_rmv_sed])(idx_spec_hdn_ngtv) yy = (((*!dustem_show.used).values)[idx_rmv_sed])(idx_spec_hdn_ngtv) rms=3.*(((*!dustem_show.used).sigma)[idx_rmv_sed])(idx_spec_hdn_ngtv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',/overplot,xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,noerase=1,color='Black',/overplot,rms=rms,yr=yr,xtickformat='(A1)',xr=xr,xs=1,/xlog,/ylog;,psym=8,syms=0.8 endif if ct_filt_hdn_ngtv ne 0 then begin xx = (((*!dustem_show.used).wav)[idx_rmv_sed])(idx_filt_hdn_ngtv) yy = (((*!dustem_show.used).values)[idx_rmv_sed])(idx_filt_hdn_ngtv) rms=3.*(((*!dustem_show.used).sigma)[idx_rmv_sed])(idx_filt_hdn_ngtv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',/overplot,xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,color='Black',/overplot,rms=rms,xr=xr,yr=yr,xtickformat='(A1)',/xlog,/ylog;,psym=8,syms=0.8 endif endif endif else begin if ct_hdnpts then begin if ct_spec_hdn_ngtv ne 0 then begin xx = (((*!dustem_show.used).wav)[idx_rmv_sed])(idx_spec_hdn_ngtv) yy = (((*!dustem_show.used).values)[idx_rmv_sed])(idx_spec_hdn_ngtv) rms=3.*(((*!dustem_show.used).sigma)[idx_rmv_sed])(idx_spec_hdn_ngtv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,noerase=1,color='Black',/overplot,rms=rms,yr=yr,xtickformat='(A1)',xr=xr,xs=1,/xlog,/ylog;,psym=8,syms=0.8 endif if ct_filt_hdn_ngtv ne 0 then begin xx = (((*!dustem_show.used).wav)[idx_rmv_sed])(idx_filt_hdn_ngtv) yy = (((*!dustem_show.used).values)[idx_rmv_sed])(idx_filt_hdn_ngtv) rms=3.*(((*!dustem_show.used).sigma)[idx_rmv_sed])(idx_filt_hdn_ngtv)/2. dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,charsize=1.15,xtickformat='(A1)',xr=xr,color='Black',psym=16,syms=0.8,/xlog,/ylog,yr=yr dustem_plot_mlog,xx,yy,ppositions=position,/negative_only,xs=1,noerase=1,color='Black',/overplot,rms=rms,xr=xr,yr=yr,xtickformat='(A1)',/xlog,/ylog;,psym=8,syms=0.8 endif if ct_spec_hdn_ngtv eq 0 and ct_filt_hdn_ngtv eq 0 then begin if ct_spec ne 0 then dustem_plot_mlog,((*!dustem_data.used).wav)(idx_spec),-((*!dustem_data.used).values)(idx_spec),ppositions=position,charsize=1.15,/nodata,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' if ct_filt ne 0 then dustem_plot_mlog,((*!dustem_data.used).wav)(idx_filt),-((*!dustem_data.used).values)(idx_filt),/nodata,ppositions=position,charsize=1.15,color='Dodger Blue',psym=16,syms=0.8,xs=1,xr=xr,noerase=1,/negative_only,xtickformat='(A1)',xtit='',/xlog,/ylog,yr=yr;,ytickformat='(A1)' endif endif ;stop endelse endif endelse endelse endelse ; end 'QEXT': begin end 'UEXT': begin end endcase endif END