WorkshopImaging: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Aleroy (talk | contribs)
Aleroy (talk | contribs)
Line 70: Line 70:


[[File:basic_imaging.py]]
[[File:basic_imaging.py]]
This script provides your basic introduction to imaging. You need to run it in a directory so that "../../calib/" points to the provided science verification data.
You can image the continuum from any and all of the single-field science verification data. A few comments:
* "help" and "inp" are your friends. Use these to explore any tasks that you are unfamiliar with.
* '''listobs''' is always a good first bet to get your bearings. Remember that you can direct the output to a file via the "listfile" parameter.
* "#" is the python comment symbol. Lines beginning with this will not be processed by the casapy shell. The script includes some suggestions for alternative settings commented out and you can edit it (it's your copy) to change between these.
* '''split'''


=== Script 2: Multifrequency Synthesis with Spectral Indices ===
=== Script 2: Multifrequency Synthesis with Spectral Indices ===

Revision as of 16:36, 21 November 2011

This page describes the hands-on imaging portion of the ALMA data reduction workshop. In this session you will use ALMA Science Verification data to explore CASA's imaging capabilities. This page describes the data and introduces the scripts. It is not a full-fledged CASA guide, only background for the hands on portion of the workshop.

Data Description

Currently five ALMA Science Verification data sets have been released. The calibrated u-v data for all five projects should appear in your cluster account in the directory "imaging/calib/". Briefly the projects are:

  • NGC3256_Band3 Single-field observations of the nearby starburst galaxy NGC 3256 in Band 3. The data were taken in "TDM" mode and so have low frequency resolution compared to the other data sets here (about 15 MHz per channel). The spectral windows cover the CO J=1-0 line, a CN doublet, and the 3mm continuum. All three types of emission are visible and extended in the data. There is a full CASA Guide describing the reduction and imaging of these data here: NGC3256Band3.
  • TWHYA_BAND7 Single-field observations of the debris disk around the nearby pre main sequence star TW Hya in Band 7. These data have high frequency resolution (they are "FDM" mode) and cover the 850 micron continuum, the CO J=3-2 line, and HCO+ J=4-3 line. There is a full CASA Guide describing the reduction and imaging of these data here: TWHydraBand7.
  • TWHYA_BAND6 Single-field observations of TW Hya in Band 6. These data have high frequency resolution and cover 1mm continuum, the CO J=2-1 line, and the DCN J=3-2 line. These data do not have an associated CASA guide because the approach closely resembles that used for TW Hya Band 7. They were released with an annotated script, which is included in the same directory as the calibrated data.
  • TWHYA_BAND3 Single-field observations of TW Hya in Band 3. These data have high frequency resolution and cover 3mm continuum and the HCO+ J=1-0 line. These data do not have an associated CASA guide because the approach closely resembles that used for TW Hya Band 7. They were released with an annotated script, which is included in the same directory as the calibrated data.
  • Antennae_Band7 Two mosaics targeting the nearby merging galaxies NGC 4038 and NGC 4039 in Band 7. These data have high frequency resolution (though they have been somewhat averaged) and cover the 850 micron continuum and the CO J=3-2 line. These data contain two separate mosaics (collections of pointings), one targeting the northern component of the Antennae galaxies and the other targeting the southern component. The mosaics do not overlap but are close enough that they can be combined into a single image if desired. There is a full CASA Guide describing the reduction and imaging of these data here: AntennaeBand7.

In each case, you should see a single measurement set (".ms" file) inside the directory associated with the data. These have already been bandpass, phase, and amplitude calibrated following the procedures described in the first day of the workshop. The science targets have been separated out from the rest of the data (using the split task), yielding the calibrated measurement sets in your directories. We will use these to explore imaging in CASA.

Recommended Workflow

Imaging in CASA revolves around the clean task. clean has a wide array of modes and options, many of which have been discussed in the morning lecture. For the imaging hands-on session, we provide scripts to set you up imaging the science verification data. These scripts all center on calls to clean. Given the size of the data and the power of the cluster you should have no problem running them repeatedly, changing key parameters to explore their effects on the output image. The scripts cover:

  • Basic continuum imaging In the first script, you will take any of the data sets and produce a "continuum" image by averaging together data at all frequencies into a single image. This will introduce you to the basic setup of the clean task and using the viewer for interactive cleaning and data inspection. You have the opportunity to explore the effects stopping conditions, u-v weighting, and gridding parameters.
  • Multifrequency synthesis with spectral indices For high signal-to-noise data sets with large fractional bandwidth it can be important to account for the frequency dependence ("spectral index") of continuum emission when constructing an image. CASA's multifrequency synthesis ("mfs") mode allows modeling of sources with frequency-dependent intensity. Using this script you can explore the application of this algorithm to the TW Hydra data sets.
  • Line imaging Imaging spectral lines introduces two new complexities. The spectral axis needs to be specified via the "velocity", "frequency", or "channel" modes of clean and line and continuum emission need to be separated from one another. We will see how to separate line and continuum emission in the u-v domain using uvcontsub and then build data cubes using clean.
  • Mosaic imaging clean can build mosaics out of data sets with multiple pointing centers. We will experiment with this mode on the Antennae data sets.

We suggest working through in order of increasing complexity. Each call should take no longer than a minute to run, so there should be plenty of time to experiment with each type of imaging during the two hour session.

Scripts

Practical Approach

Setup: We recommend that you open each script in turn in your favorite editor and start up a "casapy" session in another window. Most of the scripts have a few preparatory calls, often averaging or copying the data to make a working copy that can be quickly processed. Step through these, reading the comments and making sure that you understand what is going on, then focus on the clean call.

Syntax: In the scripts tasks other than clean are called using inline parameters, e.g., "split(vis='suchandsuch.ms')", and can be directly pasted in to the command line. This approach is generally favored for scripting because of the ease of copying and ready reproducibility (the task only knows about the parameters that you can see in the call). For the clean calls in these examples we will use the more instructive but potentially messier "AIPS-style" approach. We always initialize clean with its default parameters using:

# In CASA
default('clean')

and then we define the parameters of interest to us as global python variables with the appropriate names. At any time, you can check the current inputs to clean by typing

# In CASA
inp

CASA will indicate invalid selections via red color-coding.

Once you are happy with the parameters that you have set you can fire off clean by typing

# In CASA
go

or

# In CASA
clean

Script 1: Basic Continuum Imaging

File:Basic imaging.py

This script provides your basic introduction to imaging. You need to run it in a directory so that "../../calib/" points to the provided science verification data.

You can image the continuum from any and all of the single-field science verification data. A few comments:

  • "help" and "inp" are your friends. Use these to explore any tasks that you are unfamiliar with.
  • listobs is always a good first bet to get your bearings. Remember that you can direct the output to a file via the "listfile" parameter.
  • "#" is the python comment symbol. Lines beginning with this will not be processed by the casapy shell. The script includes some suggestions for alternative settings commented out and you can edit it (it's your copy) to change between these.
  • split

Script 2: Multifrequency Synthesis with Spectral Indices

File:Mfs imaging.py

Script 3: Line Imaging

File:Line imaging.py

Script 4: Mosaic Imaging

File:Mosaic imaging.py

Helpful Links