#!/bin/sh
#
# Edit following line if QSAS installed elsewhere on your system.
# Note that the contortions below to cope with the space in "Program Files" should work in all cases
export QSAS_HOME=$PROGRAMW6432/QSAS/QSAS30
#export QSAS_HOME=/home/steve/QSAS_build/QSAS_3_0/QSAS_dist

# Set cdf 3.1 to create files readable by cdf 2.7
export CDF_FILEBACKWARD=TRUE

# cd to QSAS_HOME to set PATH and FILTER_BANK. 
# Note this cd works, but export PATH="${QSAS_HOME}"/lib:$PATH
# does not as it leaves path as C:\Program Files... rather than /c/program files...
# 
cd "${QSAS_HOME}"
export PATH=$PWD/lib:$PATH
export FILTER_BANK=$PWD/examples/FilterBank

# run from bin to resolve pgplot colour maps and fonts
cd bin
./qsas_exe.exe -style cleanlooks | ./disp.exe

# ---------------- historical and debugging stuff below -----------------
#export PATH=$PATH:$QSAS_HOME/lib/
#export PATH=$QSAS_HOME/lib/:$PATH
# need to run from QSAS_HOME/bin to resolve pgplot maps and such
# Additionally, the above PATH has windows C:\Program Files ..." which don't work, so
#   below we set path after cd to QSAS_HOME (which does work!)
# "..." are needed to protect space in "Program Files" and safe if QSAS_HOME is elsewhere
#cd "${QSAS_HOME}"/bin
#export PATH=../lib/:$PATH
#./qsas_exe.exe -style cleanlooks | ./disp.exe
#
# Extra stuff.
#"${QSAS_HOME}"/bin/qsas_exe.exe -style cleanlooks | ./disp.exe
#
# to debug, uncomment the following 2 lines (and comment out the above)
# Requires loop in .profile entered if QSAS_DEBUG defined to define QSAS_HOME and set up path
# as gdb runs in its own shell
# export QSAS_DEBUG="on"
#gdb "${QSAS_HOME}"/bin/qsas_exe.exe
