Before Starting CASA
If you have done a default installation under Linux using rpms, or
on the Mac with the CASA application, then there should be a sh
script called casapy in the /usr/bin area which is in
your path. This shell will set up its environment and run the version
of casapy that it points to. If this is how you set up the
system, then you need to nothing further and can run casapy.
Depending on your setup, there may be other specially built versions
available. For example at the NRAO AOC, the ``stable build'' can be
started by running ``casapy-test'',
e.g.
/usr/bin/casapy-test
Before starting up casapy, you should set or reset any
environment variables needed, as CASA will adopt these on startup. For
example, the PAGER environment variable determines how help is
displayed in the CASA terminal window. We recommend using the
cat option for most users, as this works
smoothly both interactively and in scripts.
In bash:
PAGER=cat
or in csh or tcsh:
setenv PAGER cat
The actions of these are as if you were using the equivalent Unix
shell command to view the help material.
Where is CASA
Note that the path to the CASA installation, which contains
the casainit shell scripts and data repository,
will also depend upon the
installation. With a default installation under Linux this
will probably be in
/usr/lib/casapy/
while in a Mac OSX default install it will likely be a
self-contained application (in the Applications area)
with the data repository in /opt/casa/
You can find the location after initialization by looking at
the CASAPATH environment variable. You can find
it within casapy by typing:
pathname=os.environ.get('CASAPATH').split()[0]
print pathname
For example, at
the NRAO AOC, the current release is executed as
/usr/bin/casapy
and uses the pathname to
/usr/lib/casapy/23.0.6654-001
Sometimes, you will have multiple non-default
versions (for example, various development versions). For example at the
NRAO AOC, the ``stable build'' is in /home/casa.
Then, to use this version you invoke the appropriate casainit
shell script, e.g.
. /home/casa/casainit.sh (bash or Bourne)
or
source /home/casa/casainith.csh (csh or tcsh).
Starting CASA
Generally, you will want to start CASA from a working directory
for your project. Just make this directory and
cd to it. As usual, things go better if this is on
a disk local to your machine.
After having run the appropriate casainit script, CASA is started by
typing casapy on the UNIX command line, e.g.
casapy
On the Mac, you can also double-click the CASA Application to
start. It will then start up in your home area.
After startup information, you should get an IPython CASA <1>:
command prompt in the
xterm window where you started CASA. CASA will take approximately 10
seconds to initialize at startup in a new working directory;
subsequent startups are faster. CASA is active when you get a
CASA <1>: prompt in the command line interface. You will also
see a logger GUI appear on your Desktop (usually near the
upper left).
You also have the option of starting CASA without the logger, for
example if you are running remotely in a terminal window without
an X11 connection, or if you just do not want to see the logger GUI.
In this case use the --nologger option:
casapy --nologger
The logger messages will still go into the casapy.log file.
If you want to see these at your terminal, use the
--log2term option also:
casapy --nologger --log2term
What If Something Goes Wrong?
First, always check that your inputs are correct; use
inp <taskname>
Next, check the inline documentation using the "pdoc" facility:
pdoc <taskname>
or
pdoc par.<parameter_name>
to review the allowed parameters. For example,
pdoc par.selectdata
will give guidance on the use of this parameter (and in this
case its sub-parameters).
If something has gone wrong and you want to stop what is executing,
then typing CNTL-C will usually cleanly abort the application.
Alert: Note that you will likely lose contact with the
logger GUI if you have one, so you will then want to restart CASA.
If CASA crashes, then usually
restarting casapy is sufficient to get you going again.
Note that there
may be spawned subprocesses still running, such as the
casaviewer or the logger. These can be dismissed manually
in the usual manner. After a crash, there may also be hidden
processes. You can find these by listing processes, e.g. in linux:
ps -elf | grep casa
or on MacOSX (or other BSD Unix):
ps -aux | grep casa
You can then kill these, for example using the Unix kill
or killall commands. This may be necessary if you are running
remotely using ssh, as you cannot logout until all your
background processes are terminated. For example,
killall ipcontroller
or
killall Python
will terminate the most common post-crash zombies.