#!/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:
#   dispSciPhot ABfiles (blank separated list) maskFile CurveFile CrossFile outputBaseName dSky

#echo "   dispSciPhot:deChopping AB images"
$vltiCbin/oirChopPhotoImages -in "$1" -out $5.ABphotometry.fits -dSky $6 -ref $3 -order 1
if (0 != $status) then
   echo "   AB chop photometry failed"
   exit 1
endif
$vltiCbin/oirSci2HiPhot -AB $5.ABphotometry.fits -outbase $5 -ref $3 -cross $4 
if (0 != $status) then
   echo "   Conversion Sci to Hi failed "
   exit 1
endif
$vltiCbin/oirMakePhotoSpectra -A $5.Aphotometry.fits -B $5.Bphotometry.fits -out $5.photometry.fits -mask $2 
if (0 != $status) then
   echo "   Mask photometry operation failed"
   exit 1
endif
