#! /bin/sh
# @(#)pymidas.sh        
# .COPYRIGHT: Copyright (c)2006 European Southern Observatory, Sampo team

error="0"

if [ -z $MIDASHOME ]; then 
	#echo MIDASHOME $MIDASHOME
	echo "Your MIDASHOME variable is not set !"
	error="1"

fi

if [ -z $MIDVERS ]; then
       # echo MIDVERS $MIDVERS
	echo "Your MIDVERS variable is not set !"
	error="1"
fi

if  [ $error -eq 1 ]; then
	if  [ $# -gt 0 ]; then 
		if [ $1=="-h" -o $1 == "--help"  ]; then 
 			pymidas -h
		fi
	fi
	 echo "Midas specific variables must be set before launching PyMidas."
	 echo "If your PyMidas session is executed via command 'inpymidas', "
	 echo "LD_LIBRARY_PATH will bet automatically"  
else
	export LD_LIBRARY_PATH=$MIDASHOME/$MIDVERS/lib:$LD_LIBRARY_PATH
	pymidas $* 

fi



