dustem_sed_plot.pro 2.36 KB
PRO dustem_sed_plot,p_min,_extra=_extra,function_name=function_name,pol=pol,legend_xpos=legend_xpos,legend_ypos=legend_ypos,ps=ps,png=png,fpol=fpol
;THIS procedure is incomplete. It needs to be updated. 

IF not keyword_set(function_name) THEN BEGIN
  ;Run dustem with as an interface to mpfitfun; what does this mean? This whole procedure will have to be changed
;stop
  ;== JPB: st used to come out from here
  ;even when not set. Had to replavce by out_st ...
 
;   act_wins=0   
;   FOR i=0L,n_tags(!dustem_data)-1 DO BEGIN
;       IF isa(!dustem_data.(i)) THEN act_wins+=1   
;   ENDFOR   
 
  dustem_sed=dustem_compute_sed(p_min,st=st,out_st=out_st) 
  st=out_st
  ;dustem_plot_fit_sed,st,dustem_sed,cont,freefree,synchrotron,_extra=_extra,legend_xpos=legend_xpos,legend_ypos=legend_ypos
  win=1;win-act_wins+1
  IF keyword_set(ps) THEN BEGIN
    dustem_plot_fit_sed,st,dustem_sed,win=win,_extra=_extra,legend_xpos=legend_xpos,legend_ypos=legend_ypos,ps=ps,png=png,use_model=use_model,fpol=fpol
  ENDIF ELSE BEGIN
    dustem_plot_fit_sed,st,dustem_sed,_extra=_extra,win=win,legend_xpos=legend_xpos,legend_ypos=legend_ypos,use_model=use_model,fpol=fpol
  ENDELSE
  
  ;I do not understand the reason begind the stop below - either way polarization is handled by other procedures
  IF keyword_set(pol) THEN BEGIN
    ;stop
    IF tag_exist(!dustem_data,'polsed') THEN BEGIN
        IF isa(!dustem_data.polsed) THEN BEGIN
            win+=1
            dustem_polsed=dustem_compute_polsed(p_min,st=st)
            dustem_plot_polsed, st, p_dim, dustem_polsed, aligned=aligned, win=win,_Extra=extra
        ENDIF
    ENDIF
    IF tag_exist(!dustem_data,'polext') THEN BEGIN
        IF isa(!dustem_data.polext) THEN BEGIN
            win+=1
            dustem_polext=dustem_compute_polext(p_min,st=st)
            dustem_plot_polext, st, p_dim, dustem_polext, aligned=aligned, win=win,_Extra=extra
        ENDIF
    ENDIF
    
     ;dustem_plot_polar,st,ps=ps,_Extra=extra,help=help,UV=UV,SED=SED,Pfrac=Pfrac,print_ratio=print_ratio,win=win,cont=cont,donotclose=donotclose,aligned=aligned,noerrbars=noerrbars,multi=multi,almabands=almabands,nsmooth=nsmooth
  ENDIF
ENDIF ELSE BEGIN
  CASE function_name OF
    'dustem_greybody_mpfit':BEGIN
       dustem_sed=dustem_compute_gb_sed_fast(p_min,waves=ww,spec=spec)
;       stop
       dustem_gb_plot_fit_sed,ww,spec,dustem_sed,_extra=extra
    END
  ENDCASE
ENDELSE

END