#! /bin/csh -f
# Last edited on 1999-08-07 19:34:07 by hcgl

# PZUpdateSegs \
#   -inName ~/tese/tests/ceramic-2/ceramic-2-f128-s \
#   -band 128 \
#   -nCurves 111 \
#   -chainDir ~/tese/tests/ceramic-2 \
#   -chainPrefix ceramic-2 \
#   -outName ~/tese/tests/ceramic-2/ceramic-2-f128-z
# 
# echo '======================================================'

/bin/rm -f test-f128-o.can
PZGetInitialCands \
  -chainDir ~/tese/tests/ceramic-2 \
  -chainPrefix ceramic-2 \
  -nCurves 6 \
  -band 128 \
  -excludeSegs ~/tese/tests/ceramic-2/ceramic-2-f128-z \
  -outName test-f128-o \
  -maxDist 4.5 -critDist 1.5 -baseDist 3.0 \
  -minLength 180 \
  -shrinkFactor 0.6 \
  -maxPairCands 300 \
  -printCands 20 \
  -verbose

/bin/rm -f test-f128-o-sample.can
cat test-f128-o.can \
  | gawk \
      -v m=200 \
      ' \
        /^[-+0-9]/{ if (n >= m) { next; } n++; } \
        /^candidates =/{if ($3 > m) { $3 = m; } } \
        /./ { print; next; } \
      ' \
  > test-f128-o-sample.can

/bin/rm -f test-f128-o-sample-cand.ps
PZDrawCands \
  -inName test-f128-o-sample \
  -chainDir ~/tese/tests/ceramic-2 \
  -chainPrefix ceramic-2 \
  -band 128 \
  -extension ".flc" \
  -outName test-f128-o-sample \
  -maxCands 100 \
  -drawEvery 1 \
  -drawMatch \
  -displace 20 \
  -nCandsPerPage 5 5

ghostview test-f128-o-sample-cand.ps

/bin/rm -f test-f128-o-sample-0000-0001-grid.ps
PZDrawCandGrids \
  -inName test-f128-o-sample \
  -outName test-f128-o-sample \
  -maxCands 50 \
  -cellSize 1.5 \
  -epsFormat \
  -candGridLine 0 0 0 0 \
  -segments \
    0 79 0 79 +  1 81 0 81 -
  
foreach f ( test-f128-o-sample-*-grid.{ps,eps} )
  echo '=== '$f' ==='
  ghostview $f
end
