Difference between revisions of "Simulating Observations in CASA v3.0.1"

From CASA Guides
Jump to: navigation, search
 
(58 intermediate revisions by 7 users not shown)
Line 1: Line 1:
As of release 3.0.0, CASA's tools to produce simulated interferometric data are quite powerful.  As with all aspects of
+
[[Category: Simulations]] [[Category: ALMA]]
CASA, there is a beginner-level python <tt>task</tt> interface called <tt>simdata</tt>, which calls methods in the <tt>sm</tt> C++ <tt>tool</tt>.  The task interface turns a model of the sky (2 to 4 dimensions including frequency and Stokes) into the visibilities that would be measured with ALMA, (E)VLA, CARMA, SMA, ATCA, PdB, etc.  The task also can produce a cleaned image of the model visibilities, compare that image with your input convolved with the synthesized beam, and calculate a fidelity image.  <tt>simdata</tt> can add thermal noise (from receiver, atmosphere, and ground) to the visibilities.   
+
 
 +
== Introduction ==
 +
 
 +
Simulation capability in CASA follows the usual two-layered structure: there is a beginner-level python <tt>task</tt> interface called [[simdata]], which calls methods in the <tt>sm</tt> C++ <tt>tool</tt>.  The task interface turns a model of the sky (2 to 4 dimensions including frequency and Stokes) into the visibilities that would be measured with ALMA, (E)VLA, CARMA, SMA, ATCA, PdB, etc.  The task also can produce a cleaned image of the model visibilities, compare that image with your input convolved with the synthesized beam, and calculate a fidelity image.  <tt>simdata</tt> can add thermal noise (from receiver, atmosphere, and ground) to the visibilities.   
  
 
The <tt>sm</tt> tool has methods that can be used to add phase delay variations, gain fluctuations and drift, cross-polarization, and (coming soon) bandpass and pointing errors to your simulated data.  <tt>sm</tt> also has more flexibility in adding thermal noise than <tt>simdata</tt>, for example for new observatories that are unknown to <tt>simdata</tt>.
 
The <tt>sm</tt> tool has methods that can be used to add phase delay variations, gain fluctuations and drift, cross-polarization, and (coming soon) bandpass and pointing errors to your simulated data.  <tt>sm</tt> also has more flexibility in adding thermal noise than <tt>simdata</tt>, for example for new observatories that are unknown to <tt>simdata</tt>.
 +
 +
<font color="red">New for 3.0.2</font>:  Two task interfaces will be present, the old <tt>simdata</tt> and a new <tt>simdata2</tt>.  We recommend using <tt>simdata2</tt> -- <tt>simdata</tt> is being retained because it has had more extensive testing, and <tt>simdata2</tt> is very new, but in the future <tt>simdata</tt> will be removed.
 +
 +
  
 
