
setenv SYM 4/mmm
setenv MAXADU 14000
setenv MINMEAS 3
setenv PDB ../rharr-nov2014.pdb
setenv RMAX 3.3e9

echo ">------------- $1 -----------------<"

echo 'Alternate stream'
alternate-stream $1  temp/temp1.stream temp/temp2.stream

echo 'Process_hkl'
process_hkl -i $1 -o temp/temp.hkl -y $SYM --max-adu=$MAXADU --min-measurements=$MINMEAS 
process_hkl -i temp/temp1.stream -o temp/temp1.hkl -y $SYM --max-adu=$MAXADU --min-measurements=$MINMEAS 
process_hkl -i temp/temp2.stream -o temp/temp2.hkl -y $SYM --max-adu=$MAXADU --min-measurements=$MINMEAS 


echo 'Anisotropic cutoff'
get_hkl -i temp/temp.hkl -o temp/temp_res.hkl -p $PDB --cutoff-angstroms=3.8,3.8,3.2
get_hkl -i temp/temp1.hkl -o temp/temp1_res.hkl -p $PDB --cutoff-angstroms=3.8,3.8,3.2
get_hkl -i temp/temp2.hkl -o temp/temp2_res.hkl -p $PDB --cutoff-angstroms=3.8,3.8,3.2
mv temp/temp_res.hkl temp/temp.hkl
mv temp/temp1_res.hkl temp/temp1.hkl
mv temp/temp2_res.hkl temp/temp2.hkl


echo 'compare_hkl'
compare_hkl temp/temp1.hkl temp/temp2.hkl -y $SYM -p $PDB --fom=ccstar --rmax=$RMAX --nshells=20 --shell-file=$1.ccstar
cat $1.ccstar


echo 'check_hkl'
check_hkl temp/temp.hkl -y $SYM -p $PDB --rmax=$RMAX --nshells=20
mv shells.dat $1.snr
cat $1.snr

