	character*60 f1,ch*5760,label*46,c6*6,object,pp*8
	call system('ls p*.fit > /tmp/1.dis')
        cali=0
        seeing=9
        k=iargc()
        if(k.gt.0)then
          call getarg(1,c6)
          read(c6(1:),*)cali
          if(k.gt.1)then
            call getarg(2,c6)
            read(c6(1:),*)seeing
          endif
        endif
c        write(*,*)k,cali,seeing
  
	open(1,file='/tmp/1.dis',status='old')	
	i=0
10	i=i+1
	read(1,'(a)',end=100)f1
	open(2,file=f1,status='old',access='direct',recl=5760)
	read(2,rec=1)ch
        k=37*80+44
	if(i.eq.1)write(*,2)ch(k:k);
2	format(5x,'  Filename     Obs_date_time (UT)  Exp. '
     *  ,'Object  A73   SkyAdu seeing  u',a,' rms'/80('-'))
        f1(16:16)='  '
	k=index(ch,'DATE-OBS')+11
	m=index(ch,'TIME-OBS')+10
        j=index(ch,'EXPTIME')+23
        l=index(ch,'OBJECT')+9
        ch(m:m)=' '
        ch(l:l+1)='  '
	label=f1(1:16)//ch(k+2:k+9)//ch(m:m+8)//ch(j:j+4)//ch(l:l+7)
        k=index(ch,'SKYADU')+24
        j=80*60+26
        pp=ch(j:j+3)//ch(j+37:j+40)
        if(ch(j+39:j+39).eq.char(58))then
          pp=ch(j:j+3)//char(32)//ch(j+39:j+41)
        endif
c       write(*,*)ch(j:j+3),ch(k+81:k+85)
        c1=0.
        read(ch(j:j+3),*)c1
        s1=0.
        read(ch(k+81:k+85),*)s1
        u4=0.
        read(ch(k+263:k+268),*)u4
        if(c1.eq.0.)c1=5.
c	write(*,*)c1,s1,u4
        if(cali.ne.0. .and.u4.ne.0.)then
          if(c1.gt.cali.and.s1.lt.seeing)goto 10
        endif 
	write(*,1)i,label,pp,ch(k-2:k+4),ch(k+81:k+85),
     c     ch(k+263:k+268),ch(k+345:k+347)
1	format(i3,': ',6a)
	goto 10
100	close (1)
	call unlink('/tmp/1.dis')
	end
