pro cat_phaser,fname
;
;+
; NAME:
;	CAT_PHASER
;
; PURPOSE:
;	This procedure displays 64x64 fits images on phaser for cataloging
;
; CATEGORY:
;	UTIL
;
; CALLING SEQUENCE:
;	CAT_PHASER, Fname
;
; INPUTS:
;	Fname:	root name of the fits images to search for
;		eg:  fname = 'c1' will search for all files whose
;			file names begin with c1: c1*.fts
;
; OUTPUTS:
;	An IDL plot file is generated.
;
; PROCEDURE:
;	A 512 x 512 plotting area is established, and a series of 64 x 64 
;	images are displayed.
;
; EXAMPLE:
;	To display the series of 
;
; MODIFICATION HISTORY:
; 	Written by:	RA Howard, NRL, 12 Jan 1996
;
;	@(#)cat_phaser.pro	1.1 10/05/96 LASCO IDL LIBRARY
;-

f=filefind (fname+'*.fts')
s = size(f)
if s(0) eq 0 then begin print,'No files found' & return & endif
lastdevice=!d.name
nf=s(1)
ni=0	; used for position of image in display
window,0,xsize=512+128,ysize=512,title=fname
xlabel=520
ylabel=10
deltay = 10
for i=0,nf-1,8 do begin
    for j=0,7 do begin
        x=readfits(f(i+j),h)
        y=congrid(x,64,64)
        tvscl,y,ni
        xyouts,xlabel,ylabel+(i+j)*deltay,string(i+j+1,f(i+j), $
               format='(i2,2x,a)')
        ni = ni+1
    endfor
    ni = ni+2
endfor
x=tvrd(0,0,512+128,512)
fi = 'idlplot.ps'
count = 0
repeat begin
       count = count+1
       fp=fi+string( format='(I3.3)',count)
       nfp=findfile(fp) 
       sp = size(nfp)
endrep until sp(0) eq 0
set_plot,'ps'
device,/landscape,xsize=9,ysize=7,/inch,yoffset=7.75,filename=fi
tv,x
device,/close
set_plot,lastdevice
spawn,'lpr -h -r -s -Plasco-phaser '+f
return
end
