#!/bin/bash
#
# This file may be sourced to run vlti school software
# - it mostly defines env vars and aliases
# - it tries to use local data or use shared server area if not available
#
# --
# Guillaume

# Use NFS data if not yet copied
if [ -e "/school" ]
then
   export SCHOOL_SOFT_ROOT=/school/soft
   export SCHOOL_DATA_ROOT=/school/data
else
   export SCHOOL_SOFT_ROOT=/mnt/server/soft
   export SCHOOL_DATA_ROOT=/mnt/server/data
fi

# MiRA setup:
# - set PATH
export PATH="$PATH:/home/linux/easy-yorick-2013-09-12/bin"


# AMDLIB setup:
# - set PATH
# warning it also include yorick...
export AMDLIBROOT=${SCHOOL_SOFT_ROOT}/amdlib
export INTROOT=${AMDLIBROOT}
export PATH=$PATH:${AMDLIBROOT}/bin:${AMDLIBROOT}/amdlib/yorick/bin
alias launch_amdlib=amdlib

# ASPRO setup:
# - set ENV VARS
export GAG_ROOT_DIR=$SCHOOL_SOFT_ROOT/gildas
export GAG_EXEC_SYSTEM=x86_64-mandrake2010.2-gfortran-no_python
source $GAG_ROOT_DIR/etc/bash_profile
alias launch_aspro=aspro

# ASPRO2 setup:
# - set alias to run associated jar
alias aspro2="java -jar ${SCHOOL_SOFT_ROOT}/aspro2/Aspro2-0.9.5.jar"
alias launch_aspro2=aspro2

# BSMEM setup: 
# - set PATH, LD_LIBRARY_PATH and PG related env vars
export PATH=$PATH:${SCHOOL_SOFT_ROOT}/bsmem
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:${SCHOOL_SOFT_ROOT}/utils/pgplot/:${SCHOOL_SOFT_ROOT}/utils/nfft-3.2.3/.libs
export PGPLOT_DIR=${SCHOOL_SOFT_ROOT}/utils/pgplot/
export PGPLOT_FONT=${SCHOOL_SOFT_ROOT}/utils/pgplot/grfont.dat
alias launch_bsmem=bsmem

# DFITS setup:
# - set PATH
export PATH=$PATH:${SCHOOL_SOFT_ROOT}/dfits
alias launch_dfits=dfits
alias launch_dfits_help=dfits_help

# FITSORT setup:
# - set PATH
export PATH=$PATH:${SCHOOL_SOFT_ROOT}/fitsort
alias launch_fitsort=fitsort
alias launch_fitsort_help=fitsort_help


# FV setup:
# - set PATH
export PATH=$PATH:${SCHOOL_SOFT_ROOT}/fv5.3/
alias launch_fv=fv

# GASGANO setup:
# - set PATH
export PATH=$PATH:${SCHOOL_SOFT_ROOT}/gasgano-2.4.3/bin/
alias lauch_gasgano=gasgano


# IDL setup:
# - load setup script (handling SCHOOL_DATA_ROOT)
# - set PATH for an help used by mia
source ${SCHOOL_SOFT_ROOT}/exelis/idl/bin/idl_setup.bash
export PATH=$PATH:${SCHOOL_SOFT_ROOT}/exelis/idl/bin/
alias launch_idl=idl
export IDL_STARTUP=$HOME/.idl_startup.pro

# JAVA setup:
# - set PATH (as first one)
export PATH=${SCHOOL_SOFT_ROOT}/jre1.7.0_25/bin/:$PATH
alias launch_java=java

# LITPRO setup:
# - set alias to run associated jar
alias litpro="java -jar ${SCHOOL_SOFT_ROOT}/litpro/LITpro-1.0.13beta7.jar"
alias LITpro="java -jar ${SCHOOL_SOFT_ROOT}/litpro/LITpro-1.0.13beta7.jar"
alias launch_litpro=litpro

# MIA+EWS setup:
# - set PATH
export PATH="$PATH:${SCHOOL_SOFT_ROOT}/MIA+EWS-2.0"
alias launch_mia=mia

# OIFITSEXPLORER setup:
# - set alias to run associated jar
alias oifitsexplorer="java -jar ${SCHOOL_SOFT_ROOT}/oifitsexplorer/OIFitsExplorer-0.1.4.jar"
alias launch_oifitsexplorer=oifitsexplorer

# OIFITSLIB setup:
# - set PATH
export PATH=$PATH:${SCHOOL_SOFT_ROOT}/oifitslib

 
