#! /bin/csh -f
# Last edited on 2003-11-20 22:58:27 by stolfi

set usage = "$0 RUN BAND"

echo "$0 $*"

set run     = "$1"; shift;
set band    = "$1"; shift;

if ( $#argv != 0 ) then
  echo "usage: ${usage}"; exit 1
endif

source RUN-${run}/f${band}.parms
echo "band = ${band} curvSigma = ${curvSigma}"

set nums = ( `list-fragment-numbers` )

echo 'nums = '${nums}
foreach num ( ${nums} )

  set fname  = "${num}/f${band}"
  echo '=== '${fname}' ==============================='
  /bin/sh -c "/bin/rm -f ${fname}.{fcv,cvc}; exit 0"
  if ( -r ${fname}.fcv ) then
    nice -n 19 PZEncodeCurvature \
      -input ${fname} \
      -output ${fname} \
      -sigma ${curvSigma}
  else
    echo "${fname}.fcv does not exist, skipped"
  endif

end


