	character*60 f1
	real x(13500),y(13500),xmag(13500)
	if(iargc().eq.0)then
	  write(*,*)'  Usage: selfcheck file'
	  write(*,*)
	  stop
	endif
	call getarg(1,f1)
        open(1,file=f1,status='old')
	read(1,'(a)',end=20)f1
	i=0
10	i=i+1
	read(1,'(a)',end=20)f1
	read(f1(26:),*)x(i),y(i),xmag(i)
	goto 10
20	n=i-1
	close(1)
	write(*,*)'data readin:',n

	do 30 i=1,n-1
	z1=x(i)
	z2=y(i)
	do 30 j=i+1,n	
	z=(x(j)-z1)**2+(y(j)-z2)**2	
30	if(z.le.2.)write(*,*)i,z1,z2,xmag(i),j,x(j),y(j),xmag(j)
c 2*1.7=3.4 arcsec
	end	
