casalith
CASA monolithic environment bundling Python and library dependencies into a single download package.
executables
The following executable applications are located in the <casa release>/bin directory of the expanded monolithic CASA tarball:
- python3(v3.6.7)
- pip3(v9.0.1)
- 2to3
- casa
- mpicasa
- casaviewer
All of the casaviewer functionality is available through Python (see the “viewer” API). The Python viewer API makes full use of the casaconfig module to find the appropriate data directory. The command line “casaviewer” found in the <casa_release>/bin directory does not use casaconfig. It may be nececssary to use the “–datapath” argument when starting the command line casaviewer so that the viewer knows where to find the data it needs (e.g. measures tables for frame conversions). That path is then used by that instance of the viewer.
<casa_release>/bin/casaviewer --datapath <path_to_installed_casa_data>
startup options
- terminal(-h, --help, --logfile, --log2term, --nologger, --nologfile, --nogui, --cachedir, --norc, --colors, --pipeline, --agg, --iplog, --notelemetry, --nocrashreport, --datapath, --user-site, -c)
With the full installation of CASA from a tar file, the python environment itself is included and started through ./bin/casa. This ./bin/casa executable can be provided the following options to change configuration values at run time:
-h, --help show this help message and exit
--configfile CONFIGFILE path to the user configuration file
--noconfig do not load user configuration file
--nositeconfig do not load site configuration file
--startupfile STARTUPFILE path to user's startup.py
--nostartupfile do not use any startup file
--logfile LOGFILE path to log file
--log2term direct output to terminal
--nologger do not start CASA logger
--nologfile do not create a log file
--nogui avoid starting GUI tools
--cachedir CACHEDIR location for internal working files
--colors {Neutral,NoColor,Linux,LightBG} prompt color
--pipeline start CASA pipeline run
--agg startup without graphical backend
--iplog create ipython log
--datapath DATAPATH data path(s) [colon separated]
--reference-testing force *measurespath* to contain the
casarundata when this version was
produced, used for testing purposes
--no-auto-update turn off all auto updates
--user-site include user's local site-packages lib in path
-v, --version show CASA version
-c ... python eval string or python script to execute
tasks
A few remaining tasks are found only in the monolithic environment
Brings up a browser that can open and display any CASA table (MS, calibration table, image) |
python libraries
The following third party libraries are included in the python distribution of monolithic casa and available as imports:
- libraries(attrs==19.3.0, backcall==0.1.0, certifi==2020.12.5, cycler==0.10.0, decorator==4.4.2, grpcio==1.29.0, importlib-metadata==1.6.0, ipython==7.15.0, ipython-genutils==0.2.0, jedi==0.17.0, kiwisolver==1.2.0, matplotlib==3.2.1, more-itertools==8.3.0, mpi4py==3.0.3, numpy==1.18.4, packaging==20.4, parso==0.7.0, pexpect==4.8.0, pickleshare==0.7.5, pluggy==0.13.1, prompt-toolkit==3.0.5, protobuf==3.12.2, ptyprocess==0.6.0, py==1.8.1, pyfits==3.5, Pygments==2.6.1, pyparsing==2.4.7, pytest==5.4.2, python-dateutil==2.8.1, pytz==2020.1, scipy==1.4.1, six==1.15.0, traitlets==4.3.3, wcwidth==0.2.2, zipp==3.1.0)
Note that each component in the modular CASA distribution uses a subset of these same dependencies.
The definition is provided here in pip compatible format such that one could save the preceding list to a list.txt file and recreate using:
pip install -r list.txt
startup.py
- startup.py
This section only applies to the monolithic/tar-file CASA distribution, and it only applies to CASA 6.
For CASA 5, please see an earlier version of CASA Docs.
The 'startup.py' file found in $HOME/.casa (i.e. ~/.casa/startup.py) is evaluated by the CASA shell just before the CASA prompt is presented to the user. This allows users to customize their CASA shell environment beyond the standard settings in 'config.py', by importing packages, setting variables or modifying the python system path.
One case where this is useful is for configuring CASA for ALMA data reduction. A package called 'analysisUtils' is often used as part of ALMA analysis. It is typically imported and instantiated in startup.py:
$ cat ~/.casa/startup.py
import sys, os
import analysisUtils as aU
sys.path.append("/home/casa/contrib/AIV/science/analysis_scripts/")
es = aU.stuffForScienceDataReduction()
In this example, the standard python modules os and sys are made available in the CASA shell. The path where the analysisUtils module can be found is added to the Python system path, and finally the package is imported and an object is created. These modules and objects will then be available for the user within the CASA shell environment.