Simulation Guide Component Lists (CASA 3.3): Difference between revisions

From CASA Guides
Jump to navigationJump to search
Sschnee (talk | contribs)
Sschnee (talk | contribs)
Line 31: Line 31:
direction = "J2000 10h00m00.0s -30d00m00.0s"
direction = "J2000 10h00m00.0s -30d00m00.0s"
cl.done()
cl.done()
cl.addcomponent(dir=direction, flux=1.0, fluxunit='Jy', freq='230.0GHz', shape="Gaussian", majoraxis="0.1arcmin", minoraxis='0.05arcmin', positionangle='45.0deg')
cl.addcomponent(dir=direction, flux=1.0, fluxunit='Jy', freq='230.0GHz', shape="Gaussian",  
                majoraxis="0.1arcmin", minoraxis='0.05arcmin', positionangle='45.0deg')
ia.fromshape("Gaussian.im",[256,256,1,1],overwrite=True)
ia.fromshape("Gaussian.im",[256,256,1,1],overwrite=True)
cs=ia.coordsys()
cs=ia.coordsys()

Revision as of 15:35, 25 October 2011

Simulating Observations in CASA

This guide is applicable to CASA version 3.3.

To create a script of the Python code on this page see Extracting scripts from these tutorials.

Explanation of the guide

When planning an interferometric observation it is often useful to simulate observations of very simple objects, like point sources, Gaussians, and disks. In CASA, observations can be simulated using task sim_observe and analyzed using task sim_analyze. This guide will demonstrate how to simulate an ALMA observations of a Gaussian and some point sources using these tasks as well as the CASA Toolkit.

We begin by using component lists in the Toolkit to create an image of a Gaussian flux distribution, and this will be saved as a FITS file. The fits file will them be "observed" using sim_observe and sim_analyze along with four point sources, added via the componentlist parameter. Finally, we show how the same observations could have been done without any skymodel in sim_observe, instead using only component lists.

Getting Started

To get started you need CASA version 3.3

To install CASA, follow the instructions given on the Obtaining CASA page.

CASA Basics

CASA is the post-processing package for ALMA and EVLA and can handle both interferometric and single dish data. To get a brief introduction to sim_observe and sim_analyze, the tasks within CASA that we will use here, go to Simulation Guide for New Users. To learn more about CASA in general, go to the CASA homepage. Walk-throughs of CASA data reduction for a variety of data sets can be found on the CASA Guides website.

Once you have installed CASA, you can launch it by typing "casapy" at the prompt or by double-clicking on the icon, depending on your system and preferences.

Making a Simple FITS Image

Here we show how to create a simple FITS image using the CASA tasks and the toolkit. The example here will be that of a Gaussian flux distribution. Enter the following lines at the CASA prompt:

# In CASA
direction = "J2000 10h00m00.0s -30d00m00.0s"
cl.done()
cl.addcomponent(dir=direction, flux=1.0, fluxunit='Jy', freq='230.0GHz', shape="Gaussian", 
                majoraxis="0.1arcmin", minoraxis='0.05arcmin', positionangle='45.0deg')
ia.fromshape("Gaussian.im",[256,256,1,1],overwrite=True)
cs=ia.coordsys()
cs.setunits(['rad','rad','','Hz'])
cell_rad=qa.convert(qa.quantity("0.1arcsec"),"rad")['value']
cs.setincrement([-cell_rad,cell_rad],'direction')
cs.setreferencevalue([qa.convert("10h",'rad')['value'],qa.convert("-30deg",'rad')['value']],type="direction")
cs.setreferencevalue("230GHz",'spectral')
cs.setincrement('1GHz','spectral')
ia.setcoordsys(cs.torecord())
ia.setbrightnessunit("Jy/pixel")
ia.modify(cl.torecord(),subtract=False)
exportfits(imagename='Gaussian.im',fitsimage='Gaussian.fits',overwrite=True)

Simulating Observations with a FITS Image and a Component List

Simulating Observations with Just a Component List

Simulating Observations in CASA