#!/bin/bash -l
#
# Copyright (C) 2013 Geert Jan Bex <geertjan.bex@uhasselt.be>
# 
# This program 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 3 of the License, or
# any later version.
# 
# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
#

# ensure that OpenBLAS doesn't blow up
export OMP_NUM_THREADS=1

# determine true location of Bash script
exec=$(readlink -f ${0})

# determine directory of vsc-module-dependencies
DIR=$( cd -P "$( dirname "${exec}" )" && pwd )

# load the Python interpeter from the config file
source "${DIR}/../conf/atools_python.sh"

OUT_FILE=$1
shift
IN_FILE=$1
shift

${PYTHON} ${DIR}/reduce_body.py "$@" < ${IN_FILE} >> ${OUT_FILE}
