;+ ;NAME: ; ZPRINTSUN ;PURPOSE: ; Generate a PostScript version of an internal MSSTA image of the ; Sun (or a portion thereof), and (unless told not to) ; print it on Banneker's wlj-ps printer ;CALLING SEQUENCE: ; ZPRINTSUN,image,hdr,[plume], [keywords] ;INPUTS: ; image: the image to print ; hdr: its header ;OPTIONAL INPUTS: ; plume: a plume-description array to draw on top of the solar image. ;KEYWORD PARAMETERS: ; nogrid: (binary value) If set, supporesses drawing of a coordinate ; grid. ; nr, na, nla, nlr, label, rmin, rmax, black: These keywords are passed ; to ZGRID to aid in drawing a coordinate grid over the ; image. ; pswidth, psheight: The width and height of the final PostScript ; image to send out on the postscript device. ; square: (binary value) If set, causes a square 8x8 grid to be ; drawn on top of the solar image. Useful for determining ; a ROI to clip for better cleaning. ; xoffset, yoffset: Offsets, in inches, of the region in which to ; draw on the PostScript "page". ; noprint: (binary) Suppresses closing and printing the output ; postscript. ; title: A title string to be printed underneath the image ;OUTPUTS: ; None (except on the PostScript output device) ;RESTRICTIONS: ; Void where prohibited or taxed. ;MODIFICATION HISTORY: ; Created by Craig DeForest, 1/1995 ; Switched around 1-5/1995 ; Added PostScript offsets, 5/24//1995 ;- pro zprintsun,image,hdr,plume,nr=nr,na=na,nla=nla,nlr=nlr,label=kl,rmin=rmin,$ rmax=rmax,black=black,pswidth=pswidth,psheight=psheight,square=square,$ nogrid=nogrid,xoffset=xoffset,yoffset=yoffset, noprint=noprint, $ title=title set_plot,'ps' device,bits_per_pixel=8 device,/inches pageh = 9.5 pagew = 7 if not isvalid(xoffset) then xoffset = 0 if not isvalid(yoffset) then yoffset = 0 w = sxpar(hdr,'NAXIS1') h = sxpar(hdr,'NAXIS2') imageratio = float(h) / float(w) ; Auto-choose scale if necessary if((not keyword_set(pswidth)) or (not keyword_set(psheight))) then begin if (not keyword_set(pswidth) and not keyword_set(psheight)) then begin if(w gt h) then begin print,'bar' device,/landscape psh = pagew psw = pageh device,/inches,xoffset= - 10.5,yoffset = 0.75 endif else begin print,'fmh' device,/portrait device,/inches,xoffset=0.75,yoffset=0.75 psh = pageh psw = pagew endelse endif else begin print,'foo' device,/portrait device,/inches,xoffset=0.75,yoffset=0.75 if (not keyword_set(pswidth)) then begin psh = psheight psw = 1000 * psheight endif else begin psh = 1000 * pswidth psw = pswidth endelse endelse psratio = float(psh) / float(psw) print,psratio,'=psratio, ',imageratio,'=imageratio' if(psratio gt imageratio) then begin pswidth = psw psheight = psw * imageratio endif else begin psheight = psh pswidth = psh / imageratio endelse endif ; ; Set up for direct plotting ; pfact = 2.54 * 1000 px0 = xoffset*pfact py0 = yoffset*pfact device,scale_factor=1.0 ; ; Call TVSCL to send the image to the postscript device ; print,'ZPRINTSUN: Calling TVSCL with',pswidth,'=pswidth,',psheight,'=psheight' tvscl,image, px0, py0, /device,$ xsize=pswidth*pfact, ysize=psheight*pfact device,scale_factor=1.0 ; ; If there's a title, print it under the image ; if isvalid(title) then begin print,title xyouts, $ px0 + pfact*(float(pswidth)/2) ,py0 - 0.2*pfact, $ /device,noclip=1,color=0,alignment=0.5, $ title endif if (keyword_set(square)) then begin for i=0,8 do begin plots,color=0,/device,linestyle=0, $ [px0, px0+pswidth*pfact ], $ [py0+pfact*psheight * float(i)/8, py0+pfact*psheight * float(i)/8] plots,color=0,/device,linestyle=0, $ [x0+xpfact*pswidth * float(i)/8, x0+pfact*pswidth*float(i)/8 ], $ [y0, y0+pfact*psheight ] end end print,'ZPRINTSUN: Calling ZGRID' if(not keyword_set(nr)) then nr=20 if(not keyword_set(na)) then na = 360 print,psheight,'=psheight',pswidth,'=pswidth' if(not keyword_set(nogrid)) then begin if((not keyword_set(nla)) and (not keyword_set(nlr)) $ and (not keyword_set(kl))) then $ zgrid,hdr,nr=nr,na=na,rmin=rmin,rmax=rmax,black=black,$ pretty=pretty,$ pswidth=pswidth,psheight=psheight, $ xoffset = xoffset, yoffset = yoffset $ else begin if(not keyword_set(nla)) then nla = 5 if(not keyword_set(nlr)) then nlr = 5 zgrid,hdr,nr=nr,na=na,nla=nla,nlr=nlr,label=kl,$ rmin=rmin,rmax=rmax,$ black=black,pretty=pretty,$ pswidth=pswidth,psheight=psheight,$ xoffset=xoffset, yoffset=yoffset endelse endif if isvalid(plume) then zdrawplume,plume,hdr,pswidth=pswidth,psheight=psheight,$ xoffset=xoffset,yoffset=yoffset if (not (keyword_set(noprint))) then begin device,/close print,'ZPRINTSUN: Sending to wlj-ps...' spawn,'mv idl.ps $$.ps ; (rsh banneker "lpr -s -Pwlj-ps /daedalus/`pwd`/$$.ps" )&' endif end