-
Notifications
You must be signed in to change notification settings - Fork 8
Practicals
#Practicals #UNDER CONSTRUCTION
-
Simulations 101
1.1. Create empty MS
1.1.1. makems
1.1.2. simms
1.2. Create Sky Model
1.3. MeqTrees - Imaging
- Corrupting and Calibrating Visibilities
- Beam me up
-
Inteferometry Scripting
5.1. Pyxis
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
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 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.
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.
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:
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).
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
.
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 |
---|---|
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.
As you may have seen in the fundamentals lecture the noise per visibility (real and imaginary) is given by
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.
The figure bellows shows the gains for each antenna.
Now lets see how good our G-Jones calibration was.
No G-Err | With G-Err | After G-Cal |
---|---|---|
That is pretty good! |
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 a sky model from the NVSS catalog nvss_sky
This is a 2 square degree field containing 102 sources. Lets start by tagging sources we will be using for the calibration (tagging sources in Tigger model is covered here). Tag all sources with brightness greater than 20mJy G --these sources will be used for gain calibration. Then add dE tag to sources with brightness greater than 0.5Jy -- these will be corrected for DDEs.
This is the plan for this section:
- Create an empty MS
- Simulate the sky model into MS (into DATA column) 2.1. Add noise 2.2. Add Gain errors 2.3. Add pointing errors (analytic WSRT cos3 beam)
- Image (DATA)
- Do a DIE calibration and Image
- Do a DDE calibration, while also applying DIE solutions and Image
- Image
Sim TDL P1 | Sim TDL P2 |
---|---|
Cal-G TDL Options | Cal-dE TDL Options |
---|---|
Simulated visibilities | After G-Cal | After dE-Cal |
---|---|---|
In this section we will write a pipeline that perfoms the steps described in the previous section. This section also serves as an introduction to Pyxis.