Common Astronomy Software Applications, previously AIPS++.
See also http://casa.nrao.edu/
Due to requirements of different projects, we usually have multiple versions of casa installed. Command
casa will load the default version, usually the latest. Commands like
casa460 will be provided to start other versions, in this case 4.6.0.
Casa is built on python, but it comes with its own version, usually a slightly older one. Therefore, you cannot use all the modules we have installed in the usual locations. However, it's possible to build an environment using the casa-supplied version of python and install custom modules there, as long as they don't conflict with the modules that come with casa.
Currently, such an environment is available for casa 4.7.0, the latest version at the time of writing.
To use it, edit your
$HOME/.casa/init.py, which is a python script that will be run every time casa is started. In it, add the following lines:
# Set up an additional package directory as described in # https://casaguides.nrao.edu/index.php/OtherPackages import site extrapath="/software/casa/python-extras/lib/python2.7/site-packages" sys.path.append(extrapath) site.addsitedir(extrapath, known_paths=None)
Of course, if you want to use your own directory containing specially built python modules, you can do that, either by replacing the reference to our environment in
extrapath, or by adding multiple directories in this way.
If you want to build your own python environment for a specific casa version, this is how to get started (or actually, this is how I got this environment started, so replace the path with your own):
wget https://bootstrap.pypa.io/get-pip.py mkdir -p /software/casa/python-extras/lib/python2.7/site-packages setenv PYTHONPATH /software/casa/python-extras/lib/python2.7/site-packages /software/casa/casa-release-4.7.0-1-el7/bin/python get-pip.py --prefix=/software/casa/python-extras
What this does: first, we download get-pip.py, a script that basically contains pip, and can be used to install it in a python without any of such tools. Next, we make sure the directory structure is in place for installing pip and other python modules. Pointing both PYTHONPATH here when installing, will makes sure that everything will end up in the intended locations. Then, we run get-pip with the python that comes with the chosen casa version to make sure it will integrate properly. Once pip is installed, using this version of pip will work to install other packages in this directory, e.g.
/software/casa/python-extras/bin/pip install --prefix=/software/casa/python-extras fitsio
See also https://casaguides.nrao.edu/index.php/OtherPackages which is where we found how to set this up.