Introduction to CASA
( originally prepared by J. McMullin)
CASA
Common Astronomy Software Applications
Post processing of radio astronomical data (ALMA, EVLA projects) C++ application libraries with Python interface (iPython)
Currently Beta release (Oct 15, 2007, patch 0.5 on Nov 15,2007) Patch 1.0 will be ~Feb 15, 2008
CASA Tutorial@NAOJ -- 16-18 Jan 2008 2
CASA Web
http://casa.nrao.edu -- CASA Home Page
Main resource for end users
http://my.nrao.edu -- NRAO Services (incl. registration/download of CASA)
Help Desk/Installation Front; manned by scientists (ALMA, ARC, NAUG, etc) to handle front-line user support.
CASA Tutorial@NAOJ -- 16-18 Jan 2008 3
CASA Development
CASA developers (current)
Sanjay Bhatnagar David King CASA management Manager (TBD) – interim,Brian Glendenning Steve Myers, Project Scientist
Shannon Jaeger (Univ. Calgary)
Kumar Golap George Moellenbrock Raymond Rusk (DRAO) Darrell Schiebel Tak Tsutsumi Boyd Waters Honglin Ye Wes Young
(Michel Caillat, Laura Glendenning) CASA Tutorial@NAOJ -- 16-18 Jan 2008 4
CASA Documentation
CASA Analysis cookbook:
http://casa.nrao.edu/Doc/Cookbook/casa_cookbook.pdf
CASA User Reference Manual:
http://casa.nrao.edu/docs/casaref/CasaRef.html
Python: http://python.org/doc (e.g., see Tutorial for novices) IPython: http://ipython.scipy.org/moin/Documentation
matplotlib: http://matplotlib.sourceforge.net/
CASA Tutorial@NAOJ -- 16-18 Jan 2008 5
CASA Installation
Currently requires root permission (for Linux flavors) (Experimental) non-root version is also available now Download from my.nrao.edu after registration
Supports:
Fedora Core 6, Fedora 7 RH Linux 4, 5 Mac OSX Intel RH Linux 4, ACS 6.0.4
CASA Tutorial@NAOJ -- 16-18 Jan 2008 6
CASA Interface
IPython
Python
CASA help
CASA task interface
CASA Tutorial@NAOJ -- 16-18 Jan 2008 7
CASA Interface
IPython
shell access autoparenthesis (autocall) command history macro session logging (ipython.log, casapy.log) numbered input/output history/searching
CASA Tutorial@NAOJ -- 16-18 Jan 2008 8
Python Pointers
to run a .py script:
execfile(‘
’)
example: execfile(‘ngc5921_usecase.py’)
indentation matters!
be careful when doing cut-and-past to Python
variables are global!
tasknames are objects (not variables)
CASA Tutorial@NAOJ -- 16-18 Jan 2008 9
CASA Interface
CASA help startup tasklist taskhelp CASA Task Interface globals error handling inp command
toolhelp
help taskname help par.par_name
task execution
default saveinputs/tget
Logging GUI
10
Tasks in CASA
tasks: high (user) level functionality
call from Python as functions standard tasking interface
parameter manipulation using inp , default , saveinputs , tget
arguments are parameters
these are global Python variables ( set = )
see Chapter 1.3 in Cookbook
CASA Tutorial@NAOJ -- 16-18 Jan 2008 11
Task Interface
examine task parameters with inp :
CASA Tutorial@NAOJ -- 16-18 Jan 2008 12
Expandable Parameters
boldface parameter are expandable
CASA Workshop -- 16-18 Oct 2007 13
Parameter Checking
sanity checks of parameters in inp :
erroneous values in red
CASA Tutorial -- 16-18 Jan 2008 14
Help on Tasks
In-line help command:
CASA Tutorial -- 16-18 Jan 2008 15
Tools in CASA
CASA Toolkit underneath tasks
core AIPS++ code (mostly in C++)
tools are functions
call from casapy as .() default tool objects are pre-constructed
e.g. imager (im) , calibrater (cb), ms (ms) , etc. (see toolhelp)
CASA Tutorial@NAOJ -- 16-18 Jan 2008 16
Tool Objects
tools run as distributed objects (DO)
default DOs are pre-constructed
these are used by the tasks
one for each tool
are persistent
DANGER! tasks can trample on each other
CASATutorial@NAOJ -- 16-18 Jan 2008 17
Help on Tools
use completion in casapy to list
also help . or .?
CASA Tutorial@NAOJ -- 16-18 Jan 2008 18
Asynchronous Tasks
run tasks in background
set parameter async=True
runs as separate process
use taskmanager tool (tm) to monitor (Cookbook Chapter 1.3.2) messages will appear in logger in the asynchronous order
will instantiate separate tools
useful to avoid known problems (e.g. exportfits / importfits)
CASA Tutorial@NAOJ -- 16-18 Jan 2008 19
Functionality Census
Import: VLA archive, UVFITS, image FITS Export: UVFITS, image FITS Information: listcal, listhistory, listobs, imhead Editing: flagautocorr, flagdata, flagmanager, plotxy, viewer Display: clearplot, plotants, plotcal, plotxy, viewer Calibration: accum, applycal, bandpass, gaincal, fluxscale, clearcal, listcal, smoothcal Imaging: clean, feather, ft, invert, makemask, mosaic Modelling: setjy, uvcontsub, uvmodelfit
20
Toolkit Census
cb - calibration cp - calibration solution plotting fg - flagging, flag management mp - MS plot (e.g., data vs quantities)
ms - MS utilities
qa - quanta sm - simulation tb - table access tp - table plotting
ia - image analysis
im - imaging
me - measures
21
Test data available in the data repository
(https://svn.cv.nrao.edu/svn/casa-data/trunk/regressions/)
ATST1 ATST2
NGC5921, NGC7538, G192 (VLA SF) GGTAU, L02D, H121 (PdBI SF)
NGC1333 (VLA), NGC4826 (BIMA) NGC4826 (BIMA+KP 12m) Orion (VLA+GBT)
ATST3 ATST4
ATST5
B0319 (Flux cal for NGC1333)
FLS3, IRC+10216, OrionS (GBT SD)
CASA Tutorial@NAOJ -- 16-18 Jan 2008 22
Demo
Installation
Go to: http://my.nrao.edu
Assess the build Download sample data set
svn co https://svn.cv.nrao.edu/svn/casa-data/trunk/regression/ATST1/NGC921
Start up
Type casapy
Execute test regression script
os.system(‘cp ‘+sys.path[2]+’/ngc5921_regression.py .’) execfile ‘ngc5921_regression.py’
Illustrate interface features
CASAdemoscript.py
CASA Tutorial@NAOJ -- 16-18 Jan 2008 23