#!/bin/csh -f
# Automatically set psf in catalog from findstars
if ($1 == ^) then
  caterr <<'EOF'

  Automatically set psf using program findstars
    usage: autopsf catalog Nmin sigma size
    Arguments: catalog - catalog to be used to automatically find stars
                         and to have psf set in header
               Nmin - minimum number of stars to be found
               sigma - maximum (sigma ir1)/<ir1> for stars
	       size - the psf size (<=15)
    Output: Information from findstars and template

'EOF'
  exit
endif
findstars $2 $3 <$1 |template $4 $4|setpsf $1
