Skip to content
Sphesihle Makhathini edited this page Feb 9, 2015 · 29 revisions

#Practicals #UNDER CONSTRUCTION

Contents

  1. Simulations 101
    1.1. Create empty MS
    1.1.1. makems
    1.1.2. simms
    1.2. Create Sky Model
    1.3. MeqTrees
  2. Imaging
  3. Corrupting and Calibrating Visibilities
  4. Beam me up
  5. Inteferometry Scripting
    5.1. Pyxis

Simulations 101

When doing simulations the fisrt step is to create an empty measurement set (MS). The simulated data will be stored in the this MS.
In this section we introduce the makems and simms (CASA based) tools. Both these tools require a list of antenna positions for the observatory for which you want to simulate data. makems requires these positions to be in CASA Table format, while simms also allows ASCII files. Lets start with makems

makems

The observation settings for the MS are given to makems via a configuration file such as the one bellow; find the same file here.
AntennaTableName=MeerKAT64_ANTENNAS # list of antenna positions (CASA table)
NTimes=240 # number of integrations
StepTime=60 # integration time in seconds
StartFreq=1.4e9
StepFreq=10e6
NFrequencies=1
NBands=1
Declination=-30.0.0
RightAscension=0:0:0
StartTime=2011/11/16/15:00 # Must be carefully chosen in order to get a sensible uv-coverage
MSName=makems_meerkat_m30_4h60s.MS
MSDesPath=. # Where to save MS
NParts=1
WriteImagerColumns=True # include imaging columns; {MODEL,CORRECTED}_DATA
WriteAutoCorr=True # Include autocorrelations

Then simply run $ makems makems_config.cfg and you are almost good to go (ensure that you have the file MeerKAT64_ANTENNAS in your working directory). If the run was successful, you should see a file makems_meerkat_m30_4h60s.MS_p0 (Oleg Smirnov knows the reason for the p0 suffix), now rename this file makems_meerkat_m30_4h60s.MS; running makems may also produce other files with suffixes .gds and .vds, you can delete these files. If you have pyxis installed on your machine you can easily plot the uvcoverage by running
$ pyxis makems_meerkat_m30_4h60s.MS ms.plot_uvcov.

simms

simms requires CASA (version >= 4.22). Find simms here.
To make the same MS as above, run (see $ simms --help for more info): $ simms -T meerkat -l simms_meerkat_m30 -st 4 -dt 60 -ih -2 -f0 1.4GHz -df 10MHz -nc 1 -dir J2000,0deg,-30deg MeerKAT64_ANTENNAS
Then run $ pyxis makems_meerkat_m30_4h60s.MS ms.plot_uvcov to see the uvcoverage.

See this notebook for an illustration of how the uv-coverage is affected by the declination.

Create sky model

Now that we have an empty MS, we need a sky model from which to predict the visibilities to fill this MS. Lets make a singlesource model; copy and paste the lines below into a file (name it mysky.txt).

#format:name rad_d dec_d i emaj_s emin_s pa_d
S1 0 -30 1 0 0 0

The model has a 1Jy point source at ra,dec=0,-30 degrees.

Predicting Visibilities

We are finally ready to fill the empty MS with visibilities. We will use MeqTrees to achieve this.
Open the MeqBrowser ($ meqbrowser), start a MeqServer (press start) and load a simulation TDL script ; TDL -> Load TDL Script -> Cattery/Siamese/turbo-sim.py.
Lets set the compile time options: Compile time options

Sometimes useful to look at bookmarks; Select Bookmarks -> Output visibilities:inspector plot. To run the simulation press Run simulation button in the TDL Jobs and Runtime Options window. A panel with the visibilities for all the baselines should appear on the right (see screenhot below).

vis_insp

Lets go back to the previous window. Select TDL Exec, expand Imaging options in the window and set options as in the screenshot below, then press Make a dirty image. Imaging

After a few seconds, a tigger window should pop-up with the image. Then to make a clean image, expand Make a clean image then press the Make a clean image button. Below are the dirty and clean images from the simulation.

Dirty Map Clean Map
dirty_image clean_image

Imaging

Corrupting and Calibrating Visibilities

For simulations to be useful, they must include the propergation and instrumental effects that corrupt radio signals. These corruptions mainly fall into two classes. First, we have direction independent effects (DIEs), which include reciever gains and phase errors induced by the troposphere. Then, we have direction dependent effects (DDEs). These effects vary across the sky; the primary beam gain is an example of such an effect.

The general measurement equation of a radio interferometer can be written as:
V_{pq} = \mathbf{G}_p(\sum _s \mathbf{E}_{sp} X_{spq} \mathbf{E}_{sq}^H)\mathbf{G_q^H}
where G represents all direction independent effects, E represents all the direction dependent effects and X is the sky coherency. This is the equation we will be solving when we are calibrating.

Thermal Noise

As you may have seen in the fundamentals lecture the noise per visibility (real and imaginary) is given by $\sigma_{\text{vis}}=\sqrt{SEFD/(2\Delta\mu\Delta t)}$, from this equation it is evident that the thermal noise can be driven arbitrarily low by observing for longer. Below we show a series of images as the visibility noise is increased. noisy1 noisy2 noisey3 noisy4

Complex receiver gains

This section demonstrates the calibration principle in a very simple way. We will simulate an observation of a central point source, then fake some gain variations on the observation and examine the difference. Finally we will solve for these gain drifts and remove them.

In this case, the RIME reduces to:
V_{pq} = \mathbf{G}_p X_{pq} \mathbf{G_q^H}

We will again use turbo-sim.py to simulate a point source at the phase centre, but this time we add gain errors. sim_gain The figure bellows shows the gains for each antenna. sim_vis_insp

Now lets see how good our G-Jones calibration was.

No G-Err With G-Err After G-Cal
sim_vis sim_gain_insp sim_gain_insp
That is pretty good!

Direction Dependent Effects

The single component model we have been using thus far is not edeqaute to illustrate DDE effects, so lets use something a bit more interesting. Find the sky model here)

This is a 2 square degree field containing 102 sources.

This is the plan for this section:

  1. Create an empty MS
  2. Simulate the sky model into MS (into DATA column)
    2.1. Add noise
    2.2. Add pointing errors (analytic WSRT cos3 beam)
  3. Do a G calibration
  4. Do a G+dE Calibration (dEs will only be applied to surces with I>0.05)
Sim TDL P1 Sim TDL P2
simp1 simp2
Cal TDL P1 Cal TDL P2 Cal TDL (dE)
cal_gcal_wb1 dde_gcal_wb2 dde_dE
Simulated visibilities G With beam G without beam G+dE without beam
sim_vis gcal_vis gcal_nb dEcal_nb

Interferometry Scripting (Pyxis)

In this section we will write a pipeline that performs the steps described in the previous section. This section also serves as an introduction to Pyxis. Find the pipeline here

Sekuphelile.

Clone this wiki locally