#! /bin/csh
#++++++++++++++++
#.IDENTIFICATION epoch.csh
#.LANGUAGE       C-shell
#.AUTHOR         Francois Ochsenbein [CDS]
#.ENVIRONMENT    
#.KEYWORDS       
#.VERSION  1.0   23-Apr-1996
#.PURPOSE        Correct epochs of GSC Plates
#.COMMENTS       Verify the exact coincidennce over GSC
#----------------

echo "----Verifying the coincidence of RA+DEC over GSC"
set tt = /tmp/$$.gsc
set pgm = `dirname $0`
if ($pgm !~ /*) set pgm = $cwd/$pgm
set pgm = $pgm/bin/decode.exe

foreach d([NS]*)
    cd $d
    foreach f(*.GSC)
	$pgm $f | sed '/^ *$/d' | sort +1 +2 \
	| gawk -v f=$f '{ if ($2 == a && $3 == d) { \
		if ($1 != gsc) print f ":", r "\n" f ":", $0 ; \
	} a=$2; d=$3; gsc = $1; r=$0}' 
    end
    cd ..
end
