1 | #!/bin/sh |
---|
2 | #-------------------------------------------------------------------------- |
---|
3 | # Wrapper script for ATNF Spectral Analysis Package (ASAP). |
---|
4 | #--------------------------------------------------------------------------- |
---|
5 | # Copyright (C) 2004,2005 |
---|
6 | # ATNF |
---|
7 | # |
---|
8 | # This program is free software; you can redistribute it and/or modify it |
---|
9 | # under the terms of the GNU General Public License as published by the Free |
---|
10 | # Software Foundation; either version 2 of the License, or (at your option) |
---|
11 | # any later version. |
---|
12 | # |
---|
13 | # This program is distributed in the hope that it will be useful, but |
---|
14 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
16 | # Public License for more details. |
---|
17 | # |
---|
18 | # You should have received a copy of the GNU General Public License along |
---|
19 | # with this program; if not, write to the Free Software Foundation, Inc., |
---|
20 | # 675 Massachusetts Ave, Cambridge, MA 02139, USA. |
---|
21 | # |
---|
22 | # Correspondence concerning this software should be addressed as follows: |
---|
23 | # Internet email: Malte.Marquarding@csiro.au |
---|
24 | # Postal address: Malte Marquarding, |
---|
25 | # Australia Telescope National Facility, |
---|
26 | # P.O. Box 76, |
---|
27 | # Epping, NSW, 2121, |
---|
28 | # AUSTRALIA |
---|
29 | # |
---|
30 | # $Id: |
---|
31 | #--------------------------------------------------------------------------- |
---|
32 | [ -x /usr/bin/clear ] && /usr/bin/clear |
---|
33 | |
---|
34 | echo "Loading ASAP..." |
---|
35 | |
---|
36 | inprompt='ASAP>' |
---|
37 | outprompt='asap>' |
---|
38 | |
---|
39 | p="`which ipython`" |
---|
40 | if [ ! -x "$p" ]; then |
---|
41 | echo "Can't find, or no execute permissions for 'ipython'" |
---|
42 | exit 1 |
---|
43 | fi |
---|
44 | |
---|
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 |
---|
63 | fi |
---|
64 | |
---|
65 | # |
---|
66 | # FIXME - allow more than one argument and handle args gracefuly. |
---|
67 | # |
---|
68 | |
---|
69 | $p -pi1 $inprompt -po $outprompt -nobanner -xmode "Plain" -c "from asap import *" $1 |
---|