	character*80 f1,head(72)
        real a(2048*2048)

	if(iargc().lt.1)then
	  write(*,*)
	  write(*,*)'      ******** clear edge of combined frame ****'
	  write(*,*)
	  write(*,*)'      d_sht fitsfile'
	  write(*,*)
          write(*,*)'                                      1998,10'
	  stop
	endif

	call getarg(1,f1)         
        i=lnblnk(f1)
	f1(i+1:i+1)=char(0)
	open(52,file=f1,status='old',access='direct',recl=5760)
	read(52,rec=1)head
	close(52)
	if(head(4)(60:64).ne.'range')then
          write(*,*)'   undo !'
	  stop
	endif
        read(head(4)(66:),*)ix1,ix2
        read(head(5)(66:),*)iy1,iy2
        write(*,*)'x: ',ix1,ix2,' y: ',iy1,iy2	

	call readfits(f1,a,n1,n2)
	call f_blank(a,ix1,ix2,iy1,iy2)
	call swap4(a,n1*n2*4)
	call tvwrite(f1,a,n1*n2*4,5760)
	write(*,*)'   ok!'
	end

	subroutine f_blank(a,ix1,ix2,iy1,iy2)
	real a(2048,2048)
	if(ix1.gt.1)then
	  do 10 j=1,2048
	  do 10 i=1,ix1
10	  a(i,j)=0.
	endif
        if(ix2.lt.2048)then
	  do 20 j=1,2048
	  do 20 i=ix2,2048
20	  a(i,j)=0.
	endif
	if(iy1.gt.1)then
	  do 30 i=1,2048
	  do 30 j=1,iy1
30	  a(i,j)=0.
	endif
	if(iy2.lt.2048)then
	  do 40 i=1,2048
	  do 40 j=iy2,2048
40	  a(i,j)=0.
	endif
	end