CASA simulation uses the [http://www.mrao.cam.ac.uk/~bn204/alma/atmomodel.html aatm] atmospheric model, a thin wrapper of Juan Pardo's [http://damir.iem.csic.es/PARDO/class_atm.html ATM] library, to accurately calculate all atmospheric corruption terms (noise, phase delay) accurately as a function of frequency and site characteristics.
 
CASA simulation uses the [http://www.mrao.cam.ac.uk/~bn204/alma/atmomodel.html aatm] atmospheric model, a thin wrapper of Juan Pardo's [http://damir.iem.csic.es/PARDO/class_atm.html ATM] library, to accurately calculate all atmospheric corruption terms (noise, phase delay) accurately as a function of frequency and site characteristics.
Line 8: Line 15:
 
Part of CASA's simulation routines are generic ephemeris and geodesy calculations available in python - see [[simutil.py]].
 
Part of CASA's simulation routines are generic ephemeris and geodesy calculations available in python - see [[simutil.py]].
  
<font color="green"><tt>simdata</tt> is under active development, documentation may lag reality, please email rindebet at nrao.edu with any questions - It's my job to help you use this software</font>
+
<font color="green"> Because <tt>simdata</tt> is still actively being developed, documentation may lag reality, please email rindebet at nrao.edu with any questions - It's my job to help you use this software.  In particular, you may find that some of the presentations and graphics below show parameter inputs that are slightly different from the latest version of CASA.</font>
  
 
== Steps to simulation ==
 
== Steps to simulation ==
 +
 +
<font color="red">If you have CASA 3.0.2 and simdata2, you should use simdata2</font>.  It's better and better supported.
 +
 +
{| style="width: 100%; valign: top; " cellpadding=10
 +
|- valign="top"
 +
 +
| style="width: 49%; valign:top; background-color:#FFFACD; border:1px solid #3366FF; " |
 +
<big>'''simdata'''</big><br />
 +
 
pdf presentation explaining the same things as below: [[File:Tutorial.dec2009.pdf]]  
 
pdf presentation explaining the same things as below: [[File:Tutorial.dec2009.pdf]]  
  
 
1. [[Getting Started in CASA#Installing CASA | Install CASA]]
 
1. [[Getting Started in CASA#Installing CASA | Install CASA]]
  
simdata inputs look like this (click to enlarge): [[File:Inputs.png|100px]]
+
[[simdata]] inputs look like this (v3.0.2; click to enlarge): [[File:Simdata.png|100px]]
  
 
the links below describe the various sections of inputs
 
the links below describe the various sections of inputs
  
2. [[Input Model]] - Preparing a patch of sky for <tt>simdata</tt> to pseudoobserve.<br>
+
2. [[Input Model]] - Preparing a patch of sky for [[simdata]] to pseudoobserve.<br>
* [https://safe.nrao.edu/wiki/bin/view/ALMA/InputExamples Sample Model Images]
 
* [[Simulation Recipes]] - a nearby galaxy with ALMA, a protoplanetary disk with SMA, etc
 
  
 
3. [[Antenna List]] - how to specify the positions and diameters of your antennas or stations.
 
3. [[Antenna List]] - how to specify the positions and diameters of your antennas or stations.
Line 31: Line 45:
 
6. [[Deconvolve Image]] (Optional) Go back from the calculated visibilities to a synthesis image
 
6. [[Deconvolve Image]] (Optional) Go back from the calculated visibilities to a synthesis image
  
 +
 +
 +
 +
 +
| style="width: 2%; valign:top; " |
 +
 +
| style="width: 49%; valign: top; background-color:#E0FFFF; border:1px solid #3366FF;" |
 +
<big>'''simdata2'''</big> <font color="red">Only works in CASA 3.0.2</font> [https://safe.nrao.edu/wiki/bin/view/Software/ObtainingCASA Obtaining CASA]<br />
 +
 +
1. [[Getting Started in CASA#Installing CASA | Install CASA]]
 +
 +
[[simdata2]] inputs look like this (v3.0.2; click to enlarge): [[file:Simdata2.png|100px]]
 +
 +
The subtasks are modular i.e. as long as you follow a few conventions about filenames, you can run each
 +
bit independently and optionally.  For example, you can modify the sky model, then predict ACA visibilities, then run again and predict
 +
ATCA 12m visibilities and image and analyze both measurement sets together.  You can run once to predict, run interactive clean yourself, and as long as you called your image $project.image, run <tt>simdata2</tt> just to calculate a difference image and analyze the results.
 +
 +
2. [[Modify Model]] - relabel (scale) the spectral and spatial coordinates and brightness of the sky model image.
 +
 +
3. [[Set Pointings]] - calculate a mosaic of pointings and save in a text file.  You could also make the text file yourself.
 +
 +
4. [[Predict]] - Calculate visibilities for a specified array on a specified day
 +
 +
5. [[Corrupt]] - Corrupt the measurement set with thermal noise, phase noise, cross-polarization, etc.
 +
 +
6. [[Image]] A subset of <tt>clean</tt> to re-image the visibilities
 +
 +
7. [[Analyze]] Calculate and display the difference between output and input, and fidelity image.
 +
|}
 +
 +
== Tutorials, Recipes, and Example images ==
 +
 +
{| style="width: 100%; valign: top; background-color:#E0FFFF; border:1px solid #3366FF; " cellpadding=0
 +
| Simulated ALMA Observation of M51 at z = 0.1 and z = 0.3:  fully annotated tutorial<br>
 +
This uses a BIMA-SONG cube of a nearby galaxy and scales it to greater distance.
 +
| rowspan=3; style="border-bottom:1px solid black;" | [[File:M51thumb.png|100px]]
 +
|-
 +
!style="solid black;"| [[M51 at z = 0.1|simdata page]] &nbsp;&nbsp; [[M51 at z = 0.1 and z = 0.3|simdata2 page]]
 +
|-
 +
!style="border-bottom:1px solid black;"| NOTE: increasing the [[etime study|exposure time]] to run faster
 +
|-
 +
 +
 +
| Protoplanetary Disk: sky model and lightly annotated script<br>
 +
This uses a theoretical model of dust continuum from Sebastian Wolf, scaled to the distance of a nearby star.
 +
| rowspan=2; stype="border-bottom:1px solid black;" | [[File:Psimthumb.png|100px]]
 +
|-
 +
!style="border-bottom:1px solid black;"| [[PPdisk simdata1| simdata page]] &nbsp;&nbsp; [[PPdisk simdata2| simdata2 page]]
 +
|-
 +
 +
| Nearby edge-on spiral galaxy: sky model, script, and discussion<br>
 +
This uses a Galactic CO cube from the Galactic Ring Survey and places
 +
it at 10Mpc, similar to what NGC891 would look like if it were observable from the southern hemisphere.
 +
| rowspan=2; style="border-bottom:1px solid black;" | [[File:N891thumb.png|100px]]
 +
|-
 +
!style="border-bottom:1px solid black;"| [[http://casaguides.nrao.edu/images/2/29/N891.simdata.py simdata script]] &nbsp;&nbsp; [[N891 simdata2| simdata2 page]]
 +
|-
 +
 +
| colspan=2; style="border-bottom:1px solid black;" | [[Sim Inputs | Other example input images]]
 +
|-
 +
| colspan=2; | [[Sim Outputs | Other example output simulations]] (scripts to reproduce these are coming)
 +
 +
|}
 +
 +
 +
<br>
  
 
== Technical and Planning ==
 
== Technical and Planning ==
I always welcome input on developing the CASA simulator, and these links are meetings, technical documents, and planning discussions.  Most of it won't make sense to a new user of CASA::simdata :)
+
I always welcome input on developing the CASA simulator, and these links are meetings, technical documents, and planning discussions.  Much of it won't make sense to a new user of CASA::simdata, but may be of interest to those wanting to delve deeper:
* [https://safe.nrao.edu/wiki/bin/view/ALMA/Jan2010Wkshop Jan 2010 workshop]
+
* [http://almasimulations.pbworks.com/ Simulation Library] This will become a library of use cases and examples illustrating different science and observation setups.  It is in early stages as of Jan 2010, and we're actively seeking volunteers to turn their simulation projects into use cases.
 +
* [https://safe.nrao.edu/wiki/bin/view/ALMA/Jan2010Wkshop Jan 2010 workshop] Including slides and discussion of how simdata and Simulator work "under the hood" and plans for development

Latest revision as of 21:03, 16 March 2012


Introduction

Simulation capability in CASA follows the usual two-layered structure: there is a beginner-level python task interface called simdata, which calls methods in the sm C++ tool. The task interface turns a model of the sky (2 to 4 dimensions including frequency and Stokes) into the visibilities that would be measured with ALMA, (E)VLA, CARMA, SMA, ATCA, PdB, etc. The task also can produce a cleaned image of the model visibilities, compare that image with your input convolved with the synthesized beam, and calculate a fidelity image. simdata can add thermal noise (from receiver, atmosphere, and ground) to the visibilities.

The sm tool has methods that can be used to add phase delay variations, gain fluctuations and drift, cross-polarization, and (coming soon) bandpass and pointing errors to your simulated data. sm also has more flexibility in adding thermal noise than simdata, for example for new observatories that are unknown to simdata.

New for 3.0.2: Two task interfaces will be present, the old simdata and a new simdata2. We recommend using simdata2 -- simdata is being retained because it has had more extensive testing, and simdata2 is very new, but in the future simdata will be removed.


CASA simulation uses the aatm atmospheric model, a thin wrapper of Juan Pardo's ATM library, to accurately calculate all atmospheric corruption terms (noise, phase delay) accurately as a function of frequency and site characteristics.

Part of CASA's simulation routines are generic ephemeris and geodesy calculations available in python - see simutil.py.

Because simdata is still actively being developed, documentation may lag reality, please email rindebet at nrao.edu with any questions - It's my job to help you use this software. In particular, you may find that some of the presentations and graphics below show parameter inputs that are slightly different from the latest version of CASA.

Steps to simulation

If you have CASA 3.0.2 and simdata2, you should use simdata2. It's better and better supported.

simdata

pdf presentation explaining the same things as below: File:Tutorial.dec2009.pdf

1. Install CASA

simdata inputs look like this (v3.0.2; click to enlarge): Simdata.png

the links below describe the various sections of inputs

2. Input Model - Preparing a patch of sky for simdata to pseudoobserve.

3. Antenna List - how to specify the positions and diameters of your antennas or stations.

4. Specifying Observation - how to set up what/when/how you want to observe, and the output image details

5. Corrupting Observation - (Optional) For added realism, corrupt your visibilities with thermal and phase noise.

6. Deconvolve Image (Optional) Go back from the calculated visibilities to a synthesis image



simdata2 Only works in CASA 3.0.2 Obtaining CASA

1. Install CASA

simdata2 inputs look like this (v3.0.2; click to enlarge): Simdata2.png

The subtasks are modular i.e. as long as you follow a few conventions about filenames, you can run each bit independently and optionally. For example, you can modify the sky model, then predict ACA visibilities, then run again and predict ATCA 12m visibilities and image and analyze both measurement sets together. You can run once to predict, run interactive clean yourself, and as long as you called your image $project.image, run simdata2 just to calculate a difference image and analyze the results.

2. Modify Model - relabel (scale) the spectral and spatial coordinates and brightness of the sky model image.

3. Set Pointings - calculate a mosaic of pointings and save in a text file. You could also make the text file yourself.

4. Predict - Calculate visibilities for a specified array on a specified day

5. Corrupt - Corrupt the measurement set with thermal noise, phase noise, cross-polarization, etc.

6. Image A subset of clean to re-image the visibilities

7. Analyze Calculate and display the difference between output and input, and fidelity image.

Tutorials, Recipes, and Example images

Simulated ALMA Observation of M51 at z = 0.1 and z = 0.3: fully annotated tutorial

This uses a BIMA-SONG cube of a nearby galaxy and scales it to greater distance.

M51thumb.png
simdata page    simdata2 page
NOTE: increasing the exposure time to run faster
Protoplanetary Disk: sky model and lightly annotated script

This uses a theoretical model of dust continuum from Sebastian Wolf, scaled to the distance of a nearby star.

Psimthumb.png
simdata page    simdata2 page
Nearby edge-on spiral galaxy: sky model, script, and discussion

This uses a Galactic CO cube from the Galactic Ring Survey and places it at 10Mpc, similar to what NGC891 would look like if it were observable from the southern hemisphere.

N891thumb.png
[simdata script]    simdata2 page
Other example input images
Other example output simulations (scripts to reproduce these are coming)



Technical and Planning

I always welcome input on developing the CASA simulator, and these links are meetings, technical documents, and planning discussions. Much of it won't make sense to a new user of CASA::simdata, but may be of interest to those wanting to delve deeper:

  • Simulation Library This will become a library of use cases and examples illustrating different science and observation setups. It is in early stages as of Jan 2010, and we're actively seeking volunteers to turn their simulation projects into use cases.
  • Jan 2010 workshop Including slides and discussion of how simdata and Simulator work "under the hood" and plans for development