CASA Reference
Free reference guide: CASA Reference
About CASA Reference
The CASA Reference is a searchable cheat sheet for NRAO's Common Astronomy Software Applications, organized into five workflow categories: data import, data inspection, calibration, imaging, and image analysis. Each entry provides the task name, a clear description, and Python-syntax usage examples covering the parameters you need most often when reducing radio interferometry data.
This reference covers the complete ALMA and VLA data reduction pipeline. The data import section includes importuvfits, importasdm, listobs, split, mstransform, and concat for Measurement Set management. The inspection tools cover plotms for visibility plotting (amplitude/phase vs. uvdist/time/frequency) and flagdata for RFI removal using manual, tfcrop, and other automated flagging modes.
The calibration section details setjy for flux model setting, gaincal for complex gain solutions, bandpass for frequency-dependent corrections, fluxscale for bootstrapping, applycal for applying tables, uvcontsub for continuum subtraction, and complete self-calibration workflows. The imaging section covers tclean with all deconvolver options (Hogbom, Clark, multiscale, MTMFS), weighting schemes (natural, uniform, Briggs), and spectral modes (MFS, cube). Image analysis tasks include imstat, imfit, immoments, exportfits, and the built-in viewer.
Key Features
- Data import tasks: importuvfits, importasdm for ALMA ASDM, listobs for observation summaries, split, mstransform, and concat
- Data inspection with plotms (amp/phase vs. uvdist/time/freq with color axes) and flagdata (manual, tfcrop automated RFI removal)
- Full calibration pipeline: setjy flux models, gaincal phase/amplitude solutions, bandpass frequency corrections, fluxscale bootstrapping
- tclean imaging with deconvolver selection (hogbom, clark, multiscale, mtmfs) and UV weighting (natural, uniform, briggs with robust parameter)
- Spectral imaging modes: MFS for continuum, cube for spectral line, with channel width and velocity frame control
- Self-calibration workflow with iterative gaincal and tclean steps for phase and amplitude refinement
- Image analysis: imstat for RMS/max/min statistics, imfit for Gaussian source fitting, immoments for moment 0/1/2 maps
- Export and visualization: exportfits for FITS output, viewer for interactive image display with contours and spectrum extraction
Frequently Asked Questions
What is CASA and what telescope data does it process?
CASA (Common Astronomy Software Applications) is the primary data reduction package developed by NRAO for processing radio interferometry data. It supports data from ALMA (Atacama Large Millimeter/submillimeter Array), VLA (Karl G. Jansky Very Large Array), and other radio telescopes. CASA provides Python-based tasks for the complete reduction pipeline from raw visibility data to science-ready images.
How do I import ALMA data into CASA?
For ALMA Science Data Model (ASDM) format, use "importasdm(asdm='uid___A002.asdm.sdm', vis='data.ms', asis='*')" to convert to a Measurement Set. For UVFITS files, use "importuvfits(fitsfile='data.uvfits', vis='data.ms')". After importing, run "listobs(vis='data.ms')" to inspect antenna configurations, spectral windows, sources, and scan information.
What is the difference between natural, uniform, and Briggs weighting in tclean?
Natural weighting gives each visibility equal weight, maximizing sensitivity but producing the lowest angular resolution (largest beam). Uniform weighting gives each UV cell equal weight, maximizing resolution but increasing noise. Briggs weighting provides a continuous adjustment between the two using the robust parameter: robust=2.0 approaches natural weighting, robust=-2.0 approaches uniform, and robust=0.5 is a common compromise balancing resolution and sensitivity.
How do I perform self-calibration in CASA?
Self-calibration is an iterative process: 1) Create an initial image with tclean, 2) Use gaincal with the model from the image to solve for phase corrections (calmode="p") with decreasing solution intervals, 3) Apply corrections with applycal, 4) Re-image and repeat. After phase self-cal converges, optionally switch to amplitude+phase (calmode="ap") with longer solution intervals. Each iteration should improve the image dynamic range.
What deconvolver should I use in tclean?
Use "hogbom" for fields dominated by point sources (fastest). Use "clark" for moderately extended sources. Use "multiscale" with scales=[0, 5, 15, 45] (in pixels) for significantly extended emission where multiple spatial scales are present. Use "mtmfs" (multi-term multi-frequency synthesis) for wideband continuum imaging where spectral index variation matters across the bandwidth.
How do I remove RFI from my data with flagdata?
For manual flagging, specify antenna, timerange, or spw: "flagdata(vis='data.ms', mode='manual', antenna='DV01', timerange='2024/01/01/00:00~01:00')". For automated flagging, use tfcrop mode: "flagdata(vis='data.ms', mode='tfcrop', datacolumn='data')" which identifies outliers in the time-frequency plane. Always inspect data with plotms before and after flagging to verify results.
How do I create moment maps from a spectral cube?
Use immoments with the moments parameter: "immoments(imagename='cube.image', moments=[0,1,2], chans='10~90', outfile='cube.mom0')". Moment 0 is the integrated intensity (sum across channels), moment 1 is the intensity-weighted mean velocity (velocity field), and moment 2 is the intensity-weighted velocity dispersion. The chans parameter selects which channels to include, excluding line-free channels.
What is uvcontsub and when should I use it?
uvcontsub performs continuum subtraction in the UV plane, which is essential before spectral line imaging. It fits a polynomial (fitorder) to specified line-free channels (fitspw) and subtracts the fit from all channels. For example: "uvcontsub(vis='target.ms', fitorder=1, fitspw='0:0~50;200~255')" uses channels 0-50 and 200-255 as continuum and subtracts a first-order polynomial. This must be done before creating spectral cubes of emission lines.