;+ ; ; NAME : ; SUMER_HARCOPY_SPECTRUM ; PURPOSE : ; Make a hardcopy of SUMER spectrograms ; CALIING SEQUENCE : ; SUMER_HARDCOPY_SPECTRUM ; INPUTS : ; None ; OUPUTS : ; None ; COMMON BLOCKS ; SUMER_TOOL_BLOCK ; XLOADCT_COM MONOCOLORS_BLOCK ; IDL_vector_font_comm ; KEYWORDS : ; PS_SETUP ; ; ; MODIFICATION HISTORY ; March 1997 Jongchul Chae ; November 1998 J. Chae ; ;- ; pro sumer_hardcopy_spectrum common sumer_tool_block, xras, dstr @monocolors_block ;@xloadct_com par=xras.par x=par.x_curr(0) y=par.y_curr(0) y1=par.roi_space(1) y2=par.roi_space(3) x1=par.roi_space(0) x2=par.roi_space(2) xbin=par.xbin ybin=par.ybin wdim = par.wdim ydim = y2-y1+1 xdim=xras.par.xdim status=replicate(1, dstr.ndata) xselect, dstr.data_names, status, abort, /nonexclusive lines=where(status eq 1) tmp ={start_x:x, end_x:x, step_size:1} xstruct, tmp, /edit, title='Specify the range of slit positions.', nx=1, /modal xmin= tmp.start_x xmax=tmp.end_x xstep = tmp.step_size xps_setup, ps_setup, /initial ps_setup.printer='lpr -h ' ps_setup.filename='idl.ps' ps_setup.hard=0 ps_setup.portrait=1 xps_setup, ps_setup, status=accept if not accept then return nline = n_elements(lines) nx = (xmax-xmin)/xstep+1 r = par.mag_y/float(par.mag_w) if r ge 1 then begin wsize_image = fix(wdim) ysize_image = fix(ydim*r) endif else begin wsize_image = fix(wdim/r) ysize_image = ydim endelse wsize_cm = wsize_image*1.03*nx ysize_cm = ysize_image*1.03*nline if ps_setup.portrait then r = (18./wsize_cm) < (24./ysize_cm) else $ r = (24./wsize_cm) < (18./ysize_cm) wsize_cm = wsize_cm*r ysize_cm = ysize_cm*r set_plot, 'ps' & sumer_get_color device, encapsulated = ps_setup.encapsulated, $ portrait = ps_setup.portrait, $ color=ps_setup.color, $ filename=concat_dir(!sumer_config.work_dir, ps_setup.filename) device, bits_per_pixel=8, xsize= wsize_cm+1, $ ysize= ysize_cm+1 if ps_setup.portrait then $ device, xoff=(21.5-wsize_cm-1)/2., yoff=(28.-ysize_cm-1)/2. $ else device, xoff=(21.5-ysize_cm-1)/2., yoff=28.-(28.-wsize_cm-1)/2. device, /bold, /times, /isolatin1 for l=0, nline-1 do $ xyouts, 0.5*1000, (1+ysize_cm/nline*(l+.5))*1000, /dev, align=0.5, $ font=0, dstr.data_names(lines(l)), orientation=90 for xx=xmin, xmax, xstep do begin xyouts, (1+wsize_cm/nx*((xx-xmin)/xstep+0.5))*1000, 0.5*1000, /dev, $ font=0, strtrim(string(xx, format='(i3)'),2), align=0.5 endfor for l=0, nline-1 do begin line = lines(l) max = max(dstr.data(*, y1:y2, xmin:xmax, line), min=min)*0.8 for xx=xmin, xmax, xstep do begin x1=(xx-xbin/2)>0 x2=(x1+xbin-1)<(xdim-1) x1=(x2-xbin+1)>0 image = total(reform(dstr.data(*,y1:y2, x1:x2,line)*1., $ wdim, y2-y1+1, x2-x1+1), 3)/float(x2-x1+1)/dstr.amp if ybin gt 1 then $ image = convol(image, transpose(replicate(1., ybin)), /edge_trun)/ybin wsize=wsize_cm/nx*1000 ysize=ysize_cm/nline*1000 xoff = 1.*1000+wsize*(xx-xmin)/xstep yoff = 1.*1000+ysize*l image=rotate(image, 7) tv, byte(sqrt((image-min)/(max-min)>0.<1.)*(ncolor1-1)), $ xoff, yoff, xs=wsize/1.03, ysize=ysize/1.03, dev=1 endfor endfor device, /close set_plot, 'x' & sumer_get_color if ps_setup.hard then spawn, ps_setup.printer+ ' '+ $ concat_dir(!sumer_config.work_dir, ps_setup.filename) end