introduction to casa crystal brogan alma casa subsystem scientist (nrao/naasc) with lots of help...
DESCRIPTION
CASA Tutorial – Hamilton June 2, Outline IPython & Python CASA help CASA task interface MS and data selection The Memory Sticks DocumentationTRANSCRIPT
Introduction to CASACrystal Brogan
ALMA CASA Subsystem Scientist (NRAO/NAASC)
With lots of help from Steve Myers (Project Scientist)
CASA Tutorial – Hamilton June 2, 2009 2
CASA (Common Astronomy Software Applications)
CASA is the offline data reduction package for ALMA and EVLABeta Release Status:
in Beta Release since October 2007
Roughly biannual “patches”
register at http://my.nrao.edu
Current Release: Beta Release Patch 2.4Next Release @Nov ’09 (3.0)
CASA Tutorial – Hamilton June 2, 2009 3
Outline
IPython & PythonCASA helpCASA task interfaceMS and data selectionThe Memory SticksDocumentation
CASA Tutorial – Hamilton June 2, 2009 4
CASA InterfaceIPython
shell accessautoparenthesis (autocall)command historysession logging
ipython.log – ipython command historycasapy.log – casa messages
numbered input/outputhistory/searching
PythonCookbook Appendix D
CASA Tutorial – Hamilton June 2, 2009 5
Python Pointersto run a .py script:
execfile(‘<scriptname>’)example: execfile(‘ngc5921_demo.py’)
indentation matters!be careful when doing cut-and-paste to Pythoncut 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, 2009 6
Tasks and tools in CASATasks - high-level functionality
function call or parameter handling interface
these are what you should use in tutorial
Tools - complete functionalitytool.method calls, used by tasks
sometimes shown in tutorial scripts
CASA Tutorial -- 7 October 2008
Key TasksTo see list of tasks after startup organized by type:
>tasklist
CASA Tutorial – Hamilton June 2, 2009 8
Task Executiontwo ways to invoke:
call from Python as functions with argumentstaskname( arg1=val1, arg2=val2, ... )
unspecified parameters will be defaulted (globals not used)
use standard tasking interfaceuse global variables for task parameters
see Chapter 1.3 in Cookbook
CASA Tutorial – Hamilton June 2, 2009 9
Task Interfacestandard tasking interface
use parameters set as global Python variablesset <param> = <value> (e.g. vis = ‘ngc5921.demo.ms’ )
parameter manipulation commandsusing inp , default , saveinputs , tget
execute<taskname> or go ( e.g. clean() )
return valuessome tasks return Python dictionaries, e.g. myval=imval()
CASA Tutorial – Hamilton June 2, 2009 10
Task Interfaceexamine task parameters with inp :
CASA Tutorial – Hamilton June 2, 2009 11
Expandable Parametersboldface parameter are expandable
CASA Tutorial – Hamilton June 2, 2009 12
Parameter Checkingsanity checks of parameters in inp :
erroneousvalues in red
CASA Tutorial – Hamilton June 2, 2009 13
Help on TasksIn-line help:
>help ‘clean’ OR >pdoc clean
CASA Tutorial – Hamilton June 2, 2009 14
Tools in CASACASA Toolkit underneath tasks
core AIPS++ code (mostly in C++)
tools are functions call from casapy as <tool>.<method>()
default tool objects are pre-constructede.g. imager (im) , calibrater (cb), ms (ms) , etc. (see toolhelp)
CASA Tutorial – Hamilton June 2, 2009 15
CASA Tool Listlist of default tools from toolhelp :
tools described in the CASA User Reference Manual:
http://casa.nrao.edu/docs/casaref/CasaRef.html
CASA Tutorial – Hamilton June 2, 2009 16
The Measurement Setthe MS is a directory on disk
the MAIN table in table.* files
also contains sub-tablese.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, 2009 17
Example MSExample: ls ngc5921.usecase.ms
ls ngc5921.usecase.ms/FIELD
CASA Tutorial – Hamilton June 2, 2009 18
MAIN Table ContentsExample using task browsetable:
CASA Tutorial – Hamilton June 2, 2009 19
Data Selection Examplestandard 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, 2009 20
Data Selection Syntaxsee Chapter 2.5 of Cookbook
field - string with source name or field IDcan use ‘*’ as wildcard, first checks for name, then ID
example: field = ‘1331+305’ ; field = ‘3C*’ ; field = ‘0,1,4~5’
spw - string with specwindow ID plus channelsuse ‘:’ 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, 2009 21
Selection Syntaxsee Chapter 2.5 of Cookbook
antenna - string with antenna name or IDfirst 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 rangespecify ‘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, 2009 22
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 http://www.aoc.nrao.edu/~smyers/naug/doc/cookbook/casa_cookbook.pdf
Additional CASA Scripts & Data Pagehttp://casa.nrao.edu/casatraining.shtml
CASA Tutorial – Hamilton June 2, 2009 23
Getting User SupportFirst stop:
CASA Home: http://casa.nrao.edu
Cookbook, and “help” within CASA
CASA Helpdesk & Support“Helpdesk” at http://my.nrao.edu (will migrate to more user friendly helpdesk in future)
You will need to register first
Submit questions, suggestions, bugs
CASA Tutorial – Hamilton June 2, 2009 24
CASA DocumentationCASA 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/