Simulating Observations in CASA 4.0: Difference between revisions

From CASA Guides
Jump to navigationJump to search
No edit summary
 
(18 intermediate revisions by 3 users not shown)
Line 7: Line 7:
== Introduction ==
== Introduction ==


The task [http://casa.nrao.edu/stable/docs/TaskRef/simobserve-task.html <tt>simobserve</tt>] can be used to simulate an observation in CASA.  <tt>simobserve</tt> turns a model of the sky (2 to 4 dimensions including frequency and polarization) into the visibilities that would be measured with ALMA, (E)VLA, CARMA, SMA, ATCA, PdB, et cetera.  <tt>simobserve</tt> can also add thermal noise (from receiver, atmosphere, and ground) to the visibilities.  <tt>simobserve</tt> 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.
The main tasks for simulating observations in CASA are [http://casa.nrao.edu/stable/docs/TaskRef/simobserve-task.html <tt>simobserve</tt>] and [http://casa.nrao.edu/stable/docs/TaskRef/simanalyze-task.html <tt>simanalyze</tt>].  <tt>simobserve</tt> turns a model of the sky (2 to 4 dimensions including frequency and polarization) into the visibilities that would be measured with ALMA, (J)VLA, CARMA, SMA, PdB, et cetera.  <tt>simobserve</tt> can also add thermal noise (from receiver, atmosphere, and ground) to the visibilities.  <tt>simobserve</tt> uses the [http://www.mrao.cam.ac.uk/~bn204/alma/atmomodel.html aatm] atmospheric model, a thin wrapper of Juan Pardo's [http://cab.inta-csic.es/users/jrpardo/class_atm.html ATM] library, to accurately calculate all atmospheric corruption terms (noise, phase delay) as a function of frequency and site characteristics.


After creating the visibilities, task [http://casa.nrao.edu/stable/docs/TaskRef/simanalyze-task.html <tt>simanalyze</tt>] will produce a cleaned image of the model visibilities, compare that image with your input convolved with the synthesized beam, and calculate a fidelity image.
After creating the visibilities, task <tt>simanalyze</tt> will produce a cleaned image of the model visibilities.  It will compare that image with your input convolved with the output clean beam, and then calculate a fidelity image that indicates how well the simulated output matches the convolved input image.
 
<tt>simobserve</tt> and <tt>simanalyze</tt> can be broken down into a series of steps, each of which is modular.  The major steps involved in simulating data with CASA are:
 
# [http://casa.nrao.edu/stable/docs/TaskRef/simobserve-task.html <tt>simobserve</tt>]
## Modify Model - relabel (scale) the spectral and spatial coordinates and brightness of the sky model image.
## Set Pointings - calculate a mosaic of pointings and save in a text file.  (You could also make a pointing text file yourself.)
## Predict - Calculate visibilities for a specified array on a specified day.
## Corrupt - Corrupt the measurement set with thermal noise, phase noise, cross-polarization, etc.
# [http://casa.nrao.edu/stable/docs/TaskRef/simanalyze-task.html <tt>simanalyze</tt>]
## Image - Image the visibility data with CASA's [http://casa.nrao.edu/stable/docs/TaskRef/clean-task.html <tt>clean</tt>] task.
## Analyze - Calculate and display the difference between output and input, and fidelity image.
 
The "Simulation Guide for New Users" tutorial (linked below) introduces and explains the individual steps in detail.  It is possible to run the steps indedependently and optionally, as long as you are careful to follow the <tt>simobserve</tt> and <tt>simanalyze</tt> conventions about filenames. 


<u>Taskname History</u>
<u>Taskname History</u>
The simulation tasks have been under significant revision and development.
The simulation tasks have been under significant revision and development.
* In CASA 3.3 <tt>simobserve</tt> and <tt>simanalyze</tt> were named <tt>sim_observe</tt> and <tt>sim_analyze</tt>, respectively.   
* In CASA 3.3 <tt>simobserve</tt> and <tt>simanalyze</tt> were named <tt>sim_observe</tt> and <tt>sim_analyze</tt>, respectively.   
* In CASA 3.4 and earlier, the functionality of both tasks was contained in task simdata, which is now removed.
* In CASA 3.4 and earlier, the functionality of both tasks was contained in task simdata, which is now obsolete.
* In CASA 4.0, a new experimental task [http://casa.nrao.edu/stable/docs/TaskRef/simalma-task.html <tt>simalma</tt>] has been introduced, which simplifies simulation of 12m interferometric + 7m interferometric + total power ALMA observations.  Please report any issue with <tt>simalma</tt>, and check back here for an upcoming <tt>simalma</tt> casaguide.
<!--
* In CASA 4.1, a new experimental task [http://casa.nrao.edu/stable/docs/TaskRef/simalma-task.html <tt>simalma</tt>] has been introduced, which simplifies simulation of 12m interferometric + 7m interferometric + total power ALMA observations.  Please report any issue with <tt>simalma</tt>, and check back here for an upcoming <tt>simalma</tt> casaguide.
-->
 
== ALMA Simulations and Proposals ==
 
Although <tt>simobserve</tt> can simulate data for many instruments, this guide (and the tutorials linked below) focuses in particular on simulating ALMA observations.  ALMA is still under construction.  We will update CASA's simulation tasks and tools as ALMA commissioning proceeds. During this period, we expect the noise properties of the telescope to be increasingly better characterized, and its configurations to be refined.
 
Rigorous verification of the noise calculations between <tt>simobserve</tt> and the [https://almascience.nrao.edu/call-for-proposals/sensitivity-calculator ALMA sensitivity calculator] are performed periodically. (The ALMA Observation Preparation Tool uses the same algorithm as the ALMA sensitivity calculator.)  The most recent such verification was performed during August 2012.
 
The noise in a synthesis image is dependent on the imaging and deconvolution parameters; therefore small differences between the simple radiometer-equation based [https://almascience.nrao.edu/call-for-proposals/sensitivity-calculator ALMA sensitivity calculator] and <tt>simobserve</tt>/<tt>simanalyze</tt> are to be expected.  See [https://science.nrao.edu/facilities/alma/index/facilities/alma/community1/naasc-memo-series NAASC memo 102] for more discussion.  


== Simulating ALMA Observations ==
Larger differences between the radiometer equation and a simulation may also result in a simulated image that is limited by dynamic range.  It is for this reason that ALMA users should consider running a simulation when applying for telescope time.  The results of the simulation can be a strong support to one's observing proposal, as a way to demonstrate the scientific feasibility of the observing plan.


Although simobserve can simulate data for many instruments, this guide (and the tutorials linked below) focuses in particular on simulating ALMA observations.  ALMA is still under construction.  We will update CASA's simulation tasks and tools as ALMA commissioning proceeds. During this period, we expect the noise properties of the telescope to be increasingly better characterized, and its configurations to be refined.
Finally, <tt>simobserve</tt> will not be able to provide realistic results if the pixel size of the input sky model is comparable to, or larger than, the simulated output clean beam.


Users should be aware of the Observation Support Tool (OST) [http://almaost.jb.man.ac.uk/ ]. This is a web-based interface to an ALMA simulator hosted by the University of Manchester, UK. Like the simobserve, it is based on the CASA <tt>sm</tt> toolkit, but uses different wrapper scripts, and, in particular, has a different treatment of atmospheric effects. Comparisons to the [https://almascience.nrao.edu/call-for-proposals/sensitivity-calculator ALMA sensitivity calculator] made in March 2011 suggest that both simobserve and the OST give similar noises for observations in bands 3 to 8.  However, the OST diverges in bands 9 and 10.  
Users should be aware of the Observation Support Tool (OST) [http://almaost.jb.man.ac.uk/ ]. This is a web-based interface to an ALMA simulator hosted by the University of Manchester, UK. Like <tt>simobserve</tt>, the OST is based on the CASA <tt>sm</tt> toolkit.  However, the OST and <tt>simobserve</tt> use different wrapper scripts and employ different treatment of atmospheric effects. Comparisons to the [https://almascience.nrao.edu/call-for-proposals/sensitivity-calculator ALMA sensitivity calculator] made in March 2011 suggest that both <tt>simobserve</tt> and the OST give similar noise level for observations in bands 3 through 8.  However, the results of the two tools diverge in bands 9 and 10.  


'''Since the ALMA sensitivity calculator will be used for the technical assessment of ALMA proposals, only values from it, not simobserve or the OST, should be used to estimate exposure times for ALMA Science Goals.'''
'''Values from <tt>simobserve</tt> or the OST should not be used to calculate exposure times for ALMA Science Goals.  Only values from the ALMA sensitivity calculator should be used for this purpose, as it is the ALMA sensitivity calculator that will be used in the technical assessment of ALMA proposals.  However, the results of simulations may be helpful to support a request for more observing time than is required by the sensitivity calculator, in order to obtain better uv-plane coverage.'''


== Tutorials ==
== Tutorials ==
Line 32: Line 56:
| rowspan=2 style="border-bottom:1px solid black;" | [[File:30Dor_ES.png|100px]]
| rowspan=2 style="border-bottom:1px solid black;" | [[File:30Dor_ES.png|100px]]
|-
|-
| style="border-bottom:1px solid black;" | A fully annotated tutorial that uses a Spitzer SAGE 8 micron continuum image of 30 Doradus and scales it to greater distance.
| style="border-bottom:1px solid black;" | A fully annotated tutorial that uses a Spitzer SAGE 8 micron continuum image of 30 Doradus and scales it to greater distance.  A good place for new users to start.
|-  
|-  
! [[Protoplanetary Disk Simulation (CASA 4.0)]]
| rowspan=2; stype="border-bottom:1px solid black;" | [[File:Psimthumb.png|100px]]
|-
| style="border-bottom:1px solid black;" | A sky model with a lightly annotated script that simulates a protoplanetary disk.  Uses a theoretical model of dust continuum from Sebastian Wolff, scaled to the distance of a nearby star.  This is another fairly generic simulation - if you're short on time, you probably don't need to go through this one and the New Users guide, but it can be useful to go through multiple examples.
|-
<!--
<!--
! [[M51 at z = 0.1 and z = 0.3 (CASA 4.0)]]
! [[M51 at z = 0.1 and z = 0.3 (CASA 4.0)]]
Line 44: Line 74:
| rowspan=2; style="border-bottom:1px solid black;" | [[File:Analyze_fits_list.jpg|100px]]
| rowspan=2; style="border-bottom:1px solid black;" | [[File:Analyze_fits_list.jpg|100px]]
|-
|-
| style="border-bottom:1px solid black;" | Tutorial for simulating data based on multiple sources (using both a FITS image and a component list).
| style="border-bottom:1px solid black;" | Tutorial for simulating data based on multiple sources (using both a FITS image and a component list).  If you are interested in simulating from a list of simple sources (point, Gaussian, disk), rather than or in addition to a sky model image, then read the considerations here.
|-
|-


! [[Protoplanetary Disk Simulation (CASA 4.0)]]
| rowspan=2; stype="border-bottom:1px solid black;" | [[File:Psimthumb.png|100px]]
|-
| style="border-bottom:1px solid black;" | A sky model with a lightly annotated script that simulates a protoplanetary disk.  Uses a theoretical model of dust continuum from Sebastian Wolff, scaled to the distance of a nearby star.
|-
<!--
<!--
! [[N891 simdata (CASA 3.4)]]
! [[N891 simdata (CASA 3.4)]]
Line 62: Line 87:
| rowspan=2; style="border-bottom:1px solid black;" | [[File:einstein_fs_cfg8_1hr.gif|100px]]
| rowspan=2; style="border-bottom:1px solid black;" | [[File:einstein_fs_cfg8_1hr.gif|100px]]
|-
|-
| style="border-bottom:1px solid black;" | A sky model and lightly annotated script that simulates the face of Einstein as seen by ALMA.  Uses a non-science image to demonstrate the effects of spatial filtering by ALMA.  
| style="border-bottom:1px solid black;" | A sky model and lightly annotated script that simulates the face of Einstein as seen by ALMA.  This simulation is particularly useful for those who wish to better understand spatial filtering by an interferometer, but doesn't demonstrate new capabilities of the simulation tasks beyond those described above.
|-
|-


Line 69: Line 94:
|-
|-
| style="border-bottom:1px solid black;" | A tutorial for simulating ALMA observations that use multiple configurations or use the
| style="border-bottom:1px solid black;" | A tutorial for simulating ALMA observations that use multiple configurations or use the
12-meter array in combination with the ALMA Compact Array.  
12-meter array in combination with the ALMA Compact Array.  Of particular interest to those wishing to explore multi-component ALMA observations and their combination and e.g. whether the ACA improves your scientific fidelity.
|}
|}


== Example Input and Output ==
=== Example Input Images ===
 
Several examples of input model images are showcased here: [[Sim Inputs]].


Several examples of simanalyze output images are showcased here: [[Sim Outputs]].
Several examples of input model images are showcased here: [[Sim Inputs]].  These may be useful for running your own simulation tests, beyond what are presented in the above tutorials.


== Advanced CASA Simulation ==
== Advanced CASA Simulation ==


=== Step-by-Step Simulations ===
=== Under the Hood: The sm Tool ===
 
simobserve and simanalyze can be broken down into a series of steps, each of which is modular.  As long as you follow a few conventions about filenames, you can run each bit independently and optionally.  For example, using simobserve, you can modify the sky model, then predict ACA visibilities, then run again and predict ATCA 12m visibilities.  With simanalyze you can image and analyze both the ACA and ATCA measurement sets together.  You can run interactive clean yourself, and, minding your filenames, you can run simanalyze just to calculate a difference image and analyze the results.
 
The major steps involved in simulating data with CASA are:


# simobserve
<tt>simobserve</tt> calls methods in the '''sm''' (simulation) tool.  For advanced CASA users, the <tt>sm </tt> tool has methods that can add to simulated data: phase delay variations, gain fluctuations and drift, cross-polarization, and (coming soon) bandpass and pointing errors<tt>sm </tt> also has more flexibility than <tt>simobserve</tt> in adding thermal noise. The tutorials linked from this page describe the simulation of data using the task interface only.  To learn more about the <tt>sm</tt> tool, see the [http://casa.nrao.edu/docs/CasaRef/CasaRef.html CASA Toolkit Reference Manual].
## [[Modify Model]] - relabel (scale) the spectral and spatial coordinates and brightness of the sky model image.
## [[Set Pointings]] - calculate a mosaic of pointings and save in a text fileYou could also make the text file yourself.
## [[Predict]] - Calculate visibilities for a specified array on a specified day.
## [[Corrupt]] - Corrupt the measurement set with thermal noise, phase noise, cross-polarization, etc.
# simanalyze
## [[Image]] - Image the visibility data with <tt>clean</tt>.
## [[Analyze]] - Calculate and display the difference between output and input, and fidelity image.
 
=== Under the Hood: The sm Tool ===


simobserve calls methods in the '''sm''' tool.  For advanced users, sm has methods that can add phase delay variations, gain fluctuations and drift, cross-polarization, and (coming soon) bandpass and pointing errors to simulated data. sm also has more flexibility in adding thermal noise than simobserve.  The tutorials linked from this page describe the simulation of data using the task interface only.  To learn more about sm, see the [http://casa.nrao.edu/docs/CasaRef/CasaRef.html CASA Toolkit Reference Manual].
The <tt>sm </tt> tool can be used to corrupt your measurement set with thermal noise, phase noise, cross-polarization, etc., in a more advanced way than is done in <tt>simobserve</tt>.  To learn advanced techniques for corrupting a simulated measurement set, see [[Corrupt]].


=== Ephemeris and Geodesy ===
=== Ephemeris and Geodesy ===
Line 105: Line 115:
== Warning: CLEAN Bias ==  
== Warning: CLEAN Bias ==  


As is the case for real images, cleaning images produced by simobserve can lead to a spurious decrease in object fluxes and noise on the image ("clean bias"). This is particularly true for observations with poor coverage of the uv-plane, i.e. using telescopes with small numbers of antennas, such as the ALMA Early Science configurations, and/or in short "snapshot" observations. Users should always clean images with care, using a small number of iterations and/or a conservative (3-5sigma) threshold and boxing bright sources.
As is the case for real images, cleaning images produced by <tt>simobserve</tt> can lead to a spurious decrease in object fluxes and noise on the image (an effect known as "clean bias"). This is particularly true for observations with poor coverage of the uv-plane, i.e. using telescopes with small numbers of antennas, such as the ALMA Early Science configurations, and/or in short "snapshot" observations. Users should always clean images with care, using a small number of iterations and/or a conservative (3-5sigma) threshold and boxing bright sources.


== User Feedback ==
== User Feedback ==


We welcome input on developing the CASA simulator.  Contact "rindebet at nrao.edu" if you would like to volunteer your input.
We welcome input on developing the CASA simulator.  Contact "rindebet at nrao.edu" if you would like to volunteer your input.

Latest revision as of 13:00, 3 November 2015


UNDER DEVELOPMENT

Introduction

The main tasks for simulating observations in CASA are simobserve and simanalyze. simobserve turns a model of the sky (2 to 4 dimensions including frequency and polarization) into the visibilities that would be measured with ALMA, (J)VLA, CARMA, SMA, PdB, et cetera. simobserve can also add thermal noise (from receiver, atmosphere, and ground) to the visibilities. simobserve uses the aatm atmospheric model, a thin wrapper of Juan Pardo's ATM library, to accurately calculate all atmospheric corruption terms (noise, phase delay) as a function of frequency and site characteristics.

After creating the visibilities, task simanalyze will produce a cleaned image of the model visibilities. It will compare that image with your input convolved with the output clean beam, and then calculate a fidelity image that indicates how well the simulated output matches the convolved input image.

simobserve and simanalyze can be broken down into a series of steps, each of which is modular. The major steps involved in simulating data with CASA are:

  1. simobserve
    1. Modify Model - relabel (scale) the spectral and spatial coordinates and brightness of the sky model image.
    2. Set Pointings - calculate a mosaic of pointings and save in a text file. (You could also make a pointing text file yourself.)
    3. Predict - Calculate visibilities for a specified array on a specified day.
    4. Corrupt - Corrupt the measurement set with thermal noise, phase noise, cross-polarization, etc.
  2. simanalyze
    1. Image - Image the visibility data with CASA's clean task.
    2. Analyze - Calculate and display the difference between output and input, and fidelity image.

The "Simulation Guide for New Users" tutorial (linked below) introduces and explains the individual steps in detail. It is possible to run the steps indedependently and optionally, as long as you are careful to follow the simobserve and simanalyze conventions about filenames.

Taskname History

The simulation tasks have been under significant revision and development.

  • In CASA 3.3 simobserve and simanalyze were named sim_observe and sim_analyze, respectively.
  • In CASA 3.4 and earlier, the functionality of both tasks was contained in task simdata, which is now obsolete.

ALMA Simulations and Proposals

Although simobserve can simulate data for many instruments, this guide (and the tutorials linked below) focuses in particular on simulating ALMA observations. ALMA is still under construction. We will update CASA's simulation tasks and tools as ALMA commissioning proceeds. During this period, we expect the noise properties of the telescope to be increasingly better characterized, and its configurations to be refined.

Rigorous verification of the noise calculations between simobserve and the ALMA sensitivity calculator are performed periodically. (The ALMA Observation Preparation Tool uses the same algorithm as the ALMA sensitivity calculator.) The most recent such verification was performed during August 2012.

The noise in a synthesis image is dependent on the imaging and deconvolution parameters; therefore small differences between the simple radiometer-equation based ALMA sensitivity calculator and simobserve/simanalyze are to be expected. See NAASC memo 102 for more discussion.

Larger differences between the radiometer equation and a simulation may also result in a simulated image that is limited by dynamic range. It is for this reason that ALMA users should consider running a simulation when applying for telescope time. The results of the simulation can be a strong support to one's observing proposal, as a way to demonstrate the scientific feasibility of the observing plan.

Finally, simobserve will not be able to provide realistic results if the pixel size of the input sky model is comparable to, or larger than, the simulated output clean beam.

Users should be aware of the Observation Support Tool (OST) [1]. This is a web-based interface to an ALMA simulator hosted by the University of Manchester, UK. Like simobserve, the OST is based on the CASA sm toolkit. However, the OST and simobserve use different wrapper scripts and employ different treatment of atmospheric effects. Comparisons to the ALMA sensitivity calculator made in March 2011 suggest that both simobserve and the OST give similar noise level for observations in bands 3 through 8. However, the results of the two tools diverge in bands 9 and 10.

Values from simobserve or the OST should not be used to calculate exposure times for ALMA Science Goals. Only values from the ALMA sensitivity calculator should be used for this purpose, as it is the ALMA sensitivity calculator that will be used in the technical assessment of ALMA proposals. However, the results of simulations may be helpful to support a request for more observing time than is required by the sensitivity calculator, in order to obtain better uv-plane coverage.

Tutorials

Simulation Guide for New Users (CASA 4.0) 30Dor ES.png
A fully annotated tutorial that uses a Spitzer SAGE 8 micron continuum image of 30 Doradus and scales it to greater distance. A good place for new users to start.
Protoplanetary Disk Simulation (CASA 4.0) Psimthumb.png
A sky model with a lightly annotated script that simulates a protoplanetary disk. Uses a theoretical model of dust continuum from Sebastian Wolff, scaled to the distance of a nearby star. This is another fairly generic simulation - if you're short on time, you probably don't need to go through this one and the New Users guide, but it can be useful to go through multiple examples.
Simulation Guide Component Lists (CASA 4.0) Analyze fits list.jpg
Tutorial for simulating data based on multiple sources (using both a FITS image and a component list). If you are interested in simulating from a list of simple sources (point, Gaussian, disk), rather than or in addition to a sky model image, then read the considerations here.
Einstein-Face (CASA 4.0) Einstein fs cfg8 1hr.gif
A sky model and lightly annotated script that simulates the face of Einstein as seen by ALMA. This simulation is particularly useful for those who wish to better understand spatial filtering by an interferometer, but doesn't demonstrate new capabilities of the simulation tasks beyond those described above.
ACA Simulation (CASA 4.0) M51c.ALMA 0.5arcsec.skymodel.png
A tutorial for simulating ALMA observations that use multiple configurations or use the

12-meter array in combination with the ALMA Compact Array. Of particular interest to those wishing to explore multi-component ALMA observations and their combination and e.g. whether the ACA improves your scientific fidelity.

Example Input Images

Several examples of input model images are showcased here: Sim Inputs. These may be useful for running your own simulation tests, beyond what are presented in the above tutorials.

Advanced CASA Simulation

Under the Hood: The sm Tool

simobserve calls methods in the sm (simulation) tool. For advanced CASA users, the sm tool has methods that can add to simulated data: phase delay variations, gain fluctuations and drift, cross-polarization, and (coming soon) bandpass and pointing errors. sm also has more flexibility than simobserve in adding thermal noise. The tutorials linked from this page describe the simulation of data using the task interface only. To learn more about the sm tool, see the CASA Toolkit Reference Manual.

The sm tool can be used to corrupt your measurement set with thermal noise, phase noise, cross-polarization, etc., in a more advanced way than is done in simobserve. To learn advanced techniques for corrupting a simulated measurement set, see Corrupt.

Ephemeris and Geodesy

Generic ephemeris and geodesy calculations can be done using CASA Python module simutil.py.

Warning: CLEAN Bias

As is the case for real images, cleaning images produced by simobserve can lead to a spurious decrease in object fluxes and noise on the image (an effect known as "clean bias"). This is particularly true for observations with poor coverage of the uv-plane, i.e. using telescopes with small numbers of antennas, such as the ALMA Early Science configurations, and/or in short "snapshot" observations. Users should always clean images with care, using a small number of iterations and/or a conservative (3-5sigma) threshold and boxing bright sources.

User Feedback

We welcome input on developing the CASA simulator. Contact "rindebet at nrao.edu" if you would like to volunteer your input.