#!/usr/bin/env tcsh 
# Copyright 2005, 2006 University of Leiden.
#
# This file is part of MIA+EWS.
#
# MIA+EWS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# MIA+EWS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MIA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#!/usr/bin/env tcsh 
#   Usage:
#   dispCrossCoeff Afiles (blank separated list) Bfiles CurveFile outputBaseName [-sky]
$vltiCbin/oirChopPhotoImages -in "$1" -out $4.Achop.fits  -ref $3
if (0 != $status) then
   echo "A chop photometry failed"
   exit 1
endif
$vltiCbin/oirChopPhotoImages -in "$2" -out $4.Bchop.fits  -ref $3
if (0 != $status) then
   echo "B chop photometry failed"
   exit 1
endif
$vltiCbin/oirSci2HiPhot -AB $4.Achop.fits -outbase $4A  -ref $3
if (0 != $status) then
   echo "A conversion to HIGH_SENS format failed"
   exit 1
endif
$vltiCbin/oirSci2HiPhot -AB $4.Bchop.fits -outbase $4B  -ref $3
if (0 != $status) then
   echo "B conversion to HIGH_SENS format failed"
   exit 1
endif
echo "starting oircrosscoeff"
$vltiCbin/oirCrossCoeff $4 -mask $3 -cross $4.crossCoeff.fits $5
