CASA on Amazon Web Services: Example using CASA

Overview of Using a CASA Tutorial on AWS

Amazon Web Services (AWS) allows researchers to use Instances for NRAO data processing. This document presents readying an Instance to process a data set with CASA. The CASA tutorial will be used as a demostration of running CASA on AWS.

Choose an Instance

The tutorial does not require an instance with a lot of CPU and RAM. Per the hardware requirements page, https://casa.nrao.edu/casa_hardware-requirements.shtml#memp 500MB per core is adequate. An m4.xlarge is more that adequate. It's cost is $0.24/hour. It has 2 cores and 16 GB RAM. A smaller instance such as m4.large would probably work as well except it has 1 core and could not run things in parallel.

Get Ready to Start an Instance

Follow the directions on the AMI page, https://casa.nrao.edu/casa_aws_machine-image.shtml, to locate an NRAO AMI. Select the AMI and from the Actions menu choose Launch. Select the m4.xlarge image type, which, as mentioned above, should be adequate for the tutorial at 2 cores and 8 GB/core. After that, we often press the "Review and Launch" button to skip to the end of the process. However we need to add some storage first.

Start an Instance with Some Extra Storage Space

Select "4. Add Storage" at the top. You can see the root volume is by default 8 GB. For the tutorial we might get by with 8 GB, but enlarging the root volume will remove any doubt. Change 8 to 1024 (the upper limit for the root volume). You might notice a checkbox called "Delete on Termination". For root volumes this is the default. Unchecking it causes the root volume to persist after shutdown of the instance. The charges for storing a terminated instance are minimal compared to the charge for a running one. The user (or a coworker with adequate privileges) can mount the EC2 volme on another instance. After making this selection, click Review and Launch. Then click "Launch". You are asked for the ssh key pair that will allow ssh access to the instance you are about to start. There is more information about key pairs in the final subsection here: https://casa.nrao.edu/casa_aws_user-setup.shtml If possible use an existing key pair. Click Launch to start the instance.

Logging into Your Instance

Once the instance has had a couple of minutes to start, you can see in the Instances screen the running (and recently terminated) instances. Your instance is identifiable by the Key Name and the fact that under Status Checks it says "Initializing." Copy the external IP address and login to the instance: ssh -i ~/.ssh/mykeyname.pem ec2-user@my-IP-address If login is not immediate, try again in a minute or so.

Using an NRAO AMI to start an Instance brings up an instance with CASA already installed. Everything you need to run CASA should be there except for the data, which will be downloaded directly to the instance in a later step.

The CASA tutorial web page:
https://casaguides.nrao.edu/index.php?title=VLA_high_frequency_Spectral_Line_tutorial_-_IRC%2B10216.

Once you are logged into your Instance, you may download the example data.
wget https://casa.nrao.edu/Data/EVLA/IRC10216/day2_TDEM0003_10s_norx.tar.gz

Downloading the Data

You'll want to put the tutorial data onto the new instance. Make sure you are logged into the instance, and, to find the data's location, go to the "VLA high frequency Spectral line tutorial...." page by clicking on the link at the top of this page. Then click on "2 Obtaining the Data". And copy the URL and download and extract the data:
wget http://casa.nrao.edu/Data/EVLA/IRC10216/day2_TDEM0003_10s_norx.tar.gz
tar xf day2_TDEM0003_10s_norx.tar.gz

Launching and Running CASA

Typing casa will start the pre-installed version of casa. The first time it is run, it will take a few minutes to initialize. An Ipython interpreter for CASA will eventually open, ready for commands to CASA. (The CASA log window should display as well.)

Display the antenna map:

plotants(vis='day2_TDEM0003_10s_norx',figfile='ant_locations.png')

Plot the measurement set, amplitude vs. uv-distance:

plotms(vis='day2_TDEM0003_10s_norx',field='3', xaxis='uvdist',yaxis='amp',correlation='RR,LL', avgchannel='64',spw='0~1:4~60', coloraxis='spw')

Flag data:

flagdata(vis='day2_TDEM0003_10s_norx', mode='list', inpfile=["field='2,3' antenna='ea12' timerange='03:41:00~04:10:00'", "field='2,3' antenna='ea07,ea08' timerange='03:21:40~04:10:00' spw='1'"])

Transfer data:

When you are done with your instance and want to move the data on its root volume to your local storage, you can use scp -r or rsync -a . For example, suppose your data are on your instance in your directory /home/ec2-user/output_data/.

Staff  |   Policies  |   Diversity