;+ ; ; NAME : ; SUMER_DISPLAY_W ; PURPOSE : ; Display W profile (only for SUMER_TOOL) ; CALIING SEQUENCE : ; SUMER_DISPLAY_W [,ps=ps] ; INPUTS : ; None ; OUPUTS : ; None ; COMMON BLOCKS ; XRASTER_WIDGET_BLOCK XRASTER_DRAW_BLOCK ; RDSUMEREXT_BLOCK DROP_INDEX_BLOCK DRAW_BLOCK ; XLOADCT_COM MONOCOLORS_BLOCK ; IDL_vector_font_comm ; KEYWORDS : ; PS If set to have non-zero value, the w profile is ; displayed on POSTCRIPT device. ; SIDE EFFECTS: ; A w profile is displayed either on X-window or POSTSCRIPT ; REQUIRED ROUTINES: ; HARDCOPY_MESSAGE ; ; MODIFICATION HISTORY ; March 1997 Jongchul Chae ; ;- pro sumer_display_w, ps=ps, ncomp=ncomp common sumer_tool_block, xras, dstr @monocolors_block common IDL_vector_font_comm, draw_id, fontlist,idl_font char0=!p.charsize par=xras.par xbin = par.xbin ybin = par.ybin linest2=0 ;if n_elements(idl_font) eq 0 then font='!6' else font=idl_font ;@xloadct_com s1= par.roi_line(0,par.icol(3)) s2= par.roi_line(1,par.icol(3)) if n_elements(vtop) eq 0 then vtop=100. white_in_normal = fix((ncolor1-1)/100.*vtop) x=par.x_curr(3) y=par.y_curr(3) xsize_image_dev=par.mag_x*par.xdim ytitle='INTENSITY (COUNT/PIXEL)' xtitle =par.wtitle title='X='+strtrim(string(par.xval(x, par.icol(3)), $ format='(g12.3)'), 2)+$ '; Y='+ strtrim(string(par.yval(y, par.icol(3)),format='(g12.3)'), 2) x1=(x-xbin/2)>0 x2=x1+xbin-1 x2=x2<(par.xdim-1) x1=(x2-xbin+1)>0 y1=y-2*ybin y2=y1+4*ybin y2=y2<(par.ydim-1) y1=(y2-4*ybin)>0 y2=y1+4*ybin sigma = ybin ker = exp(-0.5*((findgen(ybin*2)-ybin)/sigma)^2) ker = transpose(shift(ker, -ybin)/total(ker)) wlprofile=total(reform(dstr.data(*,y1:y2,x1:x2,par.icol(3)), par.wdim, y2-y1+1, $ x2-x1+1), 3) /(x2-x1+1) if ybin gt 1 then wlprofile=convol(wlprofile, ker, /edge_trun) wlprofile=wlprofile(*, y-y1)/dstr.amp if n_elements(ncomp) eq 0 then ncomp=0 if ncomp ge 1 then begin noise=[1., 1.,0.01] xgaussfit, par.wval(s1:s2,par.icol(3)), wlprofile(s1:s2), par_tmp, $ noise=noise, ncomp=ncomp return end ;stop if xras.wplot.ylog then wlprofile=wlprofile > 0.1 pos0=[par.xoff_dev, par.yoff_dev, $ par.xoff_dev+150*2.0, par.yoff_dev+150] ;xyouts, -10, -10, '!6', /dev if keyword_set(ps) then begin xps_setup, ps_setup, /initial ps_setup.printer='lpr -h ' cd, current=current ps_setup.filename=current+'/idl.ps' ps_setup.hard=0 ps_setup.portrait=1 xps_setup, ps_setup, status=accept if not accept then return set_plot, 'ps' device, filename=ps_setup.filename, portrait=ps_setup.portrait, $ encapsulated = ps_setup.encapsulated case ps_setup.portrait of 1: begin xoff=0.5 yoff=0.5 xsize=18 end 0 : begin xoff=0.5 yoff=25 xsize=23 end endcase ysize=xsize*float(pos0(3)-pos0(1))/(pos0(2)-pos0(0)) device, xoff=xoff, yoff=yoff, xs=xsize, ys=ysize scale_factor = xsize*1000./(pos0(2)+pos0(0)) pos=pos0*scale_factor plot_color=0 color2=0 endif else begin widget_control, xras.widget.draw_w, get_value=draw_w_id wset, DRAW_W_id erase plot_color=!d.table_size-1 color2=green pos=pos0 endelse ;stop char_dev_unit=vdf_height(!d.name) char0 = !p.charsize ; char0 = xras.wplot.charsize !p.charsize = char0*((pos(2)+Pos(0)) >(pos(3)+pos(1)))/char_dev_unit/50. plot, par.wval(s1:s2,par.icol(3)), wlprofile(s1:s2) , $ xst=1, /dev, ylog=xras.wplot.ylog, $ $ pos=pos, thick=2, psym=10, $ ytitle=ytitle, xtitle=par.wtitle, $ color=plot_color, title=title if xras.wplot.show_fit then begin wlprofile1 = gauss_profile(findgen(s2-s1+1), $ reform(par.data_fit(*,y, x,par.icol(3))) ) if xras.wplot.ylog then wlprofile1=wlprofile1 > 0.1 oplot, par.wval(s1:s2, par.icol(3)), wlprofile1, color=color2, $ linest=linest2, thick=1. wres=interpolate(reform(par.wval(s1:s2, par.icol(3))), $ par.rest_pixel(par.icol(3))) oplot, wres*[1,1], [0, max(wlprofile1)*1.2], color=color2, linest=2 endif if keyword_set(ps) then begin set_plot, 'ps device, /close set_plot, 'x' if ps_setup.hard then spawn, 'lpr '+ ps_setup.filename endif !p.charsize=char0 end