Commit d8df04280357260528d22d0befcec24bd828060c

Authored by Ilyes Choubani
1 parent 2926480f
Exists in master

unfortunate merge because I want to keep these files

Showing 2 changed files with 19 additions and 52 deletions   Show diff stats
src/idl/dustem_init.pro
... ... @@ -211,7 +211,10 @@ defsysv, '!dustemcgwin_id', { $ ;IDs of windows to plot
211 211 ext: la_undef(), $
212 212 prms: la_undef(), $
213 213 plgns: la_undef() $
214   - }
  214 + }
  215 +
  216 +
  217 +defsysv, '!dustem_dim', 0
215 218  
216 219 defsysv, '!dustemcgwin_ncmds', { $ ;Data to fit
217 220 sed: {pl:0, nrm:0}, $ ;
... ...
src/idl/dustemwrap_plot.pro
... ... @@ -91,10 +91,11 @@ END
91 91 IF not keyword_set(st) THEN BEGIN
92 92 ;Activation of the plugins is needed because of the plotting of the total emission model that includes them.
93 93 dustem_activate_plugins,p_dim/(*(*!dustem_fit).param_init_values),st=st ; 0/0 division case?
  94 +ENDIF
94 95  
95   - ;# Emission
96   - ;if isa(!dustem_data.sed) then begin ;using !dustem_data instead of !dustem_show because in this release the user is compelled to fit IQU whether in M or X
97   - if not keyword_set(dustem_sed) and isa((*!dustem_data).sed) then begin ;better test?
  96 +;# Emission
  97 +
  98 +if not keyword_set(dustem_sed) and isa((*!dustem_data).sed) then begin ;better test?
98 99  
99 100 dustem_sed = dustem_compute_sed(p_dim,st=st,SED_spec=SED_spec)
100 101  
... ... @@ -107,11 +108,11 @@ IF not keyword_set(st) THEN BEGIN
107 108 ;stop
108 109  
109 110 endif
110   - endif
  111 +endif
111 112  
112 113 ;# Extinction
113   -; if isa(!dustem_data.ext) then begin
114   - if not keyword_set(dustem_ext) and isa((*!dustem_data).ext) then begin
  114 +
  115 +if not keyword_set(dustem_ext) and isa((*!dustem_data).ext) then begin
115 116 dustem_ext = dustem_compute_ext(p_dim,st=st,EXT_spec=EXT_spec)
116 117  
117 118 if !run_pol && !run_lin then begin
... ... @@ -122,44 +123,7 @@ IF not keyword_set(st) THEN BEGIN
122 123 dustem_qext = toto[0]
123 124 dustem_uext = toto[1]
124 125 endif
125   - endif
126   -
127   -ENDIF ELSE BEGIN ;st is provided
128   - ;stop
129   -
130   - ;# Emission
131   - ;if isa(!dustem_data.sed) then begin
132   - if not keyword_set(dustem_sed) and isa((*!dustem_data).sed) then begin
133   - dustem_sed = dustem_compute_sed(p_dim,st=st,SED_spec=SED_spec)
134   -
135   - if !run_pol && !run_lin then begin
136   -
137   - dustem_polsed = dustem_compute_polsed(p_dim,st=st,P_spec=P_spec,SP_spec=SP_spec,dustem_polfrac=dustem_polfrac)
138   - toto = dustem_compute_stokes(p_dim,st=st,Q_spec=Q_spec,U_spec=U_spec,PSI_spec=PSI_spec,dustem_psi_em=dustem_psi_em)
139   - dustem_qsed = toto[0]
140   - dustem_used = toto[1]
141   - ;stop
142   - endif
143   - endif
144   -
145   - ;# Extinction
146   - ;if isa(!dustem_data.ext) then begin
147   -
148   - if not keyword_set(dustem_ext) and isa((*!dustem_data).ext) then begin
149   -
150   - dustem_ext = dustem_compute_ext(p_dim,st=st,EXT_spec=EXT_spec)
151   -
152   - if !run_pol && !run_lin then begin
153   -
154   - dustem_polext = dustem_compute_polext(p_dim,st=st,POLEXT_spec=POLEXT_spec,SPEXT_spec=SPEXT_spec,dustem_fpolext=dustem_fpolext)
155   - toto = dustem_compute_stokext(p_dim,st=st,QEXT_spec=QEXT_spec,UEXT_spec=UEXT_spec,PSIEXT_spec=PSIEXT_spec,dustem_psi_ext=dustem_psi_ext)
156   - dustem_qsed = toto[0]
157   - dustem_used = toto[1]
158   -
159   - endif
160   - endif
161   -
162   -ENDELSE
  126 +endif
163 127  
164 128  
165 129 ;IC: Will come back for this to include all datasets and their associated data.
... ... @@ -479,7 +443,7 @@ if test_m then begin
479 443  
480 444 ;update of the title here ?
481 445  
482   - if !dustem_end EQ 1 then begin
  446 + if !dustem_end EQ 1 then begin ;IF & ONLY IF we're at the last iteration
483 447 ;replacing my count - 3
484 448 tit=!dustem_plot_range.title_m
485 449 cmdin_m = !dustemcgwin_ncmds.pltit.pl
... ... @@ -492,7 +456,7 @@ if test_m then begin
492 456 endif
493 457  
494 458  
495   - if !dustem_end EQ -1 then begin ;IF & ONLY IF we're at the last iteration
  459 + if !dustem_end EQ -1 then begin ;Subsequent iterations the end of the fit
496 460  
497 461 tit=!dustem_plot_range.title_m
498 462 cmdind_m = !dustemcgwin_ncmds.pltit.pl
... ... @@ -742,8 +706,8 @@ ENDIF
742 706 if test_x then begin
743 707 ;Generating extinction window and saving window ID
744 708  
745   - if iswinext then begin
746   -
  709 + if iswinext then begin
  710 + ; fixed data
747 711 if !run_pol then cgwindow,wxsize=main_wxsize,wysize=main_wysize,wtitle='DUSTEMWRAP '+!dustem_version.version+' (EXTINCTION)' else cgwindow,wxsize=main_wxsize,wysize=main_wysize,wtitle='DUSTEMWRAP '+!dustem_version.version+' (EXTINCTION)';, wback='grey';,wobject=winobj_m
748 712 winid_x = cgquery(dimensions=dim_x,/current) ;this has to be changed because the dimensions of this array change with the data sets present (extinction/emission).
749 713 !dustemcgwin_id.ext = winid_x
... ... @@ -864,7 +828,7 @@ if test_x then begin
864 828  
865 829 !dustemcgwin_ncmds.pltit.pl = cmdind_x
866 830  
867   - endif else begin
  831 + endif else begin ; refreshed runs
868 832  
869 833  
870 834 winid_x = !dustemcgwin_id.ext
... ... @@ -979,7 +943,7 @@ if test_x then begin
979 943  
980 944 endif else begin ;EXT exists
981 945  
982   - if ~iswinext then begin
  946 + if ~iswinext then begin ; refreshed runs
983 947  
984 948 cmdind_x = !dustemcgwin_ncmds.ext.pl
985 949 cgwindow,'dustem_plot_dataset', st, dustem_ext,EXT_spec,dataset='EXT', /refresh ,position=p_ext, winid=winid_x,cmdindex=cmdind_x,/replacecmd,_extra=_extra
... ... @@ -988,7 +952,7 @@ if test_x then begin
988 952 cgwindow,'dustem_plot_dataset', st, dustem_ext,EXT_spec,dataset='EXT', /norm, /refresh,position=np_ext, winid=winid_x,cmdindex=cmdind_x,/replacecmd,_extra=_extra
989 953  
990 954  
991   - endif else begin
  955 + endif else begin ;fixed runs
992 956  
993 957 cgwindow,'dustem_plot_dataset', st, dataset='EXT', position=p_ext, /addcmd, winid=winid_x, _extra=_extra & cmdind_x+=1
994 958 cgwindow,'dustem_plot_dataset', st, dustem_ext,EXT_spec, dataset='EXT', /refresh ,position=p_ext, /addcmd, winid=winid_x, _extra=_extra & cmdind_x+=1
... ...