Introduction to CASA Crystal Brogan ALMA CASA Subsystem Scientist (NRAO/NAASC) With lots of help from Steve Myers (Project Scientist)
CASA Tutorial – Hamilton June 2, CASA (Common Astronomy Software Applications) CASA is the offline data reduction package for ALMA and EVLA Beta Release Status: in Beta Release since October 2007 Roughly biannual “patches” register at Current Release: Beta Release Patch 2.4 Next ’09 (3.0)
CASA Tutorial – Hamilton June 2, Outline IPython & Python CASA help CASA task interface MS and data selection The Memory Sticks Documentation
CASA Tutorial – Hamilton June 2, CASA Interface IPython shell access autoparenthesis (autocall) command history session logging ipython.log – ipython command history casapy.log – casa messages numbered input/output history/searching Python Cookbook Appendix D
CASA Tutorial – Hamilton June 2, Python Pointers to run a.py script: execfile(‘ ’) example: execfile(‘ngc5921_demo.py’) indentation matters! be careful when doing cut-and-paste to Python cut a few (4-6) lines at a time variables are global when using task interface! tasknames are objects (not variables)
CASA Tutorial – Hamilton June 2, Tasks and tools in CASA Tasks - high-level functionality function call or parameter handling interface these are what you should use in tutorial Tools - complete functionality tool.method calls, used by tasks sometimes shown in tutorial scripts
CASA Tutorial -- 7 October 2008 Key Tasks To see list of tasks after startup organized by type: >tasklist
CASA Tutorial – Hamilton June 2, Task Execution two ways to invoke: call from Python as functions with arguments taskname( arg1=val1, arg2=val2,... ) unspecified parameters will be defaulted (globals not used) use standard tasking interface use global variables for task parameters see Chapter 1.3 in Cookbook
CASA Tutorial – Hamilton June 2, Task Interface standard tasking interface use parameters set as global Python variables set = (e.g. vis = ‘ngc5921.demo.ms’ ) parameter manipulation commands using inp, default, saveinputs, tget execute or go ( e.g. clean() ) return values some tasks return Python dictionaries, e.g. myval=imval()
CASA Tutorial – Hamilton June 2, Task Interface examine task parameters with inp :
CASA Tutorial – Hamilton June 2, Expandable Parameters boldface parameter are expandable
CASA Tutorial – Hamilton June 2, Parameter Checking sanity checks of parameters in inp : erroneous values in red
CASA Tutorial – Hamilton June 2, Help on Tasks In-line help: >help ‘clean’ OR >pdoc clean
CASA Tutorial – Hamilton June 2, 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 – Hamilton June 2, CASA Tool List list of default tools from toolhelp : tools described in the CASA User Reference Manual:
CASA Tutorial – Hamilton June 2, The Measurement Set the MS is a directory on disk the MAIN table in table.* files also contains sub-tables e.g. FIELD, SOURCE, ANTENNA, etc. sub-tables are sub-directories to copy must cp -rf to get contents Best to remove ms with rmtables(‘filename’) WARNING: moving a MS can break cal-table dependencies
CASA Tutorial – Hamilton June 2, Example MS Example: ls ngc5921.usecase.ms ls ngc5921.usecase.ms/FIELD
CASA Tutorial – Hamilton June 2, MAIN Table Contents Example using task browsetable:
CASA Tutorial – Hamilton June 2, Data Selection Example standard selection parameters e.g. for task gaincal: field and spw common standard selections expandable selectdata with other selections as sub-parameters
CASA Tutorial – Hamilton June 2, Data Selection Syntax see Chapter 2.5 of Cookbook field - string with source name or field ID can use ‘*’ as wildcard, first checks for name, then ID example: field = ‘ ’ ; field = ‘3C*’ ; field = ‘0,1,4~5’ spw - string with specwindow ID plus channels use ‘:’ as separator of spw from optional channelization use ‘^’ as separator of channels from step/width example: spw = ‘0~2’ ; spw = ‘1:10~30’ ; spw = ‘2~5:5~54^5’
CASA Tutorial – Hamilton June 2, Selection Syntax see Chapter 2.5 of Cookbook antenna - string with antenna name or ID first check for name, then ID (beware VLA name 1-27, ID 0-26) example: antenna = ‘1~5,11’ ; antenna = ‘VA*’ timerange - string with date/time range specify ‘T0~T1’, missing parts of T1 default to T0, can give ‘T0+dT’ example: timerange = ‘2007/10/16/01:00:00~06:30:00’
CASA Tutorial – Hamilton June 2, The Memory Sticks etc. Contents: “Install_README” - installation instructions “installation” - directory contains 32-bit linux and intel mac files. Please see me if you need 64-bit linux. Please install before Wed. “casa_scripts_and_data.tar” copy this to your hard drive before Wed. Note a copy of the casa cookbook is included in this directory. A slightly newer version is available at ok.pdf ok.pdf Additional CASA Scripts & Data Page
CASA Tutorial – Hamilton June 2, Getting User Support First stop: CASA Home: Cookbook, and “help” within CASA CASA Helpdesk & Support “Helpdesk” at (will migrate to more user friendly helpdesk in future) You will need to register first Submit questions, suggestions, bugs
CASA Tutorial – Hamilton June 2, CASA Documentation CASA Analysis cookbook: CASA User Reference Manual: Python: (e.g., see Tutorial for novices) IPython: matplotlib: