NRAO Home > CASA > CASA Cookbook and User Reference Manual

CASA User Reference & Cookbook Release 4.1.0


Version: May 29, 2013


Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by AUI.

CASA Synthesis & Single Dish Reduction
Reference Manual & Cookbook

Editor: Jürgen Ott – Project Scientist

Jeff Kern – CASA Project Manager

CASA Synthesis & Single Dish Reduction
Reference Manual & Cookbook, Version May 29, 2013, ©2013 National Radio Astronomy Observatory The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc.


List of Tables
List of Figures
1 Introduction
  1.0.1 Reference for Publications
 1.1 About This Release
 1.2 Obtaining CASA
  1.2.1 What’s New in Release 4.1.0
 1.3 CASA Basics — Information for First-Time Users
  1.3.1 Before Starting CASA Environment Variables Where is CASA?
  1.3.2 Starting CASA
  1.3.3 Ending CASA
  1.3.4 What happens if something goes wrong?
  1.3.5 Aborting CASA execution
  1.3.6 What happens if CASA crashes?
  1.3.7 Python Basics for CASA Variables Lists and Ranges Indexes Indentation System shell access Executing Python scripts
  1.3.8 Getting Help in CASA TAB key help <taskname> help and PAGER help par.<parameter> Python help
 1.4 Tasks and Tools in CASA
  1.4.1 What Tasks are Available?
  1.4.2 Running Tasks and Tools Aborting Synchronous Tasks
  1.4.3 Getting Return Values
  1.4.4 Running Tasks Asynchronously Monitoring Asynchronous Tasks Aborting Asynchronous Tasks
  1.4.5 Setting Parameters and Invoking Tasks The scope of parameters in CASA The default Command The go Command The inp Command The saveinputs Command The tget Command The tput Command The .last file
  1.4.6 Tools in CASA
 1.5 Getting the most out of CASA
  1.5.1 Your command line history
  1.5.2 Logging your session Startup options for the logger Setting priority levels in the logger
  1.5.3 Where are my data in CASA? How do I get rid of my data in CASA?
  1.5.4 What’s in my data?
  1.5.5 Data Selection in CASA
 1.6 From Loading Data to Images
  1.6.1 Loading Data into CASA VLA: Filling data from VLA archive format Filling data from UVFITS format Loading FITS images Concatenation of multiple MS
  1.6.2 Data Examination, Editing, and Flagging Interactive X-Y Plotting and Flagging Flag the Data Non-interactively Viewing and Flagging the MS
  1.6.3 Calibration Prior Calibration Bandpass Calibration Gain Calibration Polarization Calibration Examining Calibration Solutions Bootstrapping Flux Calibration Correcting the Data Splitting the Data UV Continuum subtraction Transforming the Data to a new frame
  1.6.4 Synthesis Imaging Cleaning a single-field image or a mosaic Feathering in a Single-Dish image
  1.6.5 Self Calibration
  1.6.6 Data and Image Analysis What’s in an image? Image statistics Image values Moments of an image cube Image math Regridding an Image Displaying Images
  1.6.7 Getting data and images out of CASA
2 Visibility Data Import, Export, and Selection
 2.1 CASA Measurement Sets
  2.1.1 Under the Hood: Structure of the Measurement Set
 2.2 Data Import and Export
  2.2.1 ALMA: Filling of Science Data Model (ASDM) data Filling SDM v0 data using importoldasdm
  2.2.2 Janksy VLA: Filling of Science Data Model (ASDM) data
  2.2.3 VLA: Filling data from archive format (importvla) Parameter applytsys Parameter bandname Parameter frequencytol Parameter project Parameters starttime and stoptime Parameter autocorr Parameter antnamescheme Parameter evlabands
  2.2.4 UVFITS Import and Export Import using importuvfits Import using importfitsidi Export using exportuvfits
  2.2.5 Handling Measurement Set metadata and data
  2.2.6 Summarizing your MS (listobs)
  2.2.7 MMS summary (listpartition)
  2.2.8 Listing MS data (listvis)
  2.2.9 Listing and manipulating MS metadata (vishead)
  2.2.10 MS statistics (visstat)
  2.2.11 Concatenating multiple datasets (concat)
 2.3 Data Selection
  2.3.1 General selection syntax String Matching
  2.3.2 The field Parameter
  2.3.3 The spw Parameter Channel selection in the spw parameter
  2.3.4 The selectdata Parameters The antenna Parameter The scan Parameter The timerange Parameter The uvrange Parameter The observation Parameter The msselect Parameter
3 Data Examination and Editing
 3.1 Plotting and Flagging Visibility Data in CASA
 3.2 Managing flag versions with flagmanager
 3.3 X-Y Plotting and Editing of the Data
  3.3.1 MS Plotting and Editing using plotms Loading and Selecting Data A Brief Note Regarding plotms Memory Usage Plot Axes Tools Interactive Flagging in plotms Averaging Data Plot Symbols Summarizing Data Defining Frequency and Velocity Shifting the Phase Center Plot Ranges Plot Labels Grid Lines Legend The Options Tab Iteration Saving your plot Exiting plotms
  3.3.2 Plotting and Editing using plotxy GUI Plot Control The selectplot Parameters The iteration parameter The overplot parameter The plotrange parameter The plotsymbol parameter The showflags parameter The subplot parameter Averaging in plotxy Interactive Flagging in plotxy Flag extension in plotxy Setting rest frequencies in plotxy Printing from plotxy Exiting plotxy Example session using plotxy
  3.3.3 Plotting antenna positions using plotants
  3.3.4 Plotting uv-coverages plotuv
 3.4 Data Flagging using flagdata
  3.4.1 The action parameter
  3.4.2 Flagging Modes Manual Flag/Unflag List Clip Shadow Quack Elevation Tfcrop Rflag Extend Unflag Summary
 3.5 Command-based flagging using flagcmd
  3.5.1 Input modes inpmode Input mode ’table’ Input flag mode ’list’ Input flag mode ’xml’
  3.5.2 Operation types action Apply flags — optype option ’apply’ Unapply flags — action option ’unapply’ List flags — action=’list’ Plot flags — action=’plot’ Clear flags — action=’clear’ Extract Flag Commands— action=’extract’
  3.5.3 Flagging command syntax
 3.6 Browse the Data
4 Synthesis Calibration
 4.1 Calibration Tasks
 4.2 The Calibration Process — Outline and Philosophy
  4.2.1 The Philosophy of Calibration in CASA
  4.2.2 Keeping Track of Calibration Tables
  4.2.3 The Calibration of traditional VLA data in CASA
  4.2.4 Loading Jansky VLA data in CASA
 4.3 Preparing for Calibration
  4.3.1 System Temperature Correction
  4.3.2 Antenna Gain-Elevation Curve Calibration
  4.3.3 Atmospheric Optical Depth Correction Determining opacity corrections for VLA data Determining opacity corrections for VLA data
  4.3.4 Setting the Flux Density Scale using (setjy) Using Calibration Models for Resolved Sources
  4.3.5 Correction for delay and antenna position offsets using gencal
  4.3.6 Applying Jansky VLA switched power or ALMA Tsys using gencal
  4.3.7 Generate a gain table based on Water Vapor Radiometer data wvrgcal Statistical parameters shown in the logger output of wvrgcal
  4.3.8 Other a priori Calibrations and Corrections
 4.4 Solving for Calibration — Bandpass, Gain, Polarization
  4.4.1 Common Calibration Solver Parameters Parameters for Specification : vis and caltable Selection: field, spw, selectdata, intent, and observation Prior Calibration and Correction: parang Previous Calibration: gaintable, gainfield, interp and spwmap Solving: solint, combine, preavg, refant, minblperant, minsnr Action: append and solnorm
  4.4.2 Spectral Bandpass Calibration (bandpass) Bandpass Normalization B solutions BPOLY solutions
  4.4.3 Complex Gain Calibration (gaincal) Polarization-dependent Gain (G) Polarization-independent Gain (T) GSPLINE solutions Antenna Delays — ’K’ solutions Cross-Hand Delays — ’KCROSS’ solutions
  4.4.4 Establishing the Flux Density Scale (fluxscale) Using Resolved Calibrators
  4.4.5 Instrumental Polarization Calibration (D,X) Heuristics and Strategies for Polarization Calibration A Note on channelized polarization calibration A Polarization Calibration Example - Circular Feed Basis (e.g., VLA ν > 1 GHz) A Polarization Calibration Example - Linear Feed Basis (e.g., ALMA, VLA ν < 1 GHz)
  4.4.6 Baseline-based Calibration (blcal)
 4.5 Plotting and Manipulating Calibration Tables
  4.5.1 Plotting Calibration Solutions (plotcal) Examples for plotcal
  4.5.2 Listing calibration solutions with (listcal)
  4.5.3 Calibration table statistics (calstat)
  4.5.4 Calibration Smoothing (smoothcal)
  4.5.5 Calibration Interpolation and Accumulation (accum) Interpolation using (accum) Incremental Calibration using (accum)
 4.6 Application of Calibration to the Data
  4.6.1 Application of Calibration (applycal)
  4.6.2 Examine the Calibrated Data
  4.6.3 Resetting the Calibration Models (delmod and clearcal)
 4.7 Other Calibration and UV-Plane Analysis Options
  4.7.1 Splitting out Calibrated uv data (split) Averaging in split
  4.7.2 Recalculation of uvw values (fixvis)
  4.7.3 Hanning smoothing of uv data (hanningsmooth)
  4.7.4 Model subtraction from uv data (uvsub)
  4.7.5 UV-Plane Continuum Subtraction (uvcontsub)
  4.7.6 Spectral regridding of the MS (cvel)
  4.7.7 UV-Plane Model Fitting (uvmodelfit)
  4.7.8 Reweighing visibilities based on their scatter (statwgt)
  4.7.9 Change the signs of visibility phases (conjugatevis)
 4.8 Examples of Calibration
5 Synthesis Imaging
 5.1 Imaging Tasks Overview
 5.2 Common Imaging Task Parameters
  5.2.1 Parameter cell
  5.2.2 Parameter field
  5.2.3 Parameter imagename
  5.2.4 Parameter imsize
  5.2.5 Parameter mode Mode mfs Mode channel Mode frequency Mode velocity Sub-parameter interpolation
  5.2.6 Parameter phasecenter
  5.2.7 Parameter restfreq
  5.2.8 Parameter spw
  5.2.9 Parameter stokes
  5.2.10 Parameter uvtaper
  5.2.11 Parameter weighting ’natural’ weighting ’uniform’ weighting ’superuniform’ weighting ’radial’ weighting ’briggs’ weighting ’briggsabs’ weighting
  5.2.12 Parameter vis
  5.2.13 Primary beams in imaging
 5.3 Deconvolution using CLEAN (clean)
  5.3.1 Parameter psfmode The clark algorithm The hogbom algorithm The clarkstokes algorithm
  5.3.2 The multiscale parameter
  5.3.3 Parameter gain
  5.3.4 Parameter imagermode Sub-parameter cyclefactor Sub-parameter cyclespeedup Sub-parameter ftmachine Sub-parameter mosweight Sub-parameter scaletype The threshold revisited
  5.3.5 Parameter interactive
  5.3.6 Parameter mask Setting clean boxes Using clean mask images
  5.3.7 Parameter minpb
  5.3.8 Parameter modelimage
  5.3.9 Parameter niter
  5.3.10 Parameter pbcor
  5.3.11 Parameter restoringbeam
  5.3.12 Parameter threshold
  5.3.13 Parameter gridmode
  5.3.14 Interactive Cleaning — Example
  5.3.15 Mosaic imaging
  5.3.16 Heterogeneous imaging
  5.3.17 Polarization imaging
  5.3.18 Wide-field imaging and deconvolution in clean Outlier fields Setting up w-projection Setting up faceting Combination of w-projection and faceting
 5.4 Primary Beam Correction (impbcor, widebandpbcor)
 5.5 Combined Single Dish and Interferometric Imaging (feather)
  5.5.1 Visual Interface for feather (casafeather)
 5.6 Making Deconvolution Masks or Box Regions
  5.6.1 Making Deconvolution Regions from an Image (boxit)
 5.7 Insert an Image Model (ft)
 5.8 Image-plane deconvolution (deconvolve)
 5.9 Self-Calibration
 5.10 Parallel Cleaning (pclean)
 5.11 Examples of Imaging
6 Image Analysis
 6.1 Common Image Analysis Task Parameters
  6.1.1 Region Selection (box)
  6.1.2 Plane Selection (chans, stokes)
  6.1.3 Lattice Expressions (expr)
  6.1.4 Masks (mask)
  6.1.5 Regions (region)
 6.2 Image Header Manipulation (imhead)
  6.2.1 Examples for imhead
 6.3 Extracting sub-images (imsubimage)
 6.4 Continuum Subtraction on an Image Cube (imcontsub)
  6.4.1 Examples for imcontsub)
 6.5 Image-plane Component Fitting (imfit)
  6.5.1 Examples for imfit
 6.6 Mathematical Operations on an Image (immath)
  6.6.1 Examples for immath Simple math Polarization manipulation
  6.6.2 Using masks in immath
 6.7 Computing the Moments of an Image Cube (immoments)
  6.7.1 Hints for using (immoments)
  6.7.2 Examples using (immoments)
 6.8 Generating Position-Velocity Diagrams (impv)
 6.9 Computing image statistics (imstat)
  6.9.1 Using the task return value
  6.9.2 Examples for imstat
 6.10 Extracting data from an image (imval)
 6.11 Reordering the Axes of an Image Cube (imtrans)
 6.12 Collapsing an Image Along an Axis (imcollapse)
 6.13 Regridding an Image (imregrid)
 6.14 Regridding an Image (imreframe)
 6.15 Image Convolution(imsmooth)
 6.16 Spectral Line fitting with specfit
  6.16.1 Polynomial Fits
  6.16.2 Lorentzian and Gaussian Fits One or more single Gaussian/Lorentzian Gaussian Multiplets
  6.16.3 Pixel-by-pixel fits
 6.17 Image Mask Handling makemask
 6.18 Search for Spectral Line Rest Frequencies (slsearch)
 6.19 Convert Exported Splatalogue Catalogs to CASA Tables (splattotable)
 6.20 Image Import/Export to FITS
  6.20.1 FITS Image Export (exportfits)
  6.20.2 FITS Image Import (importfits)
 6.21 Using the CASA Toolkit for Image Analysis
 6.22 Examples of CASA Image Analysis
7 Visualization With The CASA Viewer
 7.1 Starting the Viewer
  7.1.1 Running the CASA Viewer outside casapy
 7.2 The Viewer Display Panel
  7.2.1 The Main Toolbar
  7.2.2 The Mouse Toolbar
  7.2.3 The Display Area The Animator Panel The Position Tracking Panel The Region Manager Panel
  7.2.4 Saving and Restoring the Display Panel State
 7.3 The Data Manager Panel — Saving and Loading Data
  7.3.1 Loading Data
  7.3.2 Registered vs. Open Datasets
  7.3.3 Saving Data or Regions
 7.4 Viewing Images
  7.4.1 Viewing a Raster Map Data Display Options — display and hidden axes Data Display Options — basic settings Graphical Specification of the Intensity Scale Data Display Options — other settings Viewer Canvas Manager — Panels, Margins, and Backgrounds
  7.4.2 Viewing a Contour Map Overlay Contours on a Raster Map
  7.4.3 Regions and the Region Manager Region Creation, Selection, and Deletion Region Positioning Region Statistics Saving and Loading Regions The Region Fit The Region Histogram
  7.4.4 The Spectral Profile Tool Spectral Profile Toolbar Main Spectral Profile Window Spectral-Line Fitting Line Overlays
  7.4.5 The Brightness Profile Tool
  7.4.6 The Collapse/Moments Tool
  7.4.7 The Histogram Tool
  7.4.8 The Two-D Fitting Tool
  7.4.9 Interactive Position-Velocity Diagram Creation
 7.5 Viewing Measurement Sets
  7.5.1 Data Display Options Panel for Measurement Sets MS Options — Basic Settings MS Options— MS and Visibility Selections MS Options — Display Axes MS Options — Flagging Options MS Options— Advanced MS Options — Apply Button
 7.6 Printing from the Viewer
 7.7 Image Viewer (imview)
 7.8 Measurement Viewer (msview)
8 Single Dish Data Processing
 8.1 Guidelines for Use of ASAP and SDtasks in CASA
  8.1.1 Environment Variables
  8.1.2 Assignment
  8.1.3 Lists
  8.1.4 Dictionaries
  8.1.5 Line Formatting
  8.1.6 Logging
 8.2 Single Dish Analysis Tasks
  8.2.1 SDtask Summaries sdcal sdcal2 sdsmooth sdbaseline sdreduce sdcoadd sdflag sdflagmanager sdfit sdgrid sdimaging sdlist sdmath sdplot sdsave sdscale sdstat sdtpimaging sdimprocess msmoments
  8.2.2 Single Dish Analysis Use Cases With SDTasks GBT Position Switched Data Analysis Imaging of Total Power Raster Scans
 8.3 Using The ASAP Toolkit within CASA
  8.3.1 Environment Variables
  8.3.2 Import General descriptions Handling ALMA data Importing NRO data
  8.3.3 Scantable Manipulation Data Selection State Information Masks Scantable Management Scantable Mathematics Scantable Save and Export
  8.3.4 Calibration Tsys scaling Flux and Temperature Unit Conversion Gain-Elevation and Atmospheric Optical Depth Corrections Calibration of GBT data Comprehensive calibration function
  8.3.5 Averaging
  8.3.6 Spectral Smoothing
  8.3.7 Baseline Fitting
  8.3.8 Line Fitting
  8.3.9 Plotting ASAP plotter Line Catalog
  8.3.10 Setting/Getting Rest Frequencies
  8.3.11 Single Dish Spectral Analysis Use Case With ASAP Toolkit
 8.4 Single Dish Imaging
  8.4.1 Single Dish Imaging Use Case With ASAP Toolkit
 8.5 Known Issues, Problems, Deficiencies and Features
9 Simulation
 9.1 Simulating ALMA observations with simobserve and simanalyze
 9.2 Simulating ALMA observations with simalma
  9.2.1 Implementation of simalma in CASA 4.1.0
10 Parallel Processing in CASA
 10.1 The CASA parallelization scheme
 10.2 Multi-MS-compatible tasks in CASA 4.1
 10.3 Parallelization control
  10.3.1 Requirements
  10.3.2 Configuration and Start-Up
  10.3.3 Monitoring
A Appendix: Obtaining, Installing, and Customizing CASA
 A.1 Installation On Linux
  A.1.1 Installation
   A.1.1.1 Using more than one Linux version of CASA
  A.1.2 Unsupported platforms
  A.1.3 Download & Unpack
 A.2 Installation on Mac OS
   A.2.0.1 Using more than one Mac version of CASA
 A.3 Startup
 A.4 Startup Customization
 A.5 Updating the data repository
B Appendix: Python and CASA
 B.1 Python Packages
 B.2 Automatic parentheses
 B.3 Indentation
 B.4 Lists and Ranges
 B.5 Dictionaries
  B.5.1 Saving and Reading Dictionaries
 B.6 Control Flow: Conditionals, Loops, and Exceptions
  B.6.1 Conditionals
  B.6.2 Loops
 B.7 System shell access
  B.7.1 Using the os.system methods
  B.7.2 Directory Navigation
  B.7.3 Shell Command and Capture
 B.8 Logging
 B.9 History and Searching
 B.10 Macros
 B.11 On-line editing
 B.12 Executing Python scripts
 B.13 How do I exit from CASA?
C Appendix: Models, Conventions and Reference Frames
 C.1 Flux Density Models for setjy
  C.1.1 Long wavelength calibration
   C.1.1.1 Baars
   C.1.1.2 Perley 90
   C.1.1.3 Perley-Taylor 95
   C.1.1.4 Perley-Taylor 99
   C.1.1.5 Perley-Butler 2010
   C.1.1.6 Perley-Butler 2013
  C.1.2 Short wavelength calibration
 C.2 Velocity Reference Frames
  C.2.1 Doppler Types
 C.3 Time Reference Frames
 C.4 Coordinate Frames
 C.5 Physical Units
 C.6 Physical Constants
D Appendix: CASA Region File Format
 D.1 Region definitions
 D.2 Allowed shapes
 D.3 Annotation definitions
 D.4 Global definitions
 D.5 Allowed additional parameters
 D.6 Examples
 D.7 Fonts and Symbols
  D.7.1 Allowed symbols
  D.7.2 Allowed fonts
   D.7.2.1 Allowed fonts for Linux
   D.7.2.2 Allowed fonts for MacOS X
E Appendix: The Measurement Equation and Calibration
 E.1 The HBS Measurement Equation
 E.2 General Calibrater Mechanics
F Appendix: Annotated Example Scripts
G Appendix: CASA Dictionaries
 G.1 AIPS – CASA dictionary
 G.2 MIRIAD – CASA dictionary
 G.3 CLIC – CASA dictionary
H Appendix: Writing Tasks in CASA
 H.1 The XML file
 H.2 The file
 H.3 Example: The clean task
  H.3.1 File clean.xml
  H.3.2 File

More information about CASA may be found at the CASA web page

Copyright © 2010 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense

Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search