Changeset 689
- Timestamp:
- 09/23/05 16:21:57 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/asap
r656 r689 28 28 # AUSTRALIA 29 29 # 30 # $Id :30 # $Id$ 31 31 #--------------------------------------------------------------------------- 32 32 [ -x /usr/bin/clear ] && /usr/bin/clear … … 34 34 echo "Loading ASAP..." 35 35 36 inprompt='ASAP>' 37 outprompt='asap>' 36 prefix='/usr/local' 38 37 39 p="`which ipython`" 40 if [ ! -x "$p" ]; then 41 echo "Can't find, or no execute permissions for 'ipython'" 38 # check if user set 39 if [ "x${ASAPDATA}" == "x" ]; then 40 ASAPDATA="${prefix}/share/asap" 41 export ASAPDATA 42 fi 43 44 if [ ! -d "${ASAPDATA}" ]; then 45 echo "Couldn't locate the asap data directory" 46 ASAPDATA="/nfs/aips++" 47 #export ASAPDATA 48 #exit 1 49 fi 50 51 # Keep casa measures happy 52 if test -d "${ASAPDATA}/data" ; then 53 platform='Linux' 54 if [ `uname -s` == 'Darwin' ]; then 55 platform='darwin' 56 fi 57 AIPSPATH="${ASAPDATA} ${platform} somewhere localhost" 58 export AIPSPATH 59 else 60 echo "Couldn't find the ASAP data directory" 42 61 exit 1 43 62 fi 44 63 45 46 # at the moment we need AIPS++ for measures tables and endian detection 47 if [ "${AIPSPATH}" == "" ]; then 48 aroot='/nfs/aips++' 49 ASAPDATA='/usr/local/share/asap' 50 if test -d ${ASAPDATA} ; then 51 AIPSPATH="${ASAPDATA} linux_gnu somewhere localhost" 52 export AIPSPATH 53 elif test -d ${aroot}/weekly ; then 54 . ${aroot}/weekly/aipsinit.sh 55 elif test -d ${aroot}/daily ; then 56 . ${aroot}/daily/aipsinit.sh 57 elif test -d /nfs/aips++/pks ; then 58 . /nfs/aips++/pks/aipsinit.sh 59 else 60 echo "Cannot locate casa installation or ASAP data directory" 61 exit 0 62 fi 64 # started for the first time 65 ASAPUSERDIR="${HOME}/.asap" 66 if [ ! -d ${ASAPUSERDIR} ]; then 67 echo 'First time ASAP use. Setting up ~/.asap' 68 mkdir "${ASAPUSERDIR}" 69 cp "/tmp/ipythonrc-asap" "${ASAPUSERDIR}/" 70 #cp "${ASAPDATA}/ipythonrc-asap" "${ASAPUSERDIR}/" 71 touch "${ASAPUSERDIR}/asapuserfuncs.py" 63 72 fi 64 73 65 # 66 # FIXME - allow more than one argument and handle args gracefuly. 67 # 74 ip="`which ipython`" 68 75 69 $p -pi1 $inprompt -po $outprompt -nobanner -xmode "Plain" -c "from asap import *" $1 76 if [ ! -x "$ip" ]; then 77 echo "Can't find, or no execute permissions for 'ipython'" 78 echo "Running asap through 'python':" 79 p="`which python`" 80 $p -c 'from asap import *' 81 else 82 $ip -ipythondir "${ASAPUSERDIR}" -p 'asap' $* 83 fi
Note:
See TracChangeset
for help on using the changeset viewer.