diff --git a/src/idl/dustem_compute_stokes.pro b/src/idl/dustem_compute_stokes.pro index 83871b9..d682ff7 100755 --- a/src/idl/dustem_compute_stokes.pro +++ b/src/idl/dustem_compute_stokes.pro @@ -97,7 +97,14 @@ IF scopes[0] NE 'NONE' THEN BEGIN ENDIF ;----------------------------------------- +ind=where(finite(U_spec) NE 1 OR finite(Q_spec) NE 1,count) +IF count NE 0 THEN BEGIN + message,'Q or U is NaN',/continue + stop +ENDIF PSI_spec = 0.5*atan(U_spec,Q_spec)/degtorad +polar_iqu2ippsi,stI,Q_spec,U_spec,p_bidon,PSI_spec +;stop ;INITIALIZING THE STOKES SEDS dustem_qsed = (*!dustem_data.qsed).values * 0. @@ -154,6 +161,7 @@ out_st=st ;generating interpolates for Psi_em dustem_psi_em = 0.5*atan(dustem_used,dustem_qsed)/degtorad +;stop ;clean pointers heap_gc diff --git a/src/idl/dustem_mpfit_run.pro b/src/idl/dustem_mpfit_run.pro index 8d41535..dd6dfc9 100755 --- a/src/idl/dustem_mpfit_run.pro +++ b/src/idl/dustem_mpfit_run.pro @@ -162,6 +162,7 @@ FOR i_tag=0,count_data_tag-1 DO BEGIN 'QSED': BEGIN toto = dustem_compute_stokes(p_dim,st,dustem_qsed,dustem_used,Q_spec,U_spec,PSI_spec,dustem_psi_em) + ;stop ;taking care of the color correction for spass ; SHOULD NOT LEAVE THIS ON ;dustem_qsed(-1)=dustem_qsed(-2) diff --git a/src/idl/dustemcgwin_dataset.pro b/src/idl/dustemcgwin_dataset.pro index 34f2c3c..69c5ed1 100644 --- a/src/idl/dustemcgwin_dataset.pro +++ b/src/idl/dustemcgwin_dataset.pro @@ -1133,6 +1133,8 @@ if keyword_set(dataset) then begin '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 + ;stop + 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) @@ -1164,7 +1166,7 @@ if keyword_set(dataset) then begin 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] endif ENDFOR - + ;stop ;Plotting of the plugins. for i=0L,n_plgns-1 do begin @@ -1175,7 +1177,7 @@ if keyword_set(dataset) then begin ENDIF ENDIF endfor - + ;stop ;PLotting of the interpolates corresponding to spectrum and filter points IF ct_spec NE 0 THEN BEGIN @@ -1184,19 +1186,20 @@ if keyword_set(dataset) then begin yy=dustem_interp[idx_spec] cgoplot,xx,yy,color='Indian Red',pos=position,psym=7,syms=2,noerase=1 ENDIF - + ;stop IF ct_filt NE 0 THEN BEGIN xx=((*!dustem_data.psi_em).wav)[idx_filt] yy=dustem_interp[idx_filt] cgoplot,xx,yy,color='red',pos=position,psym=6,syms=2,noerase=1 ENDIF - + ;stop ;Plotting of the total dust emission spectrum ;cgoplot,st.sed.wav,0.5*atan(specu,specq)/degtorad,pos=position,noerase=1,/xlog,/ys,/xs cgoplot,st.sed.wav,dustem_spec,pos=position,noerase=1,/xlog,/ys,/xs - + ;stop + endif else begin ;The data points in the plot that remain unchanged. diff --git a/src/idl/dustemwrap_plot.pro b/src/idl/dustemwrap_plot.pro index 479820e..6bb6e7b 100755 --- a/src/idl/dustemwrap_plot.pro +++ b/src/idl/dustemwrap_plot.pro @@ -1,5 +1,6 @@ PRO dustemwrap_plot,p_dim,st,dustem_sed,SED_spec,dustem_qsed,Q_spec,dustem_used,U_spec,dustem_polsed,P_spec,dustem_polfrac,SP_spec,dustem_psi_em,PSI_spec,dustem_ext,EXT_spec,dustem_qext,QEXT_spec,dustem_uext,UEXT_spec,dustem_polext,POLEXT_spec,dustem_fpolext,SPEXT_spec,dustem_psi_ext,PSIEXT_spec,_extra=_extra +;stop ;This is also necessary for the plotting of the results of the fit (Last iteration) IF not keyword_set(st) THEN BEGIN @@ -17,7 +18,7 @@ IF not keyword_set(st) THEN BEGIN dustem_polsed = dustem_compute_polsed(p_dim,st,P_spec,SP_spec,dustem_polfrac) toto = dustem_compute_stokes(p_dim,st,dustem_qsed,dustem_used,Q_spec,U_spec,PSI_spec,dustem_psi_em) - + ;stop endif endif @@ -36,7 +37,8 @@ IF not keyword_set(st) THEN BEGIN endif ENDIF ELSE BEGIN ;st is provided - + ;stop + ;# Emission ;if isa(!dustem_data.sed) then begin if not keyword_set(dustem_sed) and isa(!dustem_data.sed) then begin @@ -46,7 +48,7 @@ ENDIF ELSE BEGIN ;st is provided dustem_polsed = dustem_compute_polsed(p_dim,st,P_spec,SP_spec,dustem_polfrac) toto = dustem_compute_stokes(p_dim,st,dustem_qsed,dustem_used,Q_spec,U_spec,PSI_spec,dustem_psi_em) - + ;stop endif endif @@ -66,7 +68,7 @@ ENDIF ELSE BEGIN ;st is provided endif ENDELSE - +;stop ;if ~windowavailable(cgquery()) then begin @@ -163,11 +165,11 @@ endif else begin res = (*(*!dustem_fit).param_init_values)*0.;+la_undef() endelse - +;stop if test_m then begin ;Generating emission window and saving window ID - if iswinsed then begin + if iswinsed then begin ;This is when the cgwindow does not exist already 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 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). @@ -188,7 +190,8 @@ if test_m then begin ;Plotting of the number of runs ;Getting the width of the unrefreshed string widthtot=0. - cgtext, xxpos, yypos,'Runs : ',color=0,/normal,charsize=-1,width=thiswidth,/addcmd & cmdind_m+=1 + ;cgtext, xxpos, yypos,'Runs : ',color=0,/normal,charsize=-1,width=thiswidth,/addcmd & cmdind_m+=1 + cgtext, xxpos, yypos,'Iteration : ',color=0,/normal,charsize=-1,width=thiswidth,/addcmd & cmdind_m+=1 widthtext = thiswidth widthtot+= thiswidth ;fixed width !dustemcgwin_ncmds.runs.txtwdth = thiswidth @@ -202,7 +205,8 @@ if test_m then begin yypos = 0.015 ;Displaying fixed part - cgtext, xxpos, yypos,'Runs : ',color=0,/normal,charsize = 1.35,/addcmd & cmdind_m+=1 + ;cgtext, xxpos, yypos,'Runs : ',color=0,/normal,charsize = 1.35,/addcmd & cmdind_m+=1 + cgtext, xxpos, yypos,'Iteration : ',color=0,/normal,charsize = 1.35,/addcmd & cmdind_m+=1 ;Displaying refreshed part (first run . This is the command that will be replaced) cgtext, xxpos + widthtext + 0.015 , yypos,strtrim(!dustem_iter.act,2),color=0,/normal,charsize = 1.0,/addcmd & cmdind_m+=1 ;saving the command id to replace it @@ -285,7 +289,7 @@ if test_m then begin !dustemcgwin_ncmds.pltit.pl = cmdind_m - endif else begin + endif else begin ;This is when the cgwindow exists already winid_m = !dustemcgwin_id.sed @@ -490,7 +494,7 @@ if test_m then begin cgwindow,'dustemcgwin_dataset', st, dataset='psi_em', /nodata, position=p_psised, /addcmd, winid=winid_m, _extra=_extra & cmdind_m+=1 endif else begin ;psi_em exists - + ;stop if ~iswinsed then begin cmdind_m = !dustemcgwin_ncmds.psi_em.pl cgwindow,'dustemcgwin_dataset', st, dustem_psi_em,PSI_spec,SED_spec, dataset='psi_em', /refresh ,position=p_psised, winid=winid_m,/replacecmd,cmdindex=cmdind_m, _extra=_extra @@ -607,7 +611,8 @@ if test_x then begin ;Plotting of the number of runs ;Getting the width of the unrefreshed string widthtot=0. - cgtext, xxpos, yypos,'Runs : ',color=0,/normal,charsize=-1,width=thiswidth,/addcmd & cmdind_x+=1 + ;cgtext, xxpos, yypos,'Runs : ',color=0,/normal,charsize=-1,width=thiswidth,/addcmd & cmdind_x+=1 + cgtext, xxpos, yypos,'Iteration : ',color=0,/normal,charsize=-1,width=thiswidth,/addcmd & cmdind_x+=1 widthtext = thiswidth widthtot+= thiswidth ;fixed width !dustemcgwin_ncmds.runs.txtwdth = thiswidth @@ -621,7 +626,8 @@ if test_x then begin yypos = 0.015 ;Displaying fixed part - cgtext, xxpos, yypos,'Runs : ',color=0,/normal,charsize = 1.35,/addcmd & cmdind_x+=1 + ;cgtext, xxpos, yypos,'Runs : ',color=0,/normal,charsize = 1.35,/addcmd & cmdind_x+=1 + cgtext, xxpos, yypos,'Iteration : ',color=0,/normal,charsize = 1.35,/addcmd & cmdind_x+=1 ;Displaying refreshed part (first run . This is the command that will be replaced) cgtext, xxpos + widthtext + 0.015 , yypos,strtrim(!dustem_iter.act,2),color=0,/normal,charsize = 1.0,/addcmd & cmdind_x+=1 ;saving the command id to replace it -- libgit2 0.21.2