Академический Документы
Профессиональный Документы
Культура Документы
Scope of CASA
NRAO uses CASA to support ALMA and EVLA. ESO contributes with 2FTEs as stakeholder
for ALMA for development and maintenance of CASA.
CASA has a core (casacore) which is used by various radio-telescopes (e.g. LOFAR, SKA,
ALMA, EVLA), and modifications to it have to be compatible with all of them.
ESO has contributed in the following areas of CASA during the last few years:
Flagging (i.e. mark bad data)
Transformation of visibilities prior to imaging
Parallelization Framework (MPI)
Useful links:
CASA Homepage (NRAO): https://casa.nrao.edu/
CASA Cookbook: https://casa.nrao.edu/docs/cookbook/
There are 4 well defined levels of components in CASA. It is possible to inspect the code as reading
this guide using web-browser access to the CASA svn repository:
https://svn.cv.nrao.edu/svn/casa/trunk/
flagging: Set of flagging agents to flagdata covering various algorithms like clip, shadow, or
RFI detection. It consists of one top level orchestrator, and separated classes (agents) for
each flagging algorithm and the I/O access layer.
code/flagging/Flagging
AgentFlagger: Top level orchestration with state-like methods like open, configure,
run, done..
FlagDataHandler, FlagMSHandler, FlagCalTableHandler: I/O layer which basically
relies on the Visibility Iterator / Visibility Buffer interface:
code/msvis/VisBuffer2.h
code/msvis/VisibilityIterator2.h
FlagAgentBase,
FlagAgent<Manual/Clip/Shadow/Extention/Quack/Summary/Rflag>: Set of
flagging agents to flagdata covering various algorithms like clip, shadow, or RFI
detection.
components: These are still C++ components that mainly resort to the orchestrator defined
in code. The interface files (.h headers) are automatically generated by SWIG using the
definitions contained in an xml file. This xml file also contains the in-line documentation.
The following components are maintained by ESO:
tasks: These are python scripts that call different components to perform standard
operations. Each task also has an xml file that provides constrains for the parameters and
defines in-line documentation. For each task there is a set of functional tests, which are ran
routinely to make sure that daily developments don't break existing functionality. The
following tasks are maintained by ESO.
http://pythontesting.net/framework/nose/nose-introduction/
https://svn.cv.nrao.edu/svn/casa/trunk/gcwrap/python/scripts/mpi4casa/CASA-4.3-MPI-Parallel-
Processing-Framework-Installation-and-advance-user-guide.pdf
asap: This is the container for the ALMa Single Dish code developed by NAOJ. It is currently
migrating from an old data format (Scan Table) to the standard data format of CASA
(Measurement Set), thus it is required that all CASA code supports Single Dish data.
https://casa.nrao.edu/Memos/229.html#SECTION00041000000000000000
Tile & Layout: The data cubes (visibilities, spectral weights, channelized flags) are organized
with store managers using a tiling approach – that is, the data is read and cached using blocks
called 'tiles' which are defined the first time a Measurement Set is created.
http://casacore.github.io/casacore/group__Tables__module.html#Tables_TiledStMan
MSSelection: There is a defined syntax to select rows on a Measurement set based on various
selection axis (spw,time,scan,baseline,uvrange, etc)
http://www.aoc.nrao.edu/~sbhatnag/misc/msselection/msselection.html#GeneralSyntax.html
TaQL: The Table Query Language is query-like language to select rows from a Measurement
Set (actually a generic CASA table):
http://www.astron.nl/casacore/trunk/casacore/doc/notes/199.html
https://casa.nrao.edu/Release4.3/docs/doxygen/html/classcasa_1_1vi_1_1VisibilityIterator2.html#detail
s
https://casa.nrao.edu/Release4.3/docs/doxygen/html/classcasa_1_1vi_1_1VisBuffer2.html#details
Lustre Cluster: The clusters typically used for processing ALMA/EVLA data with CASA are
based on Lustre+Inifiniband connection. For more details about this HW architecture please
contact the NRAO Lustre Cluster responsible (jrobnett@nrao.edu).
Mstransform Framework
MSTransform is a common framework to perform transformations in visibility data such as
time averaging, channel averaging, Hanning smooth, re-gridding, reference frame
transformation, Spectral Window combination/separation or simply data splitting.
http://www.eso.org/~jagonzal/CASA-Documentation/mstransform/desing/CASA-4.1-Transform-
Visibility-Framework.pdf
https://casa.nrao.edu/docs/cookbook/casa_cookbook005.html#sec271
The key aspect of the mstransform framework is that all transformations are performed in
memory w/o requiring intermediate I/O steps:
https://science.nrao.edu/enews/casa_003/
A first version of the MSTransform framework contained all transformations in a single class
(MSTransformManager) with resorted to function pointers to configure all transformations at
the various levels (cube/matrix/row).
https://svn.cv.nrao.edu/svn/casa/trunk/code/mstransform/MSTransform/MSTransformManager.cc
A second version is on the way, which resorts to different classes (transforming iterators as
originally designed) to concatenate all operations. Transforming Visibility Iterators (TVI) have
the same public interface as a normal Visibility Iterator used to transverse the data, but perform
some transformations in between. It is possible to concatenate transforming iterators in an
arbitrary order:
https://open-jira.nrao.edu/browse/CAS-8347
https://open-jira.nrao.edu/browse/CAS-8219
http://www.eso.org/~jagonzal/CASA-Documentation/mstransform/TVI/TVI-Development-Guide.pdf
At the time being what is pending is the “SPW Combination” transforming iterator, and
migrating MSTransformManager to use TVIs instead of function pointers:
https://open-jira.nrao.edu/browse/CAS-8352
https://open-jira.nrao.edu/browse/CAS-8353
In parallel other applications like flagging (ESO) plotms (Pam Ford) and calibration (George
Moellenbrock) are using TVIs from the mstransform framework for averaging or phase shifting,
so it is important to keep an eye on their needs and developments:
https://open-jira.nrao.edu/browse/CAS-4619
https://open-jira.nrao.edu/browse/CAS-6215
https://open-jira.nrao.edu/browse/CAS-8269
http://www.eso.org/~jagonzal/CASA-Documentation/HPC/Poster/Python-parallelization-poster-
sciops2015.pdf
https://svn.cv.nrao.edu/svn/casa/trunk/gcwrap/python/scripts/mpi4casa/CASA-4.3-MPI-Parallel-
Processing-Framework-Installation-and-advance-user-guide.pdf
http://www.eso.org/~jagonzal/CASA-Documentation/HPC/mpi4casa/CASA-Parallel-Processing-
Framework.pdf
https://www.duo.uio.no/handle/10852/10848
http://pythonhosted.org/mpi4py/usrman/index.html
http://pythonhosted.org/mpi4py/apiref/index.html
And uses a Multi-Measurement Set approach (split MS by scan/spw) to break down the
processing in various independent sub-jobs (aka trivial parallelization).
https://svn.cv.nrao.edu/svn/casa/trunk/gcwrap/python/scripts/mpi4casa/CASA-4.3-Multi-MS-Structure-
doc.pdf
http://www.eso.org/~jagonzal/CASA-Documentation/HPC/TrivialParallelization/Not-So-Trivial-
Parallelization.pdf
https://open-jira.nrao.edu/browse/CAS-9426
https://open-jira.nrao.edu/browse/CAS-9287
Flagging framework
The CASA flagging framework was restructured already some years ago and is currently quite
stable. Each flagging algorithm is encapsulated in a separated class (Flagging Agent) and all I/O
is handled in a separated class (MSTransformDataHandler) with two specializations, one for
Measurement sets (MSDataHandler) and another for Calibration Tables (FlagCalTableHandler):
http://www.aoc.nrao.edu/~rurvashi/FlaggerDocs/FlaggerDocs.html
https://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1FlagAgentBase.html
https://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1AgentFlagger.html#details
https://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1FlagDataHandler.html
https://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1FlagDataHandler.html#details
Currently it is quite stable, but there are some interesting developments specially in the area of
automatic flagging (RFI), and also in connection with the Transform Visibility Iterator
Framework, namely to apply some transformations on the fly before applying flag algorithms:
https://open-jira.nrao.edu/browse/CAS-6215
https://open-jira.nrao.edu/browse/CAS-5808
* Some key people taking care of casacore (can resolve questions, help with pull requests,
etc)
- Ger van Diepen (ASTRON): diepen@astron.nl
- Jim Jacobs (NRAO): jjacobs@nrao.edu
Data repository: There is also a repository of testing datasets containing small Measurement
Sets for the task-level functional tests, and also some bigger Measurement Sets for regressions.
Additionally it contains ephemeris and geodetic data which is necessary to start up CASA.
https://svn.cv.nrao.edu/svn/casa-data/trunk
NOTE: Since the data repository is quite big, we typically have only one copy per development
machine, and we add a link in the build area pointing to it (see “Build process” section).
Build process: Currently CASA is supported for Red Hat 6/7 and MAC OX 10.10/10.11.
Build instructions for MAC 10.10 and MAC 10.11 include installing all the 3 rd party
dependencies using MacPorts, and then configure using cmake as described here:
https://safe.nrao.edu/wiki/bin/view/Software/CASA/CasaEnvSetupOSX1010
https://safe.nrao.edu/wiki/bin/view/Software/CASA/CasaCMakeFlagsOSX1010
https://safe.nrao.edu/wiki/bin/view/Software/CASA/CasaEnvSetupOSX1011
https://safe.nrao.edu/wiki/bin/view/Software/CASA/CasaCMakeFlagsOSX1011
There are also build instructions for RedHat 6/7, including configuration of a yum
repository for the 3rd party dependencies:
https://safe.nrao.edu/wiki/bin/view/Software/CASA/HowToSetupAnEL6CasaDevelopmentComputer
https://safe.nrao.edu/wiki/bin/view/Software/CASA/CasaCMakeFlagsRH6
https://safe.nrao.edu/wiki/bin/view/Software/CASA/HowToSetupAnEL7CasaDevelopmentComputer
https://safe.nrao.edu/wiki/bin/view/Software/CASA/CasaCMakeFlagsRH7
But the ESO CASA development machines already have this configuration (CASA development 3 rd
party package dependencies) available in the following machines (using Centos instead of RedHat, but
they are almost identical).
Host Cores RAM Container OS Local Storage Network Area Data repository
Machine (Dockers) (No backup!) Storage (read-only, updated
(domain (No backup!) daily)
hq.eso.org)
almahost01 8 16G almahpc01 Centos 6 /data/users /data/data_casa
/diska (local)
almahost02 12 12G almahpc02 Centos 6 /diska /data/nas (btrfs) /data/data_casa
/data1 (mounted from (mounted from
/data/users (solid sagan5 with sagan4 with NFS)
state disk – don't use NFS)
for storage)
sagan5 16 64G almahpc03 Centos 6 /data/users (ext4) /data/nas (btrfs) /data/data_casa
/data/nas2 (ext4) (mounted from
almahpc04 Centos 7
sagan4 with NFS)
NOTE 1: These machines are accessible using the same ESO login credentials as for the rest of the system (e.g. email,
Navision, etc). ESO user accounts are also auto-mounted via NFS under /home/
NOTE 2: The 3rd party dependencies should be upgraded using yum as announced via the casa-staff mailing list.
Configure and build in order casacore, code, gcwrap, asap (from their build directories)
cmake -C <CASA_CMAKE_OPTS> -DCMAKE_INSTALL_PREFIX=CASA_INSTALL_DIR <CASA_CODE_DIR>/casacore
make all -j8
make install (not automatic for casacore)
Source casainit.sh script which should have been created automatically inside
<CASA_BUILD_AREA> . After that all paths are properly set and it is should be
possible to start-up CASA. By default a logger gui pops-up but it is possible to disable it
(and have logs showin at the terminal) with the options --nologger --log2term --nogui
source <CASA_BUILD_AREA>/casainit.sh
casa --nologger --log2term --nogui
Now you can inspect the inline documentation of tasks like flagdata and mstransform by
typing “help flagdata” or “help mstransform”. You can also take a look at the input
parameters of each tasks typing “inp flagdata”/”inp mstransform”.
Additionally CASA take into account the following configuration files and
environmental variables:
MemoryResidentSubtables.enable: true
$HOME/.casa/init.py: This file contains some python-level imports that are required
at init time. It can also include settings of global variables to control e.g. exception
handling.
NOTE: This setting is actually recommended: __rethrow_casa_exceptions=True
These unit tests are compiled as small executables, as defined in the module's CmakeList,
using the Cmake macro “casa_add_google_test”: but sometimes it happens that there are
dependencies on other modules that come later on in the compilation chain, therefore it is
necessary to add the unit test executable to some other module. This happens for instance
with many tests under code/mstransform/TVI/test, which are actually defined in
code/synthesis/CMakeList:
casa_add_google_test( MODULES mstransform SOURCES ../mstransform/TVI/test/tChannelAverageTVI.cc ../mstransform/TVI/test/TestUtilsTVI.cc)
casa_add_google_test( MODULES mstransform SOURCES ../mstransform/TVI/test/tHanningSmoothTVI.cc ../mstransform/TVI/test/TestUtilsTVI.cc)
Once a Gtest has been added to an appropiate CmakeList, then it is possible to compile it,
and it will be installed under the module in which the defining CmakeList belongs, for
instance:
tUVContSUbTVI has its code under code/mstransform/TVI/test
But it is add es a test in code/synthesis/CMakeList
It is installed under code/build/synthesis/tUVContSubTVI
C++ unit tests are the first line of tests that ran after a commit, so if something went wrong
the developer responsible of the offending commit gets a notification email.
As described in the previous sections there is a collection of functional tests that exercise
each CASA task. These unit tests are based on Python NOSE framework and in order to use
it have to import the NOSE's unittest module, and create unit test classes derived from
unittest.TestCase with a setUp method (typically copy over test files) a tearDown
method (delete test files) and various unit tests. There are many good examples for the
flagging and mstransform tasks:
gcwrap/python/scripts/tests/test_flagdata
mstransform (gcwrap/python/scripts/tests/test_mstransform
In order to run these tests there is an utility script called “runUnitTests” in which it is
possible to specify in brackets an entire class of tests to be run or only one particular test.
Run all flagdata tests:
casa --nogui --log2term -c <INSTALL_PATH>/linux_64b/python/2.7/runUnitTest.py test_flagdata
NOTE: It is fundamental (actually mandatory) to run the task-level unit tests of all tasks
affected by modifications in the corresponding code base.
Regressions
https://svn.cv.nrao.edu/test-summary/
In case of a failing regressions and email is sent to the case-staff mailing list, in which case
it is necessary to inspect which regressions and/or functional tests may have failed. This
email points to a Bamboo job, which is a web tool integrated with Jira that shows the failing
tests and associated commits and Jira-Issues (See Software Engineering section).
CASA guides
Finally there is a set of CASA Guides available online, describing with lots of details a
complete data reduction process using CASA. It is highly recommend to go trough at least
one of this guides as an introduction to CASA:
https://casaguides.nrao.edu/index.php/ALMAguides
Software engineering
Atlassian tools: CASA Uses the Atlassian ecosystem tools, which are very well integrated
among themselves and with svn/git
Jira: Ticketing system, which is used for all work items (bug reports and engineering tasks).
It shows the svn/git commits.
https://open-jira.nrao.edu
Confluence: Team collaboration tool, which shows all tickets and their scheduled start/stop
dates automatically. It also shows vacations (license), travels and meetings but not like the
Jira tickets, the corresponding dates have to be manually entered by each developer.
https://open-confluence.nrao.edu
Bamboo: Test reporting system that shows for each test job the associated tickets and svn/git
commits.
https://open-bamboo.nrao.edu
Ticket life-cycle: CASA tickets have a life-cycle with the following phases
Open: This is just ticket creation, it can be a bug open by users and/or other CASA team
members, or an engineering tasks open by CASA leads or developers. In general is good to
have tickets for all relevant work pieces (including documentation), collected under an
umbrella ticket (or “Epic” using the Atlassian terms) and separated individually whenever it
makes sense.
Scheduled: At this phase is when it is estimated how much effort a ticket will take (start/stop
dates). This is mandatory so that the ticket shows up in the Confluence team collaboration
tool. Also it is mandatory to specify the target CASA release.
Ready to verify: This is the verification phase when the main developers of the ticket verify
the functionality (using C++ Gtests, Python task tests or similar).
Ready to validate: After the ticket has been verified by developers it goes to user validation
phase (typically science validation) which is conducted by an independent team of
users/scientists.
Priorities: Typically CASA tickets have priority “High”. Priority “Blocked” is reserved only
to issues affecting coming releases. Which cannot be circumvented by a workaround.
Release cycle:
Official releases: CASA has typically 2 major releases per year, but there can be various
patch releases (e.g. CASA 4.5, 4.5.1, 4.5.2, 4.5.3). For ALMA there is usually a new cycle
starting in October-November so a release is produced in September. These are the release
dates of the latests CASA releases:
Feature freeze: Typically there is a feature freeze 1 month before the target release data, and at
that point a release branch is created and commits are quite restricted.
Release criteria: The release is only produce after all regression tests are passing successfully. In
case of failing regression a test summary is sent to the casa-staff mailing list and developers
have to inspect this list to check if some of their tests are failing.
Continuous integration: Apart from the official releases, there is a continuous integration
process, handled by a Jenkins Job, which produces tarballs available for download:
Top-Level view
https://casa.nrao.edu/active/docs/doxygen/html/index.html
Example AgentFlagger:
https://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1AgentFlagger.html
Example MSTransformDatahandler:
https://casa.nrao.edu/active/docs/doxygen/html/classcasa_1_1SubMS.html#a2ff8
8a50ca24c19b2aeda5a705ced1a4
Task and component in-line documentation: This is the documentation defined via xml and
exposed to the python-level thanks to SWIG.
gcwrap/tools/mstransformer/mstransformer.xml
gcwrap/tools/flagging/agentflagger.xml
gcwrap/tasks/flagdata.xml
gcwrap/tasks/mstransform.xml
User manual: Up to release 4.7 CASA documentation has been compiled in the so-called
“CASA Cookbook” which is generated via Latex. But as of today we are migrating to Plone
a content management system.
CASA Twiky: This is the collaborative web area where developers post documentation to share
with other team members: https://safe.nrao.edu/wiki/bin/view/Software/CASA/WebHome
https://safe.nrao.edu/wiki/bin/view/Software/CASA/CASAMeetingPage#Monday_Morning_Meetings
CASA Users Committee: There is a stable CASA users Committee that holds a regular
meeting each year to give recommendations about CASA, details can be found here:
https://safe.nrao.edu/wiki/bin/view/Software/CASA/CASAUsersCommittee
CASA Staff: This is a partial list of CASA staff which not at all complete (sorry for whoever I
may have missed!!) but contains the most regular contacts in the context of the ESO
contributions to CASA. I highlight the following groups:
in green the members of the TVI (Transform Visibility Iterator) development group which is
likely to be very active in the future.
In blue the members of the CASA HPC Group who have been working closely with MPI.
In orange the members of the flagdata development group.
CASA Accounts
Domain Server
NRAO CASA Atlassian Tools https://open-jira.nrao.edu
(Jira, Confluence, Bamboo) https://open-confluence.nrao.edu
https://open-bamboo.nrao.edu
NRAO CASA Twiky https://safe.nrao.edu/wiki/bin/view/Software/CASA/WebHome
NRAO Linux domain login.aoc.nrao.edu
(Socorro and Charlottesville cluster) ssh.cv.nrao.edu
NRAO Windows domain https://casa.nrao.edu/plonedocs
(Plone documentation)